CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
Loading...
Searching...
No Matches
CppAD::cg::Pantelides< Base > Class Template Reference

#include <pantelides.hpp>

Inheritance diagram for CppAD::cg::Pantelides< Base >:
Inheritance graph
Collaboration diagram for CppAD::cg::Pantelides< Base >:
Collaboration graph

Public Member Functions

 Pantelides (ADFun< CG< Base > > &fun, const std::vector< DaeVarInfo > &varInfo, const std::vector< std::string > &eqName, const std::vector< Base > &x)
 
 Pantelides (const Pantelides &p)=delete
 
Pantelidesoperator= (const Pantelides &p)=delete
 
AugmentPath< Base > & getAugmentPath () const
 
void setAugmentPath (AugmentPath< Base > &a) const
 
std::unique_ptr< ADFun< CG< Base > > > reduceIndex (std::vector< DaeVarInfo > &newVarInfo, std::vector< DaeEquationInfo > &equationInfo) override
 
BipartiteGraph< Base > & getGraph ()
 
const BipartiteGraph< Base > & getGraph () const
 
void setPreserveNames (bool p)
 
bool isPreserveNames () const
 
size_t getStructuralIndex () 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_
 
bool reduced_
 
AugmentPathDepthLookahead< Base > defaultAugmentPath_
 
AugmentPath< Base > * augmentPath_
 
BipartiteGraph< Base > graph_
 
ADFun< CG< Base > > *const fun_
 
Verbosity verbosity_
 
std::ostream * log_
 

Detailed Description

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

Pantelides DAE index reduction algorithm

Definition at line 29 of file pantelides.hpp.

Member Typedef Documentation

◆ ADCG

template<class Base >
using CppAD::cg::Pantelides< Base >::ADCG = CppAD::AD<CGBase>
protected

Definition at line 32 of file pantelides.hpp.

◆ CGBase

template<class Base >
using CppAD::cg::Pantelides< Base >::CGBase = CppAD::cg::CG<Base>
protected

Definition at line 31 of file pantelides.hpp.

Constructor & Destructor Documentation

◆ Pantelides()

template<class Base >
CppAD::cg::Pantelides< Base >::Pantelides ( 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 Pantelides 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 54 of file pantelides.hpp.

Member Function Documentation

◆ detectSubset2Dif()

template<class Base >
void CppAD::cg::Pantelides< Base >::detectSubset2Dif ( )
inlineprotected

delete all V-nodes with A!=0 and their incident edges from the graph

Definition at line 110 of file pantelides.hpp.

Referenced by CppAD::cg::Pantelides< Base >::reduceIndex().

◆ getAugmentPath()

template<class Base >
AugmentPath< Base > & CppAD::cg::Pantelides< Base >::getAugmentPath ( ) const
inline

Definition at line 71 of file pantelides.hpp.

◆ getGraph() [1/2]

template<class Base >
BipartiteGraph< Base > & CppAD::cg::DaeStructuralIndexReduction< Base >::getGraph ( )
inlineinherited

Definition at line 56 of file dae_structural_index_reduction.hpp.

◆ getGraph() [2/2]

template<class Base >
const BipartiteGraph< Base > & CppAD::cg::DaeStructuralIndexReduction< Base >::getGraph ( ) const
inlineinherited

Definition at line 60 of file dae_structural_index_reduction.hpp.

◆ 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
inlineinherited

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.

◆ getVerbosity()

Verbosity CppAD::cg::SimpleLogger::getVerbosity ( ) const
inlineinherited

Definition at line 55 of file simple_logger.hpp.

◆ isPreserveNames()

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

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.

◆ log()

std::ostream & CppAD::cg::SimpleLogger::log ( ) const
inlineinherited

Definition at line 43 of file simple_logger.hpp.

◆ reduceIndex()

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

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)

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

Definition at line 79 of file pantelides.hpp.

◆ setAugmentPath()

template<class Base >
void CppAD::cg::Pantelides< Base >::setAugmentPath ( AugmentPath< Base > &  a) const
inline

Definition at line 75 of file pantelides.hpp.

◆ setLog()

void CppAD::cg::SimpleLogger::setLog ( std::ostream &  out)
inlineinherited

Definition at line 47 of file simple_logger.hpp.

◆ setPreserveNames()

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

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.

◆ setVerbosity()

void CppAD::cg::SimpleLogger::setVerbosity ( Verbosity  verbosity)
inlineinherited

Definition at line 51 of file simple_logger.hpp.

Member Data Documentation

◆ augmentPath_

template<class Base >
AugmentPath<Base>* CppAD::cg::Pantelides< Base >::augmentPath_
protected

Definition at line 41 of file pantelides.hpp.

◆ defaultAugmentPath_

template<class Base >
AugmentPathDepthLookahead<Base> CppAD::cg::Pantelides< Base >::defaultAugmentPath_
protected

Definition at line 40 of file pantelides.hpp.

◆ 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().

◆ graph_

template<class Base >
BipartiteGraph<Base> CppAD::cg::DaeStructuralIndexReduction< Base >::graph_
protectedinherited

Definition at line 35 of file dae_structural_index_reduction.hpp.

◆ log_

std::ostream* CppAD::cg::SimpleLogger::log_
protectedinherited

Definition at line 29 of file simple_logger.hpp.

◆ reduced_

template<class Base >
bool CppAD::cg::Pantelides< Base >::reduced_
protected

Definition at line 39 of file pantelides.hpp.

◆ verbosity_

Verbosity CppAD::cg::SimpleLogger::verbosity_
protectedinherited

Definition at line 27 of file simple_logger.hpp.

◆ x_

template<class Base >
std::vector<Base> CppAD::cg::Pantelides< Base >::x_
protected

Definition at line 37 of file pantelides.hpp.


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