CppADCodeGen  HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
CppAD::cg::DaeVarInfo Class Reference
Collaboration diagram for CppAD::cg::DaeVarInfo:
Collaboration graph

Public Member Functions

 DaeVarInfo (const std::string &name="", size_t id=0)
 
 DaeVarInfo (int derivativeOf, const std::string &name="", size_t id=0)
 
size_t getId () const
 
void setId (size_t id)
 
int getAntiDerivative () const
 
void setAntiDerivative (int derivativeOf)
 
int getDerivative () const
 
void setDerivative (int derivative)
 
bool isFunctionOfIntegrated () const
 
void makeConstant ()
 
void makeIntegratedVariable ()
 
bool isIntegratedVariable () const
 
const std::string & getName () const
 
void setName (const std::string &name)
 
int getOriginalIndex () const
 
void setOriginalIndex (int originalIndex)
 
int getOriginalAntiDerivative () const
 
void setOriginalAntiDerivative (int originalAntiDerivative)
 
int getOrder () const
 
void setOrder (int order)
 
void printInfo (std::ostream &out=std::cout) const
 

Detailed Description

DAE variable information

Definition at line 24 of file dae_var_info.hpp.

Constructor & Destructor Documentation

◆ DaeVarInfo()

CppAD::cg::DaeVarInfo::DaeVarInfo ( const std::string &  name = "",
size_t  id = 0 
)
inline

Creates a new DAE variable

Parameters
nameA custom variable name (keep it empty to use an automatically generated name)
idA unique identifier for this variable (used internally)

Definition at line 81 of file dae_var_info.hpp.

Member Function Documentation

◆ getAntiDerivative()

int CppAD::cg::DaeVarInfo::getAntiDerivative ( ) const
inline

The index of the variable that the current variable is the derivative of. A negative value means that the current variable isn't a derivative.

Returns
The index of the variable for which this variable is the derivative of.

Definition at line 129 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::BipartiteGraph(), CppAD::cg::DummyDerivatives< Base >::generateSemiExplicitDAE(), and CppAD::cg::BipartiteGraph< Base >::printModel().

◆ getDerivative()

int CppAD::cg::DaeVarInfo::getDerivative ( ) const
inline

The index of the time derivative for this variable. A negative value means that there is none.

Returns
The index of the time derivative for this variable.

Definition at line 143 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::getStructuralIndex(), and CppAD::cg::BipartiteGraph< Base >::prepareTimeDependentVariables().

◆ getId()

size_t CppAD::cg::DaeVarInfo::getId ( ) const
inline

Provides a unique identifier for the variable.

Returns
a unique identifier for the variable.

Definition at line 113 of file dae_var_info.hpp.

◆ getName()

const std::string& CppAD::cg::DaeVarInfo::getName ( ) const
inline

Returns the custom variable name. If the string is empty an automatically generated name will be used.

Returns
the custom variable name

Definition at line 209 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::BipartiteGraph(), and CppAD::cg::DummyDerivatives< Base >::generateSemiExplicitDAE().

◆ getOrder()

int CppAD::cg::DaeVarInfo::getOrder ( ) const
inline

Provides the order of a time derivative. A negative value means that it is a constant. An order higher than zero does not mean that the variable should be treated as a time derivative, it could very well be a time derivative transformed into an algebraic variable by the algorithm.

Returns
The order of the time derivative

Definition at line 287 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::generateNewModel(), and CppAD::cg::BipartiteGraph< Base >::printModel().

◆ getOriginalAntiDerivative()

int CppAD::cg::DaeVarInfo::getOriginalAntiDerivative ( ) const
inline

Provides the original variable index for which this variable is/was the time derivative (with the order provided by order_). A negative value means that the current variable was never a time derivative. A non-negative value does not mean that this variable should be treated as a time derivative since it might have been transformed into an algebraic variable by the algorithm.

Returns
the index in the original model for which this variable is the time derivative

Definition at line 257 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::generateNewModel(), and CppAD::cg::BipartiteGraph< Base >::printModel().

◆ getOriginalIndex()

int CppAD::cg::DaeVarInfo::getOriginalIndex ( ) const
inline

Provides the variable index corresponding to the original model.

Returns
The corresponding variable index in the original model. A negative value means that this variable was created by the algorithm.

Definition at line 230 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::generateNewModel(), and CppAD::cg::BipartiteGraph< Base >::printModel().

◆ isFunctionOfIntegrated()

bool CppAD::cg::DaeVarInfo::isFunctionOfIntegrated ( ) const
inline

Determines whether or not this variable depends on the independent/integrated variables.

Returns
true if it is a parameter that does not depend on the integrated variables

Definition at line 164 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::getStructuralIndex().

◆ isIntegratedVariable()

bool CppAD::cg::DaeVarInfo::isIntegratedVariable ( ) const
inline

Determines whether or not this is an integrated variable, also known as the independent variable of the DAE system (typically time).

Returns
true if it is the integrated variable

Definition at line 199 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::getStructuralIndex().

◆ makeConstant()

void CppAD::cg::DaeVarInfo::makeConstant ( )
inline

Defines this variable as a parameter/constant that does not depend on the independent/integrated variables

Definition at line 172 of file dae_var_info.hpp.

◆ makeIntegratedVariable()

void CppAD::cg::DaeVarInfo::makeIntegratedVariable ( )
inline

Defines this variable as an integrated variable, also known as the independent variable of the DAE system (usually associated with time)

Definition at line 185 of file dae_var_info.hpp.

◆ setDerivative()

void CppAD::cg::DaeVarInfo::setDerivative ( int  derivative)
inline

Defines the index of the time derivative for this variable.

Parameters
derivativeThe index of the time derivative for this variable. A negative value means that there is none.

Definition at line 153 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::generateNewModel().

◆ setName()

void CppAD::cg::DaeVarInfo::setName ( const std::string &  name)
inline

Defines a custom variable name. If the string is empty an automatically generated name will be used.

Parameters
namethe custom variable name

Definition at line 219 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::BipartiteGraph().

◆ setOrder()

void CppAD::cg::DaeVarInfo::setOrder ( int  order)
inline

Defines the order of a time derivative. A negative value means that it is a constant. An order higher than zero does not mean that the variable should be treated as a time derivative, it could very well be a time derivative transformed into an algebraic variable by the algorithm.

Parameters
orderThe order of the time derivative

Definition at line 300 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::generateNewModel(), and CppAD::cg::BipartiteGraph< Base >::printModel().

◆ setOriginalAntiDerivative()

void CppAD::cg::DaeVarInfo::setOriginalAntiDerivative ( int  originalAntiDerivative)
inline

Defines the original variable index for which this variable is/was the time derivative (with the order provided by order_). A negative value means that the current variable was never a time derivative. A non-negative value does not mean that this variable should be treated as a time derivative since it might have been transformed into an algebraic variable by the algorithm.

Parameters
originalAntiDerivativethe index in the original model for which this variable is the time derivative

Definition at line 274 of file dae_var_info.hpp.

Referenced by CppAD::cg::BipartiteGraph< Base >::generateNewModel(), and CppAD::cg::BipartiteGraph< Base >::printModel().

◆ setOriginalIndex()

void CppAD::cg::DaeVarInfo::setOriginalIndex ( int  originalIndex)
inline

Defines the variable index in the original model.

Parameters
originalIndexThe corresponding variable index in the original model. A negative value means that this variable was created by the algorithm.

Definition at line 241 of file dae_var_info.hpp.


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