ADOL-C: Automatic Differentiation in C/C++ 2.7.3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
pdouble Class Reference

Mutable passive parameter stored on a recorded tape. More...

#include <adtb_types.h>

Public Member Functions

 ~pdouble ()=default
 Default destructor.
 
 pdouble ()=delete
 Deleted default constructor.
 
 pdouble (const pdouble &)=delete
 Deleted copy constructor and assignment.
 
pdouble & operator= (const pdouble &)=delete
 
 pdouble (pdouble &&other) noexcept
 Move constructor.
 
pdouble & operator= (pdouble &&other) noexcept
 Move assignment.
 
 pdouble (const double pval)
 Allocate a parameter location on the current tape and set its value.
 
 operator adouble () const
 Copy the parameter into a new active-value location.
 
size_t loc () const
 Retrieves the location on the tape of the pdouble.
 
double value () const
 Retrieves the current value stored at the tape location.
 
void value (const double pval)
 Updates the value stored at the tape location.
 

Detailed Description

Mutable passive parameter stored on a recorded tape.

A pdouble participates in taped expressions but is not an independent variable, so derivatives are never taken with respect to it. Unlike a literal double, its recorded value can be replaced with ValueTape::setParamVec() and the same operation tape can then be evaluated again without retaping.

Updating parameters invalidates saved Taylor coefficients. Therefore, any subsequent reverse sweep must be preceded by a forward sweep with keep >= 1.

Constructor & Destructor Documentation

◆ ~pdouble()

pdouble::~pdouble ( )
default

Default destructor.

◆ pdouble() [1/4]

pdouble::pdouble ( )
delete

Deleted default constructor.

◆ pdouble() [2/4]

pdouble::pdouble ( const pdouble &  )
delete

Deleted copy constructor and assignment.

◆ pdouble() [3/4]

pdouble::pdouble ( pdouble &&  other)
inlinenoexcept

Move constructor.

Transfers the location from the input pdouble.

Parameters
otherThe pdouble to transfer.

◆ pdouble() [4/4]

pdouble::pdouble ( const double  pval)
explicit

Allocate a parameter location on the current tape and set its value.

Parameters
pvalThe initial value for the pdouble on the parameter tape.

Member Function Documentation

◆ loc()

size_t pdouble::loc ( ) const
inline

Retrieves the location on the tape of the pdouble.

Returns
The location on the tape.

◆ operator adouble()

pdouble::operator adouble ( ) const
explicit

Copy the parameter into a new active-value location.

Record the parameter assignment while tracing.

Returns
An adouble with associated value of the pdouble on the tape.

◆ operator=() [1/2]

pdouble & pdouble::operator= ( const pdouble &  )
delete

◆ operator=() [2/2]

pdouble & pdouble::operator= ( pdouble &&  other)
inlinenoexcept

Move assignment.

Transfers the location from the input pdouble.

Parameters
otherThe pdouble to transfer.
Returns
Reference to *this.

◆ value() [1/2]

double pdouble::value ( ) const
inline

Retrieves the current value stored at the tape location.

Returns
The value of the pdouble.

◆ value() [2/2]

void pdouble::value ( const double  pval)
inline

Updates the value stored at the tape location.

Parameters
pvalThe new value to assign.

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