Ignore:
Timestamp:
Dec 18, 2018 11:29:51 AM (3 months ago)
Author:
kulshres
Message:

Fix typos and improve typesetting w.r.t. sec. external functions
regenerate doc

From: Martin Schroschk <martin.schroschk@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/doc/adolc-manual.tex

    r762 r763  
    29252925In the former case one may want to differentiate the parts in
    29262926question with a different AD tool or provide hand written derivatives.
    2927 To integrate these
    29282927In practice, however, sophisticated projects usually evolve over a long period of time.
    29292928Within this process, a heterogeneous code base for the project
     
    29332932Hence, different \mbox{AD-tools} may be combined with hand-derived
    29342933codes based on the same or different programming languages.
    2935 ADOL-C supports such settings  by the concept of externally
     2934ADOL-C supports such settings by the concept of externally
    29362935differentiated functions, that is, a function
    29372936not differentiated by ADOL-C itself. The required derivatives
     
    29392938
    29402939For this purpose, it is required that the externally differentiated
    2941 function (for example named {\sf\em euler\_step} ) has the following signature.
     2940function (for example named {\sf\em euler\_step} ) has the following signature
    29422941\smallskip
    29432942
    29442943\noindent
    2945 \hspace*{2cm}{\sf int euler\_step(int n, double *x, int m, double *y);}
     2944\hspace*{2cm}{\sf int euler\_step(int n, double *x, int m, double *y);} .
    29462945\medskip
    29472946
    29482947\noindent
    2949 Note that the formal paraemters in the signature have {\sf double} type, that is,
     2948Note that the formal paramters in the signature have {\sf double} type, that is,
    29502949they are not active as in the original program before the ADOL-C type change.
    29512950The externally differentiated function has to
    2952 be {\em registered}\footnote{we record the function pointer} using an \mbox{ADOL-C} method as follows.
     2951be {\em registered}\footnote{we record the function pointer} using an \mbox{ADOL-C} method as follows
    29532952\smallskip
    29542953
    29552954\noindent
    2956 \hspace*{2cm}{\sf ext\_diff\_fct *edf = reg\_ext\_fct(euler\_step);}.
     2955\hspace*{2cm}{\sf ext\_diff\_fct *edf = reg\_ext\_fct(euler\_step);} .
    29572956\smallskip
    29582957
    29592958\noindent
    29602959This returns a pointer to an {\sf ext\_diff\_fct} instance specific to the registered function.
    2961 Then, the user has to supply the function pointers for the call back methods (for example here
     2960Then, the user has to supply the function pointers for the callback methods (for example here
    29622961{\sf zos\_for\_euler\_step} and {\sf  fos\_rev\_euler\_step}) the user implemented
    2963 to compute the derivatives as follows.
     2962to compute the derivatives as follows:
    29642963\begin{tabbing}
    29652964\hspace*{2cm}\= {\sf edf-$>$zos\_forward = {\em zos\_for\_euler\_step};}\\
     
    29772976To facilitate the switch between active and passive versions of the parameters {\sf x} and {\sf y}
    29782977one has to provide (allocate) both variants. I.e. if the call to {\sf euler\_step} was originally
     2978\smallskip
     2979
    29792980\noindent
    29802981\hspace*{2cm}{\sf rc=euler\_step(n, sOld, m, sNew);}
    29812982\medskip
     2983
     2984\noindent
    29822985then the ADOL-C typechange for the calling context will turn  {\sf sOld} and {\sf sNew} in {\sf adouble} pointers.
    29832986To trigger the appropriate action for the derivative computation (i.e. creating an external differentiation entry on the trace)
    29842987the original call to the externally differentiated function
    29852988must be substituted by
    2986 \medskip
     2989\smallskip
    29872990
    29882991\noindent
    2989 \hspace*{2cm}{\sf rc=call\_ext\_fct(edf, n, sOldPassive, sOld, m, sNewPassive, sNew);}
     2992\hspace*{2cm}{\sf rc=call\_ext\_fct(edf, n, sOldPassive, sOld, m, sNewPassive, sNew);} .
    29902993\medskip
    29912994
     
    29962999example \verb=ext_diff_func= contained in
    29973000\verb=examples/additional_examples/ext_diff_func=.
    2998 There,the external differentiated function is also a C code, but the
    2999 handling as external differentiated functions also a decrease of the
     3001There, the external differentiated function is also a C code, but the
     3002handling as external differentiated function decreases the
    30003003overall required tape size.
    30013004
Note: See TracChangeset for help on using the changeset viewer.