base2ad

View page source

Create an AD<Base> Function From a Base Function

Syntax

af = f . base2ad ()

See Also

mul_level

Base

This is the base type used to recorded the operation sequence in f and af ; i.e., the type AD < Base > was used to record the operation sequence.

f

This object has prototype

ADFun < Base > f

It does it’s derivative calculations using the type Base .

af

This object has prototype

ADFun< AD< Base > , Base > af

It has the same operation sequence as f , but it does it’s derivative calculations using the type AD < Base> . This enables one to record new functions that are defined using derivatives of the function f . Initially, there are no Taylor coefficients stored in af and af.size_order() is zero.

Example

The file base2ad.cpp contains an example and test of this operation.

VecAD

Forward mode on a base2ad function does not preserve VecAD operations (which might be expected); see the base2vec_ad.cpp example.