CppADCodeGen  HEAD
A C++ Algorithmic Differentiation Package with Source Code Generation
CppAD::cg::DaeStructuralIndexReduction< Base > Class Template Referenceabstract
Inheritance diagram for CppAD::cg::DaeStructuralIndexReduction< Base >:
Inheritance graph
Collaboration diagram for CppAD::cg::DaeStructuralIndexReduction< Base >:
Collaboration graph

Public Member Functions

 DaeStructuralIndexReduction (ADFun< CG< Base >> &fun, const std::vector< DaeVarInfo > &varInfo, const std::vector< std::string > &eqName)
 
BipartiteGraph< Base > & getGraph ()
 
const BipartiteGraph< Base > & getGraph () const
 
void setPreserveNames (bool p)
 
bool isPreserveNames () const
 
size_t getStructuralIndex () const
 
ADFun< CG< Base > > & getOriginalModel () const
 
virtual std::unique_ptr< ADFun< CG< Base > > > reduceIndex (std::vector< DaeVarInfo > &newVarInfo, std::vector< DaeEquationInfo > &equationInfo)=0
 
std::ostream & log () const
 
void setLog (std::ostream &out)
 
void setVerbosity (Verbosity verbosity)
 
Verbosity getVerbosity () const
 

Protected Types

using CGBase = CppAD::cg::CG< Base >
 
using ADCG = CppAD::AD< CGBase >
 

Protected Attributes

BipartiteGraph< Base > graph_
 
ADFun< CG< Base > > *const fun_
 
Verbosity verbosity_
 
std::ostream * log_
 

Detailed Description

template<class Base>
class CppAD::cg::DaeStructuralIndexReduction< Base >

Base class for algorithms that perform automatic structural index reduction of implicit DAEs using graphs.

Definition at line 29 of file dae_structural_index_reduction.hpp.

Constructor & Destructor Documentation

◆ DaeStructuralIndexReduction()

template<class Base>
CppAD::cg::DaeStructuralIndexReduction< Base >::DaeStructuralIndexReduction ( ADFun< CG< Base >> &  fun,
const std::vector< DaeVarInfo > &  varInfo,
const std::vector< std::string > &  eqName 
)
inline

Creates a new algorithm for structural index reduction of DAE systems.

Parameters
funThe original model (potentially high index)
varInfoThe DAE system variable information (in the same order as in the tape)
eqNameEquation names (it can be an empty vector)

Definition at line 46 of file dae_structural_index_reduction.hpp.

Member Function Documentation

◆ getOriginalModel()

template<class Base >
ADFun<CG<Base> >& CppAD::cg::DaeIndexReduction< Base >::getOriginalModel ( ) const
inlineinherited

Provides the original model with a representation of an implicit DAE (potentially high index).

Definition at line 55 of file dae_index_reduction.hpp.

◆ getStructuralIndex()

template<class Base>
size_t CppAD::cg::DaeStructuralIndexReduction< Base >::getStructuralIndex ( ) const
inline

Provides the structural index which is typically a good approximation of the differentiation index. It can only be called after reduceIndex().

Returns
the DAE structural index.
Exceptions
CGException

Definition at line 90 of file dae_structural_index_reduction.hpp.

◆ isPreserveNames()

template<class Base>
bool CppAD::cg::DaeStructuralIndexReduction< Base >::isPreserveNames ( ) const
inline

Whether or not original names saved by using CppAD::PrintFor(0, "", val, name) should be kept by also adding PrintFor operations in the reduced model.

Definition at line 78 of file dae_structural_index_reduction.hpp.

◆ reduceIndex()

template<class Base >
virtual std::unique_ptr<ADFun<CG<Base> > > CppAD::cg::DaeIndexReduction< Base >::reduceIndex ( std::vector< DaeVarInfo > &  newVarInfo,
std::vector< DaeEquationInfo > &  equationInfo 
)
pure virtualinherited

Performs the DAE index reduction and creates a new reduced index model.

Parameters
newVarInfoVariable related information of the reduced index model
equationInfoEquation related information of the reduced index model
Returns
the reduced index model (null if there was no need for index reduction)

Implemented in CppAD::cg::DummyDerivatives< Base >, CppAD::cg::SoaresSecchi< Base >, and CppAD::cg::Pantelides< Base >.

Referenced by CppAD::cg::DaeIndexReduction< Base >::getOriginalModel(), and CppAD::cg::DummyDerivatives< Base >::reduceIndex().

◆ setPreserveNames()

template<class Base>
void CppAD::cg::DaeStructuralIndexReduction< Base >::setPreserveNames ( bool  p)
inline

Defines whether or not original names saved by using CppAD::PrintFor(0, "", val, name) should be kept by also adding PrintFor operations in the reduced model.

Definition at line 69 of file dae_structural_index_reduction.hpp.

Member Data Documentation

◆ fun_

template<class Base >
ADFun<CG<Base> >* const CppAD::cg::DaeIndexReduction< Base >::fun_
protectedinherited

The original model representing an implicit DAE system

Definition at line 36 of file dae_index_reduction.hpp.

Referenced by CppAD::cg::DaeIndexReduction< Base >::getOriginalModel().


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