|
|
std::vector< bool > | activeDomain () |
| | Which inputs are affecting some outputs.
|
| |
|
std::vector< bool > | activeRange () |
| | Which outputs are affected by some inputs.
|
| |
|
template<class Functor , class ScalarVector > |
| | ADFun (Functor F, const ScalarVector &x_) |
| | Constructor of vector input / vector output function.
|
| |
| template<class Functor > |
| | ADFun (Functor F, Scalar x0_) |
| | Constructor of 1 scalar input / 1 scalar output function. More...
|
| |
| template<class Functor > |
| | ADFun (Functor F, Scalar x0_, Scalar x1_) |
| | Constructor of 2 scalar input / 1 scalar output function. More...
|
| |
|
ADFun | atomic () |
| | Turn this operation sequence into an atomic operator.
|
| |
| ADFun | compose (ADFun other) |
| | Construct function composition. More...
|
| |
| Decomp2< ADFun > | decompose (std::vector< Index > nodes) |
| | Decompose this computational graph. More...
|
| |
| Decomp2< ADFun > | decompose (const char *name) |
| | Decompose this computational graph by operator name. More...
|
| |
| void | decompose_refs () |
| | Optional optimization step before resolving references. More...
|
| |
|
size_t | DomainInner () const |
| | Number of inner parameters.
|
| |
|
size_t | DomainOuter () const |
| | Number of outer parameters.
|
| |
|
std::vector< bool > | DomainOuterMask () |
| | Helper: Boolean mask of outer parameters.
|
| |
|
std::vector< Scalar > | DomainVec () |
| | Get most recent input parameter vector from the tape.
|
| |
|
template<class InplaceVector > |
| Position | DomainVecSet (const InplaceVector &x) |
| | Set the input parameter vector on the tape.
|
| |
|
void | eliminate () |
| | Dead operator elimination.
|
| |
|
Position | find_pos (Index inv) |
| | Helper to find the tape position of an independent variable.
|
| |
|
void | force_update () |
| | Next forward pass must traverse the full graph.
|
| |
|
template<class Vector > |
| Vector | forward (const Vector &x) |
| | Forward sweep any vector class.
|
| |
|
std::vector< bool > | get_keep_var (std::vector< bool > keep_x, std::vector< bool > keep_y) |
| | Get necessary variables to keep for given input/output selection.
|
| |
| void | inactivate (std::vector< Index > nodes) |
| | Substitute selected operators by void operators. More...
|
| |
|
bool | inner_outer_in_use () |
| | Helper: Does tape have inner/outer information ?
|
| |
| bool | inv_index_is_consecutive () |
| | Are the independent variable indices consecutive? More...
|
| |
| ADFun | JacFun (std::vector< bool > keep_x=std::vector< bool >(0), std::vector< bool > keep_y=std::vector< bool >(0)) |
| | Get Jacobian function object. More...
|
| |
| std::vector< Scalar > | Jacobian (const std::vector< Scalar > &x) |
| | Evaluate the Jacobian matrix. More...
|
| |
| std::vector< Scalar > | Jacobian (const std::vector< Scalar > &x, std::vector< bool > keep_x, std::vector< bool > keep_y) |
| | Evaluate the Jacobian matrix subset More...
|
| |
| std::vector< Scalar > | Jacobian (const std::vector< Scalar > &x, const std::vector< Scalar > &w) |
| | Evaluate the Jacobian matrix multiplied by a vector. More...
|
| |
| ADFun | marginal_gk (const std::vector< Index > &random, gk_config cfg=gk_config()) |
| | Integrate as many univariate variables as possible. More...
|
| |
|
ADFun | marginal_sr (const std::vector< Index > &random, std::vector< sr_grid > grid, const std::vector< Index > &random2grid, bool perm=true) |
| | Integrate using sequential reduction.
|
| |
|
ADFun | marginal_sr (const std::vector< Index > &random, sr_grid grid=sr_grid()) |
| | Integrate using sequential reduction.
|
| |
|
std::vector< Scalar > | operator() (const std::vector< Scalar > &x) |
| | Evaluate function for scalar vector input.
|
| |
| std::vector< ad > | operator() (const std::vector< ad > &x_) const |
| | Evaluate function for ad vector input. More...
|
| |
| ad | operator() (ad x0) |
| | Evaluate function scalar version. More...
|
| |
| ad | operator() (ad x0, ad x1) |
| | Evaluate function scalar version. More...
|
| |
| void | optimize () |
| | Tape optimizer. More...
|
| |
|
std::vector< ADFun > | parallel_accumulate (size_t num_threads) |
| | Parallel split this operation sequence Split function f:R^n->R by its accumulation tree. Then parallelize and accumulate each parallel component. Return a list of functions f[i]:R^n->R such that f=sum_i f[i].
|
| |
| ADFun | parallelize (size_t num_threads) |
| | Parallelize this operation sequence. More...
|
| |
|
void | print (print_config cfg=print_config()) |
| | Print AD workspace.
|
| |
|
IndirectAccessor< Scalar > | RangeVec () |
| | Get most recent result vector from the tape.
|
| |
| void | reorder (std::vector< Index > last) |
| | Reorder computational graph to allow quick updates of selected inputs. More...
|
| |
| void | replay () |
| | Replay this operation sequence to a new sequence. More...
|
| |
| std::vector< ad_aug > | resolve_refs () |
| | Resolve references of this ADFun object. More...
|
| |
|
template<class Vector > |
| Vector | reverse (const Vector &w) |
| | Reverse sweep any vector class.
|
| |
|
void | set_inner_outer (ADFun &ans, const std::vector< bool > &outer_mask) |
| | Helper: Pass on inner/outer information to a new tape. Some parameters are marked as 'outer parameters'. All other prameters are 'inner'. This function passes on inner/outer information to a new tape assuming that the new tape preserves parameter ordering but may increase or reduce the parameter list.
|
| |
| void | set_inv_positions () |
| | Cache tape positions of independent variables. More...
|
| |
|
void | set_tail (const std::vector< Index > &random) |
| | Set start position needed to get selected independent variable derivatives.
|
| |
| Sparse< ADFun > | SpJacFun (std::vector< bool > keep_x=std::vector< bool >(0), std::vector< bool > keep_y=std::vector< bool >(0), SpJacFun_config config=SpJacFun_config()) |
| | Sparse Jacobian function generator. More...
|
| |
| void | SwapInner () |
| | Temporarily regard this object as function of inner parameters. More...
|
| |
| void | SwapOuter () |
| | Temporarily regard this object as function of outer parameters. More...
|
| |
|
void | unset_tail () |
| | Inactivate tail sweep to get derivatives wrt all independent variables.
|
| |
| ADFun | WgtJacFun (std::vector< bool > keep_x=std::vector< bool >(0), std::vector< bool > keep_y=std::vector< bool >(0)) |
| | Get weighted Jacobian function object. More...
|
| |
template<class ad = ad_aug>
struct TMBad::ADFun< ad >
Automatic differentiation function object.
The ADFun object represents a mapping \(F:R^n \rightarrow R^m \: (x \rightarrow F(x))\)
API overview
Function object transformations
| Name | Description |
| JacFun() | Get Jacobian function object |
| SpJacFun() | Get Sparse Jacobian function object |
| WgtJacFun() | Get weighted Jacobian function object |
Function object evaluators
Argument conventions
- Jacobian matrix is stored as a vector with input dimension fastest running and output dimension slowest running.
- Equivalently the Jacobian matrix J is stored row major (OR equivalently t(J) stored column major)
keep_x, keep_y: Selects inputs and outputs to corresponding to J[keep_y, keep_x].
Definition at line 117 of file TMBad.hpp.