Reference documentation for deal.II version 9.1.0-pre
List of all members
Differentiation::AD::TapedDrivers< ADNumberType, ScalarType, T > Struct Template Reference

#include <deal.II/differentiation/ad/ad_drivers.h>

Static Public Member Functions

Taping
static void enable_taping (const types::tape_index tape_index, const bool keep_independent_values)
 
static void enable_taping (const types::tape_index tape_index, const bool keep_independent_values, const types::tape_buffer_sizes obufsize, const types::tape_buffer_sizes lbufsize, const types::tape_buffer_sizes vbufsize, const types::tape_buffer_sizes tbufsize)
 
static void disable_taping (const types::tape_index active_tape_index, const bool write_tapes_to_file)
 
static void print_tape_stats (std::ostream &stream, const types::tape_index tape_index)
 
Drivers for scalar functions (one dependent variable)
static ScalarType value (const types::tape_index active_tape_index, const std::vector< ScalarType > &independent_variables)
 
static void gradient (const types::tape_index active_tape_index, const std::vector< ScalarType > &independent_variables, Vector< ScalarType > &gradient)
 
static void hessian (const types::tape_index active_tape_index, const std::vector< ScalarType > &independent_variables, FullMatrix< ScalarType > &hessian)
 
Drivers for vector functions (multiple dependent variables)
static void values (const types::tape_index active_tape_index, const unsigned int n_dependent_variables, const std::vector< ScalarType > &independent_variables, Vector< ScalarType > &values)
 
static void jacobian (const types::tape_index active_tape_index, const unsigned int n_dependent_variables, const std::vector< ScalarType > &independent_variables, FullMatrix< ScalarType > &jacobian)
 

Detailed Description

template<typename ADNumberType, typename ScalarType, typename T = void>
struct Differentiation::AD::TapedDrivers< ADNumberType, ScalarType, T >

A driver class for taped auto-differentiable numbers.

It is intended that this class be specialized for the valid combinations of auto-differentiable numbers and output scalar number types.

Template Parameters
ADNumberTypeA type corresponding to a supported auto-differentiable number.
ScalarTypeA real or complex floating point number type that is the scalar value type used for input to, and output from, operations performed with auto-differentiable numbers.
TAn arbitrary type resulting from the application of the SFINAE idiom to selectively specialize this class.
Author
Jean-Paul Pelteret, 2017

Definition at line 156 of file ad_drivers.h.

Member Function Documentation

template<typename ADNumberType , typename ScalarType , typename T = void>
static void Differentiation::AD::TapedDrivers< ADNumberType, ScalarType, T >::enable_taping ( const types::tape_index  tape_index,
const bool  keep_independent_values 
)
static

Enable the recording mode for a given tape.

Parameters
[in]tape_indexThe index of the tape to be written.
[in]keep_independent_valuesDetermines whether the numerical values of all independent variables are recorded in the tape buffer.
template<typename ADNumberType , typename ScalarType , typename T = void>
static void Differentiation::AD::TapedDrivers< ADNumberType, ScalarType, T >::enable_taping ( const types::tape_index  tape_index,
const bool  keep_independent_values,
const types::tape_buffer_sizes  obufsize,
const types::tape_buffer_sizes  lbufsize,
const types::tape_buffer_sizes  vbufsize,
const types::tape_buffer_sizes  tbufsize 
)
static

Enable the recording mode for a given tape, using the run-time chosen tape buffer sizes.

Parameters
[in]tape_indexThe index of the tape to be written.
[in]keep_independent_valuesDetermines whether the numerical values of all independent variables are recorded in the tape buffer.
[in]obufsizeADOL-C operations buffer size
[in]lbufsizeADOL-C locations buffer size
[in]vbufsizeADOL-C value buffer size
[in]tbufsizeADOL-C Taylor buffer size
template<typename ADNumberType , typename ScalarType , typename T = void>
static void Differentiation::AD::TapedDrivers< ADNumberType, ScalarType, T >::disable_taping ( const types::tape_index  active_tape_index,
const bool  write_tapes_to_file 
)
static

Disable the recording mode for a given tape.

