Changeset 585


Ignore:
Timestamp:
Nov 7, 2014 6:55:22 AM (5 years ago)
Author:
kulshres
Message:

Compute the sparsity pattern of the Abs-Normal Jacobian

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

Location:
trunk/ADOL-C
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/include/adolc/interfaces.h

    r582 r585  
    442442ADOLC_DLL_EXPORT int fos_pl_sig_forward(short,int,int,const double*,double*,int,short*,short*,double*,double*,double*,double*,short*);
    443443ADOLC_DLL_EXPORT int fov_pl_sig_forward(short,int,int,int,const double*,double**,int,short*,short*,double*,double**,double*,double**,short*);
     444ADOLC_DLL_EXPORT int indopro_forward_absnormal(short,int,int,int,const double*,unsigned int**);
    444445/*--------------------------------------------------------------------------*/
    445446ADOLC_DLL_EXPORT int fos_pl_reverse(short,int,int,int,int,double*);
  • trunk/ADOL-C/include/adolc/sparse/sparsedrivers.h

    r537 r585  
    3636(short,int,int,const double*,unsigned int**,int*);
    3737
     38/*--------------------------------------------------------------------------*/
     39/*                                              abs-normal jacobian pattern */
     40/* absnormal_jac_pat(tag, m, n, s, argument,                                */
     41/*         crs[] [ crs[][0] = non-zero independent blocks per row ])        */
     42/*                                                                          */
     43ADOLC_DLL_EXPORT int absnormal_jac_pat
     44(short,int,int,int,const double*,unsigned int**);
    3845/*--------------------------------------------------------------------------*/
    3946/*                                         seed matrix for sparse jacobian  */
  • trunk/ADOL-C/src/Makefile.am

    r582 r585  
    5555libadolcsrc_la_SOURCES  += int_forward_s.c int_forward_t.c \
    5656                       indopro_forward_s.c indopro_forward_t.c \
     57                       indopro_forward_pl.c \
    5758                       nonl_ind_forward_s.c nonl_ind_forward_t.c \
    5859                       nonl_ind_old_forward_s.c nonl_ind_old_forward_t.c \
  • trunk/ADOL-C/src/sparse/sparsedrivers.cpp

    r566 r585  
    105105}
    106106
     107int absnormal_jac_pat(
     108    short          tag,       /* tape identification                       */
     109    int            depen,     /* number of dependent variables             */
     110    int            indep,     /* number of independent variables           */
     111    int            numsw,     /* number of switches                        */
     112    const double  *basepoint, /* independant variable values               */
     113    unsigned int **crs
     114    /* returned compressed row block-index storage                         */
     115    ) {
     116
     117    if (crs == NULL) {
     118        fprintf(DIAG_OUT,"ADOL-C user error in jac_pat(...) : "
     119                "parameter crs may not be NULL !\n");
     120        adolc_exit(-1,"",__func__,__FILE__,__LINE__);
     121    } else
     122        for (int i=0; i<depen+numsw; i++)
     123            crs[i] = NULL;
     124    return indopro_forward_absnormal(tag, depen, indep, numsw, basepoint, crs);
     125}
    107126/*--------------------------------------------------------------------------*/
    108127/*                                                 seed matrix for Jacobian */
  • trunk/ADOL-C/src/uni5_for.c

    r582 r585  
    157157#endif
    158158#if defined(_NTIGHT_)
     159#if defined(_ABS_NORM_)
     160#define GENERATED_FILENAME "indopro_forward_pl"
     161#else
    159162#define GENERATED_FILENAME "indopro_forward_s"
     163#endif
    160164#endif
    161165#endif
     
    652656
    653657  */
    654 
    655 
    656658#endif
    657659#if defined (_NTIGHT_)
     660#if defined(_ABS_NORM_)
     661int indopro_forward_absnormal(
     662    short             tnum,        /* tape id                              */
     663    int               depcheck,    /* consistency chk on # of dependents   */
     664    int               indcheck,    /* consistency chk on # of independents */
     665    int               swcheck,     /* consistency chk on # of switches    */
     666    const double     *basepoint,  /* independent variable values   (in)   */
     667    unsigned int    **crs)        /* returned row index storage (out)     */
     668
     669/* indopro_forward_absnormal( tag, m, n, s, x[n], *crs[s+m]),
     670  */
     671#else
    658672/****************************************************************************/
    659673/* First Order Vector version of the forward mode, bit pattern, safe        */
     
    669683
    670684  */
     685#endif
    671686#endif
    672687#else
     
    9881003#endif
    9891004
    990 #if !defined(_NTIGHT_)
    9911005    locint switchnum = 0;
     1006#if !defined(_NTIGHT_)
    9921007    double* signature = NULL;
    9931008#endif
     
    11101125          adolc_exit(-1,"",__func__,__FILE__,__LINE__);
    11111126      }
    1112 #if defined(_ABS_NORM_SIG_)
     1127#if defined(_ABS_NORM_SIG_) || defined(_INDOPRO_)
    11131128      if (swcheck != ADOLC_CURRENT_TAPE_INFOS.stats[NUM_SWITCHES]) {
    11141129        fprintf(DIAG_OUT,"ADOL-C error: forward sweep on tape %d  aborted!\n"
     
    12041219        ind_dom[i][1] = NUMNNZ;
    12051220    }
     1221#if defined(_ABS_NORM_)
     1222    indexd = swcheck;
     1223#endif
    12061224#endif
    12071225#if defined(_NONLIND_)
     
    42954313#if defined(_INDO_)
    42964314#if defined(_INDOPRO_)
     4315#if defined(_ABS_NORM_)
     4316                if (ind_dom[arg][0] != 0) {
     4317                    crs[switchnum] = (unsigned int*) malloc(sizeof(unsigned int)* (ind_dom[arg][0]+1));
     4318                    crs[switchnum][0] = ind_dom[arg][0];
     4319                    for(l=1;l<crs[switchnum][0];i++) {
     4320                        crs[switchnum][l] = ind_dom[arg][l+1];
     4321                    }
     4322                } else {
     4323                    crs[switchnum] = (unsigned int*) malloc(sizeof(unsigned int));
     4324                    crs[switchnum][0] = 0;
     4325                }
     4326                ind_dom[res][0] = 1;
     4327                ind_dom[res][2] = indcheck+switchnum;
     4328#else
    42974329                copy_index_domain(res, arg, ind_dom);
     4330#endif
    42984331#endif
    42994332#if defined(_NONLIND_)
     
    43674400#if !defined(_NTIGHT_)
    43684401                dp_T0[res] = fabs(dp_T0[arg]);
     4402#endif /* !_NTIGHT_ */
    43694403                if (ADOLC_CURRENT_TAPE_INFOS.stats[NO_MIN_MAX])
    43704404                    switchnum++;
    4371 #endif /* !_NTIGHT_ */
    43724405                break;
    43734406
Note: See TracChangeset for help on using the changeset viewer.