MicroModelicaCCompiler  4.5.3
MicroModelica::IR::Index Class Reference

#include <index.hpp>

Collaboration diagram for MicroModelica::IR::Index:

Public Member Functions

 Index ()
 
 Index (Expression exp)
 
 ~Index ()=default
 
void setMap (IR::Expression exp)
 
bool hasMap () const
 
bool operator== (const Index &other) const
 
bool isConstant () const
 
int dimension ()
 
void setExp (Expression exp)
 
std::string print () const
 
std::string identifier (bool recursive_use=false) const
 
Range range () const
 
Index revert () const
 
Index replace (bool range_idx=false) const
 
Index replace (Option< Range > range, bool range_idx=false) const
 
std::string usageExp () const
 
std::string modelicaExp () const
 
Util::Variable variable () const
 
bool hasVariable (int dim)
 
std::string variable (int dim)
 
bool hasFactor (int dim)
 
int factor (int dim)
 
bool hasConstant (int dim)
 
int constant (int dim)
 
Expression expression () const
 
bool isEmpty () const
 
std::vector< std::string > variables ()
 
std::vector< int > initValues (Option< Range > range)
 

Protected Member Functions

void parseIndexes ()
 

Private Attributes

map< int, IndexDefinition_indexes
 
Expression _exp
 

Friends

std::ostream & operator<< (std::ostream &out, const Index &i)
 

Detailed Description

Definition at line 92 of file index.hpp.

Constructor & Destructor Documentation

◆ Index() [1/2]

MicroModelica::IR::Index::Index ( )
inline

Definition at line 94 of file index.hpp.

Referenced by variable().

◆ Index() [2/2]

MicroModelica::IR::Index::Index ( Expression  exp)

Definition at line 72 of file index.cpp.

◆ ~Index()

MicroModelica::IR::Index::~Index ( )
default

Member Function Documentation

◆ constant()

int MicroModelica::IR::Index::constant ( int  dim)

Definition at line 236 of file index.cpp.

References MicroModelica::IR::RangeDefinition::_begin, and MicroModelica::IR::RangeDefinition::begin().

Here is the call graph for this function:

◆ dimension()

int MicroModelica::IR::Index::dimension ( )

Definition at line 124 of file index.cpp.

Referenced by MicroModelica::IR::VariableUsage::VariableUsage().

◆ expression()

Expression MicroModelica::IR::Index::expression ( ) const

Definition at line 126 of file index.cpp.

◆ factor()

int MicroModelica::IR::Index::factor ( int  dim)

Definition at line 232 of file index.cpp.

◆ hasConstant()

bool MicroModelica::IR::Index::hasConstant ( int  dim)

Definition at line 234 of file index.cpp.

◆ hasFactor()

bool MicroModelica::IR::Index::hasFactor ( int  dim)

Definition at line 230 of file index.cpp.

◆ hasMap()

bool MicroModelica::IR::Index::hasMap ( ) const

Definition at line 130 of file index.cpp.

◆ hasVariable()

bool MicroModelica::IR::Index::hasVariable ( int  dim)

Definition at line 226 of file index.cpp.

Referenced by MicroModelica::IR::VariableUsage::lhs().

◆ identifier()

string MicroModelica::IR::Index::identifier ( bool  recursive_use = false) const

Definition at line 149 of file index.cpp.

References variable().

Referenced by MicroModelica::IR::QSSModelDepsGenerator::postProcess().

Here is the call graph for this function:

◆ initValues()

vector< int > MicroModelica::IR::Index::initValues ( Option< Range range)

Definition at line 94 of file index.cpp.

◆ isConstant()

bool MicroModelica::IR::Index::isConstant ( ) const

◆ isEmpty()

bool MicroModelica::IR::Index::isEmpty ( ) const

Definition at line 238 of file index.cpp.

References MicroModelica::IR::RangeDefinition::_end, and MicroModelica::IR::RangeDefinition::end().

Here is the call graph for this function:

◆ modelicaExp()

string MicroModelica::IR::Index::modelicaExp ( ) const

Definition at line 190 of file index.cpp.

◆ operator==()

bool MicroModelica::IR::Index::operator== ( const Index other) const

Definition at line 132 of file index.cpp.

◆ parseIndexes()

void MicroModelica::IR::Index::parseIndexes ( )
protected

Definition at line 74 of file index.cpp.

◆ print()

string MicroModelica::IR::Index::print ( ) const

Definition at line 201 of file index.cpp.

Referenced by MicroModelica::IR::JacGenerator::guard().

◆ range()

Range MicroModelica::IR::Index::range ( ) const

Definition at line 167 of file index.cpp.

Referenced by variable().

◆ replace() [1/2]

Index MicroModelica::IR::Index::replace ( bool  range_idx = false) const

Definition at line 175 of file index.cpp.

Referenced by MicroModelica::IR::DependencyPrinter::endParallelMap(), and variable().

◆ replace() [2/2]

Index MicroModelica::IR::Index::replace ( Option< Range range,
bool  range_idx = false 
) const

Definition at line 177 of file index.cpp.

◆ revert()

Index MicroModelica::IR::Index::revert ( ) const

Definition at line 169 of file index.cpp.

Referenced by MicroModelica::IR::DependencyPrinter::endParallelMap().

◆ setExp()

void MicroModelica::IR::Index::setExp ( Expression  exp)

Definition at line 143 of file index.cpp.

References _exp, and MicroModelica::IR::Expression::reference().

Here is the call graph for this function:

◆ setMap()

void MicroModelica::IR::Index::setMap ( IR::Expression  exp)

Definition at line 128 of file index.cpp.

◆ usageExp()

string MicroModelica::IR::Index::usageExp ( ) const

Definition at line 188 of file index.cpp.

◆ variable() [1/2]

Variable MicroModelica::IR::Index::variable ( ) const

Definition at line 160 of file index.cpp.

References _exp, MicroModelica::IR::Expression::expression(), Index(), range(), and replace().

Referenced by identifier().

Here is the call graph for this function:

◆ variable() [2/2]

string MicroModelica::IR::Index::variable ( int  dim)

Definition at line 228 of file index.cpp.

◆ variables()

vector< string > MicroModelica::IR::Index::variables ( )

Definition at line 211 of file index.cpp.

References _indexes.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const Index i 
)
friend

Definition at line 240 of file index.cpp.

Member Data Documentation

◆ _exp

Expression MicroModelica::IR::Index::_exp
private

Definition at line 129 of file index.hpp.

Referenced by isConstant(), setExp(), and variable().

◆ _indexes

map<int, IndexDefinition> MicroModelica::IR::Index::_indexes
private

Definition at line 128 of file index.hpp.

Referenced by variables().


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