Parameters
[in]active_tape_indexThe index of the (currently active) tape to be finalized and potentially written to file.
[in]write_tapes_to_fileA flag that specified whether the tape should be written to file or kept in memory.
template<typename ADNumberType , typename ScalarType , typename T = void>
static void Differentiation::AD::TapedDrivers< ADNumberType, ScalarType, T >::print_tape_stats ( std::ostream &  stream,
const types::tape_index  tape_index 
)
static

Prints the statistics regarding the usage of the tapes.

Parameters
[in]streamThe output stream to which the values are to be written.
[in]tape_indexThe index of the tape to get the statistics of.
template<typename ADNumberType , typename ScalarType , typename T = void>
static ScalarType Differentiation::AD::TapedDrivers< ADNumberType, ScalarType, T >::value ( const types::tape_index  active_tape_index,
const std::vector< ScalarType > &  independent_variables 
)
static

Computes the value of the scalar field.

Parameters
[in]active_tape_indexThe index of the tape on which the dependent function is recorded.
[in]independent_variablesThe scalar values of the independent variables whose sensitivities were tracked.
Returns
The scalar value of the function.
template<typename ADNumberType , typename ScalarType , typename T = void>
static void Differentiation::AD::TapedDrivers< ADNumberType, ScalarType, T >::gradient ( const types::tape_index  active_tape_index,
const std::vector< ScalarType > &  independent_variables,
Vector< ScalarType > &  gradient 
)
static

Computes the gradient of the scalar field with respect to all independent variables.

Parameters
[in]active_tape_indexThe index of the tape on which the dependent function is recorded.
[in]independent_variablesThe scalar values of the independent variables whose sensitivities were tracked.
[out]gradientThe scalar values of the dependent function's gradients. It is expected that this vector be of the correct size (with length n_independent_variables).
template<typename ADNumberType , typename ScalarType , typename T = void>
static void Differentiation::AD::TapedDrivers< ADNumberType, ScalarType, T >::hessian ( const types::tape_index  active_tape_index,
const std::vector< ScalarType > &  independent_variables,
FullMatrix< ScalarType > &  hessian 
)
static

Computes the Hessian of the scalar field with respect to all independent variables.

Parameters
[in]active_tape_indexThe index of the tape on which the dependent function is recorded.
[in]independent_variablesThe scalar values of the independent variables whose sensitivities were tracked.
[out]hessianThe scalar values of the dependent function's Hessian. It is expected that this matrix be of the correct size (with dimensions n_independent_variables \(\times\)n_independent_variables).
template<typename ADNumberType , typename ScalarType , typename T = void>
static void Differentiation::AD::TapedDrivers< ADNumberType, ScalarType, T >::values ( const types::tape_index  active_tape_index,
const unsigned int  n_dependent_variables,
const std::vector< ScalarType > &  independent_variables,
Vector< ScalarType > &  values 
)
static

Computes the values of the vector field.

Parameters
[in]active_tape_indexThe index of the tape on which the dependent function is recorded.
[in]n_dependent_variablesThe number of dependent variables.
[in]independent_variablesThe scalar values of the independent variables whose sensitivities were tracked.
[out]valuesThe scalar values of the dependent functions. It is expected that this vector be of the correct size (with length n_dependent_variables).
template<typename ADNumberType , typename ScalarType , typename T = void>
static void Differentiation::AD::TapedDrivers< ADNumberType, ScalarType, T >::jacobian ( const types::tape_index  active_tape_index,
const unsigned int  n_dependent_variables,
const std::vector< ScalarType > &  independent_variables,
FullMatrix< ScalarType > &  jacobian 
)
static

Computes the Jacobian of the vector field.

The Jacobian of a vector field is in essense the gradient of each dependent variable with respect to all independent variables. This operation is therefore analogous to the gradient() operation performed on a collection of scalar valued fields.

Parameters
[in]active_tape_indexThe index of the tape on which the dependent function is recorded.
[in]n_dependent_variablesThe number of dependent variables.
[in]independent_variablesThe scalar values of the independent variables whose sensitivities were tracked.
[out]jacobianThe scalar values of the dependent functions' Jacobian. It is expected that this matrix be of the correct size (with dimensions n_dependent_variables \(\times\)n_independent_variables).

The documentation for this struct was generated from the following file: