Changeset 370 for trunk/ADOL-C/include


Ignore:
Timestamp:
Nov 22, 2012 8:18:52 AM (7 years ago)
Author:
kulshres
Message:

Merge branch '2.3.x_ISSM' into svn

This introduces the new externally differentiated functions API

From: Jean Utke <utke@…>

Please see comments in ADOL-C/include/adolc/externfcts.h for details

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

File:
1 edited

Legend:

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

    r354 r370  
    2222BEGIN_C_DECLS
    2323
    24 typedef int (*ADOLC_ext_fct) (int n, double *x, int m, double *y);
     24typedef int (ADOLC_ext_fct) (int n, double *x, int m, double *y);
     25typedef int (ADOLC_ext_fct_fos_forward) (int n, double *dp_x, double *dp_X, int m, double *dp_y, double *dp_Y);
     26typedef int (ADOLC_ext_fct_fov_forward) (int n, double *dp_x, int p, double **dpp_X, int m, double *dp_y, double **dpp_Y);
     27typedef int (ADOLC_ext_fct_hos_forward) (int n, double *dp_x, int d, double **dpp_X, int m, double *dp_y, double **dpp_Y);
     28typedef int (ADOLC_ext_fct_hov_forward) (int n, double *dp_x, int d, int p, double ***dppp_X, int m, double *dp_y, double ***dppp_Y);
     29typedef int (ADOLC_ext_fct_fos_reverse) (int m, double *dp_U, int n, double *dp_Z, double *dp_x, double *dp_y);
     30typedef int (ADOLC_ext_fct_fov_reverse) (int m, int p, double **dpp_U, int n, double **dpp_Z, double *dp_x, double *dp_y);
     31typedef int (ADOLC_ext_fct_hos_reverse) (int m, double *dp_U, int n, int d, double **dpp_Z);
     32typedef int (ADOLC_ext_fct_hov_reverse) (int m, int p, double **dpp_U, int n, int d, double ***dppp_Z, short **spp_nz);
     33
    2534
    2635/**
     
    3443   * DO NOT touch - the function pointer is set through reg_ext_fct
    3544   */
    36   ADOLC_ext_fct function; 
     45  ADOLC_ext_fct *function; 
    3746
    3847  /**
     
    5564   * in examples/additional_examples/ext_diff_func/ext_diff_func.cpp 
    5665   */
    57   int (*zos_forward) (int n, double *dp_x,
    58                       int m, double *dp_y);
     66  ADOLC_ext_fct *zos_forward;
    5967
    6068  /**
     
    6371   * see also the explanation of the dp_X/Y  members below.
    6472   */
    65   int (*fos_forward) (int n, double *dp_x, double *dp_X,
    66                       int m, double *dp_y, double *dp_Y);
     73  ADOLC_ext_fct_fos_forward *fos_forward;
     74
    6775  /**
    6876   * this points to a  method implementing a forward execution of the externally differentiated function dp_y=f(dp_x)
     
    7078   * see also the explanation of the dpp_X/Y  members below.
    7179   */
    72   int (*fov_forward) (int n, double *dp_x, int p, double **dpp_X,
    73                       int m, double *dp_y, double **dpp_Y);
     80  ADOLC_ext_fct_fov_forward *fov_forward;
    7481  /**
    7582   * higher order scalar forward for external functions  is currently not implemented in uni5_for.c
    7683   */
    77   int (*hos_forward) (int n, double *dp_x, int d, double **dpp_X,
    78                       int m, double *dp_y, double **dpp_Y);
     84  ADOLC_ext_fct_hos_forward *hos_forward;
    7985  /**
    8086   * higher order vector forward for external functions  is currently not implemented in uni5_for.c
    8187   */
    82   int (*hov_forward) (int n, double *dp_x, int d, int p, double ***dppp_X,
    83                       int m, double *dp_y, double ***dppp_Y);
    84 
     88  ADOLC_ext_fct_hov_forward *hov_forward;
    8589  /**
    8690   * this points to a  method computing the projection dp_Z=transpose(dp_U) * Jacobian
    8791   * see also the explanation of the dp_U/Z  members below.
    8892   */
    89   int (*fos_reverse) (int m, double *dp_U,
    90                       int n, double *dp_Z);
    91 
     93  ADOLC_ext_fct_fos_reverse *fos_reverse;
    9294  /**
    9395   * this points to a  method computing the projection dpp_Z=transpose(dpp_U) * Jacobian
    9496   * see also the explanation of the dpp_U/Z  members below.
    9597   */
    96   int (*fov_reverse) (int m, int p, double **dpp_U,
    97                       int n, double **dpp_Z);
    98 
     98  ADOLC_ext_fct_fov_reverse *fov_reverse;
    9999  /**
    100100   * higher order scalar reverse for external functions  is currently not implemented in ho_rev.c
    101101   */
    102   int (*hos_reverse) (int m, double *dp_U,
    103                       int n, int d, double **dpp_Z);
     102  ADOLC_ext_fct_hos_reverse *hos_reverse;
    104103  /**
    105104   * higher order vector reverse for external functions  is currently not implemented in ho_rev.c
    106105   */
    107   int (*hov_reverse) (int m, int p, double **dpp_U,
    108                       int n, int d, double ***dppp_Z,
    109                       short **spp_nz);
     106  ADOLC_ext_fct_hov_reverse *hov_reverse;
    110107
    111108
     
    195192  short **spp_nz;
    196193
     194  /**
     195   * track maximal value of n when function is invoked
     196   */
     197  int max_n;
     198
     199  /**
     200   * track maximal value of m when function is invoked
     201   */
     202  int max_m;
     203
     204  /**
     205   * make the call such that Adol-C may be used inside
     206   * of the externally differentiated function;
     207   * defaults to non-0;
     208   * this implies certain storage duplication that can
     209   * be avoided if no nested use of Adol-C takes place
     210   */
     211  char nestedAdolc;
     212
     213  /**
     214   * if 0, then the 'function' does not change dp_x;
     215   * defaults to non-0 which implies dp_x values are saved in taylors
     216   */
     217  char dp_x_changes;
     218
     219  /**
     220   * if 0, then the value of dp_y prior to calling 'function'
     221   * is not required for reverse;
     222   * defaults to non-0 which implies  dp_y values are saved in taylors
     223   */
     224  char dp_y_priorRequired;
     225
    197226}
    198227ext_diff_fct;
Note: See TracChangeset for help on using the changeset viewer.