ADOL-C: Automatic Differentiation in C/C++ 2.7.3
Loading...
Searching...
No Matches
Namespaces | Enumerations | Functions
psdrivers.h File Reference
#include <adolc/adolcexport.h>
#include <adolc/drivers/absnormalform.h>
#include <adolc/interfaces.h>
#include <adolc/internal/common.h>
#include <span>
Include dependency graph for psdrivers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ADOLC
 

Enumerations

enum class  ADOLC::UpdateConsts { ADOLC::True , ADOLC::False }
 Compile-time selector for constant-term updates in ADOLC::abs_normal. More...
 

Functions

template<UpdateConsts uc = UpdateConsts::True>
ADOLC_API int ADOLC::abs_normal (short tapeId, std::span< const double > x, AbsNormalForm &anf)
 Compute the abs-normal form of a taped function at a point.
 
template<>
ADOLC_API int ADOLC::abs_normal< UpdateConsts::True > (short tapeId, std::span< const double > x, AbsNormalForm &anf)
 Specialization that updates cy and cz after evaluation.
 
template<>
ADOLC_API int ADOLC::abs_normal< UpdateConsts::False > (short tapeId, std::span< const double > x, AbsNormalForm &anf)
 Specialization that leaves cy and cz unchanged.
 
BEGIN_C_DECLS ADOLC_API fint directional_active_gradient_ (fint, fint, double *, double *, double *, double **, short *)
 
ADOLC_API int directional_active_gradient (short tag, int n, const double *x, const double *d, double *g, short *sigma_g)
 
ADOLC_API fint abs_normal_ (fint *ftag, fint *fdepen, fint *findep, fint *fswchk, fdouble *fx, fdouble *fy, fdouble *fz, fdouble *fcz, fdouble *fcy, fdouble *fJ, fdouble *fY, fdouble *fZ, fdouble *fL)
 
ADOLC_API int abs_normal (short tag, int m, int n, int swchk, const double *x, double *y, double *z, double **Y, double **J, double **Z, double **L)
 Compute the ABS-normal form of a taped function.
 

Function Documentation

◆ abs_normal()

ADOLC_API int abs_normal ( short  tag,
int  m,
int  n,
int  swchk,
const double *  x,
double *  y,
double *  z,
double **  Y,
double **  J,
double **  Z,
double **  L 
)

Compute the ABS-normal form of a taped function.

This routine evaluates the abs-normal form in the same ordering used by the driver interfaces: function outputs first and switching variables second, i.e.

\[ \left[\begin{array}{c} y\\ z \end{array}\right] = \left[\begin{array}{c} b\\ c \end{array}\right] + \left[\begin{array}{cc} Y & J\\ Z & L \end{array}\right] \left[\begin{array}{c} x\\ |z| \end{array}\right] \]

(see Griewank et al.: Solving piecewise linear equations in abs-normal form) associated with a previously recorded tape. It computes function values, switching variables, and the components needed for piecewise-linear / piecewise-smooth analysis.

Warning
The ordering of switching variables and their corresponding rows in J, Z, and L is not guaranteed to be stable across different compilers, optimization levels, or minor changes in the taped operations.

For example, for

\[ f(x) = |x_0 - x_1| + |x_2 - x_3| \]

a compiler may process the absolute values in either order. As a consequence, the first switching variable may correspond to \(|x_0 - x_1|\) (so its row depends on \(x_0, x_1\)), or instead to \(|x_2 - x_3|\) (so its row depends on \(x_2, x_3\)). This yields a different row structure in the abs-normal form even though the mathematical function is identical.

Parameters
tagTape identifier.
mNumber of dependent variables.
nNumber of independent variables.
swchkNumber of switching variables (as returned by get_num_switches()).
xBase point (input values), array of length n.
yFunction values at x, array of length m.
zSwitching variable values, array of length swchk.
YMatrix of size m × n.
JMatrix of size m × swchk.
ZMatrix of size swchk × n.
LLower-triangular matrix of size swchk × swchk.
Returns
Zero on success, nonzero on failure.

◆ abs_normal_()

ADOLC_API fint abs_normal_ ( fint *  ftag,
fint *  fdepen,
fint *  findep,
fint *  fswchk,
fdouble *  fx,
fdouble *  fy,
fdouble *  fz,
fdouble *  fcz,
fdouble *  fcy,
fdouble *  fJ,
fdouble *  fY,
fdouble *  fZ,
fdouble *  fL 
)

◆ directional_active_gradient()

ADOLC_API int directional_active_gradient ( short  tag,
int  n,
const double *  x,
const double *  d,
double *  g,
short *  sigma_g 
)

◆ directional_active_gradient_()

BEGIN_C_DECLS ADOLC_API fint directional_active_gradient_ ( fint  ,
fint  ,
double *  ,
double *  ,
double *  ,
double **  ,
short *   
)