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

Public Member Functions

 SoaresSecchi (ADFun< CG< Base > > &fun, const std::vector< DaeVarInfo > &varInfo, const std::vector< std::string > &eqName, const std::vector< Base > &x)
 
 SoaresSecchi (const SoaresSecchi &p)=delete
 
SoaresSecchioperator= (const SoaresSecchi &p)=delete
 
AugmentPath< Base > & getAugmentPath () const
 
void setAugmentPath (AugmentPath< Base > &a) const
 
void setPreserveNames (bool p)
 
bool isPreserveNames () const
 
std::unique_ptr< ADFun< CG< Base > > > reduceIndex (std::vector< DaeVarInfo > &newVarInfo, std::vector< DaeEquationInfo > &equationInfo) override
 
size_t getStructuralIndex () const
 
BipartiteGraph< Base > & getGraph ()
 
const BipartiteGraph< Base > & getGraph () const
 
ADFun< CG< Base > > & getOriginalModel () const
 
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 Member Functions

void detectSubset2Dif ()
 

Protected Attributes

std::vector< Base > x_
 
std::set< Enode< Base > * > lastAddEq_
 
bool reduced_
 
AugmentPathDepthLookahead< Base > defaultAugmentPath_
 
AugmentPathDepthLookaheadA< Base > defaultAugmentPathA_
 
AugmentPath< Base > * augmentPath_
 
AugmentPath< Base > * augmentPathA_
 
BipartiteGraph< Base > graph_
 
ADFun< CG< Base > > *const fun_
 
Verbosity verbosity_
 
std::ostream * log_
 

Detailed Description

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

Soares Secchi method for DAE structural index reduction

Definition at line 30 of file soares_secchi.hpp.

Constructor & Destructor Documentation

◆ SoaresSecchi()

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

Creates the DAE index reduction algorithm that implements the Soares Secchi method.

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)
xtypical variable values (used to avoid NaNs in CppAD checks)

Definition at line 63 of file soares_secchi.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::SoaresSecchi< Base >::getStructuralIndex ( ) const
inline

Provides the differentiation index. It can only be called after reduceIndex().

Returns
the DAE differentiation index.
Exceptions
CGException

Definition at line 157 of file soares_secchi.hpp.

◆ isPreserveNames()

template<class Base >
bool CppAD::cg::SoaresSecchi< 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 104 of file soares_secchi.hpp.

◆ reduceIndex()

template<class Base >
std::unique_ptr<ADFun<CG<Base> > > CppAD::cg::SoaresSecchi< Base >::reduceIndex ( std::vector< DaeVarInfo > &  newVarInfo,
std::vector< DaeEquationInfo > &  equationInfo 
)
inlineoverridevirtual

Performs the DAE differentiation index reductions

Parameters
newVarInfoVariable related information of the reduced index model
equationInfoEquation related information of the reduced index model
Returns
the reduced index model (must be deleted by user)
Exceptions
CGExceptionon failure

Implements CppAD::cg::DaeIndexReduction< Base >.

Definition at line 118 of file soares_secchi.hpp.

◆ setPreserveNames()

template<class Base >
void CppAD::cg::SoaresSecchi< 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 95 of file soares_secchi.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().

◆ lastAddEq_

template<class Base >
std::set<Enode<Base>*> CppAD::cg::SoaresSecchi< Base >::lastAddEq_
protected

the last equations added to graph (equations used to create the ODE or DAE with index 1)

Definition at line 43 of file soares_secchi.hpp.


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