FLOPC++
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
flopc::MP_index Class Reference

Representation of an index.This is one of the main public interface classes. It is used to iterate through, or index into an MP_domain. It is also used to share the 'current' index offsets between expressions which share an index. More...

#include <MP_index.hpp>

Inheritance diagram for flopc::MP_index:
flopc::MP_index_base flopc::MP_set_base flopc::MP_set flopc::MP_stage flopc::MP_subset< nbr >

Public Member Functions

 MP_index ()
 Default constructor. More...
 
int evaluate () const
 

Static Public Member Functions

static MP_indexgetEmpty ()
 returns a reference to the distinct "empty" index. More...
 
static MP_indexAny ()
 returns a reference to the distinct "wildcard" index. More...
 

Private Member Functions

bool isInstantiated () const
 
void assign (int i)
 
void unInstantiate ()
 
void instantiate ()
 
MP_indexgetIndex () const
 
virtual MP_domain getDomain (MP_set *s) const
 Getter for domain over which this index is applied. More...
 

Private Attributes

int index
 
bool instantiated
 

Static Private Attributes

static MP_indexEmpty = *new MP_index()
 
static MP_indexAny_index = *new MP_index()
 

Friends

class MP_domain_set
 
template<int nbr>
class MP_domain_subset
 

Additional Inherited Members

- Protected Member Functions inherited from flopc::MP_index_base
 MP_index_base ()
 
virtual ~MP_index_base ()
 

Detailed Description

Representation of an index.

This is one of the main public interface classes. It is used to iterate through, or index into an MP_domain. It is also used to share the 'current' index offsets between expressions which share an index.

Definition at line 53 of file MP_index.hpp.

Constructor & Destructor Documentation

◆ MP_index()

flopc::MP_index::MP_index ( )
inline

Default constructor.

Definition at line 58 of file MP_index.hpp.

Member Function Documentation

◆ Any()

MP_index & flopc::MP_index::Any ( )
static

returns a reference to the distinct "wildcard" index.

Definition at line 23 of file MP_index.cpp.

References Any_index.

◆ assign()

void flopc::MP_index::assign ( int  i)
inlineprivate

Setter for the index.

Todo:
should this assert "instatiated"?

Definition at line 75 of file MP_index.hpp.

◆ evaluate()

int flopc::MP_index::evaluate ( ) const
inlinevirtual

Implements flopc::MP_index_base.

Definition at line 59 of file MP_index.hpp.

Referenced by flopc::VariableRef::level(), and flopc::MP_variable::operator()().

◆ getDomain()

MP_domain MP_index::getDomain ( MP_set s) const
privatevirtual

Getter for domain over which this index is applied.

Implements flopc::MP_index_base.

Definition at line 89 of file MP_index.cpp.

References MP_domain_set.

◆ getEmpty()

MP_index & flopc::MP_index::getEmpty ( )
static

returns a reference to the distinct "empty" index.

Definition at line 20 of file MP_index.cpp.

References Empty.

Referenced by flopc::MP_set::last(), and flopc::MP_domain_subset< nbr >::operator()().

◆ getIndex()

MP_index* flopc::MP_index::getIndex ( ) const
inlineprivatevirtual

◆ instantiate()

void flopc::MP_index::instantiate ( )
inlineprivate

setter for instatiated.

Definition at line 85 of file MP_index.hpp.

◆ isInstantiated()

bool flopc::MP_index::isInstantiated ( ) const
inlineprivate

interrogate state of instatiation of data.

Definition at line 69 of file MP_index.hpp.

◆ unInstantiate()

void flopc::MP_index::unInstantiate ( )
inlineprivate

unsetter for instatiated.

Definition at line 80 of file MP_index.hpp.

Friends And Related Function Documentation

◆ MP_domain_set

friend class MP_domain_set
friend

◆ MP_domain_subset

template<int nbr>
friend class MP_domain_subset
friend

Definition at line 55 of file MP_index.hpp.

Member Data Documentation

◆ Any_index

MP_index & flopc::MP_index::Any_index = *new MP_index()
staticprivate

Definition at line 98 of file MP_index.hpp.

Referenced by Any().

◆ Empty

MP_index & flopc::MP_index::Empty = *new MP_index()
staticprivate

Definition at line 97 of file MP_index.hpp.

Referenced by getEmpty(), and flopc::MP_index_exp::getEmpty().

◆ index

int flopc::MP_index::index
private

Definition at line 99 of file MP_index.hpp.

◆ instantiated

bool flopc::MP_index::instantiated
private

Definition at line 100 of file MP_index.hpp.


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