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

Representation of a set for indexing into some other construct.This is one of the main public interface classes. One uses this when constructing MP_domains, and subsets. It is frequent that one would directly construct sets of indices, then use expressions to subset or slice the data. More...

#include <MP_set.hpp>

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

Public Member Functions

 MP_set (int i=0)
 constructs a set with specific cardinality. More...
 
MP_domain operator() (const MP_index_exp &i) const
 Constructs an MP_domain on the stack given an index expression into the set. More...
 
 operator MP_domain () const
 constructs an MP_domain from the MP_set. More...
 
MP_domain such_that (const MP_boolean &b)
 constructs a domain by subsetting this MP_set where the MP_boolean evaluates to 'true' More...
 
void cyclic ()
 
virtual int size () const
 getter for the cardinality of this MP_set. More...
 
int last ()
 
- Public Member Functions inherited from flopc::MP_set_base
 MP_set_base ()
 
int check (int i) const
 
int checkStage (int i) const
 
virtual int isStage () const
 
- Public Member Functions inherited from flopc::MP_index
 MP_index ()
 Default constructor. More...
 
int evaluate () const
 
- Public Member Functions inherited from flopc::Named
string getName () const
 
void setName (const string &n)
 

Static Public Member Functions

static MP_setgetEmpty ()
 gets the distinct 'empty' MP_set. More...
 
- Static Public Member Functions inherited from flopc::MP_index
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 Attributes

int cardinality
 

Static Private Attributes

static MP_set Empty = *new MP_set(1)
 

Additional Inherited Members

- Public Attributes inherited from flopc::MP_set_base
bool Cyclic
 
- Protected Member Functions inherited from flopc::MP_index_base
 MP_index_base ()
 
virtual ~MP_index_base ()
 

Detailed Description

Representation of a set for indexing into some other construct.

This is one of the main public interface classes. One uses this when constructing MP_domains, and subsets. It is frequent that one would directly construct sets of indices, then use expressions to subset or slice the data.

Note
term: cardinality is the number of elements in the set.
term: dimension is the number of indices used to reference into it.
there is a distince 'empty' MP_set

Definition at line 79 of file MP_set.hpp.

Constructor & Destructor Documentation

◆ MP_set()

flopc::MP_set::MP_set ( int  i = 0)
inline

constructs a set with specific cardinality.

Definition at line 82 of file MP_set.hpp.

Member Function Documentation

◆ cyclic()

void flopc::MP_set::cyclic ( )
inline

setter for 'cyclic' property

Todo:
better explain the use of cyclic.

Definition at line 103 of file MP_set.hpp.

References flopc::MP_set_base::Cyclic.

◆ getEmpty()

MP_set & flopc::MP_set::getEmpty ( )
static

gets the distinct 'empty' MP_set.

Definition at line 17 of file MP_set.cpp.

References Empty.

Referenced by flopc::MP_domain::getEmpty(), flopc::MP_data::operator()(), and flopc::MP_variable::operator()().

◆ last()

int flopc::MP_set::last ( )
inline

Definition at line 110 of file MP_set.hpp.

References flopc::MP_index::getEmpty().

◆ operator MP_domain()

flopc::MP_set::operator MP_domain ( ) const
inlinevirtual

constructs an MP_domain from the MP_set.

Implements flopc::MP_set_base.

Definition at line 91 of file MP_set.hpp.

References flopc::MP_index::MP_domain_set.

◆ operator()()

MP_domain flopc::MP_set::operator() ( const MP_index_exp i) const
inlinevirtual

Constructs an MP_domain on the stack given an index expression into the set.

Todo:
is the internal use?

Implements flopc::MP_set_base.

Definition at line 87 of file MP_set.hpp.

◆ size()

virtual int flopc::MP_set::size ( ) const
inlinevirtual

getter for the cardinality of this MP_set.

Implements flopc::MP_set_base.

Reimplemented in flopc::MP_subset< nbr >.

Definition at line 107 of file MP_set.hpp.

◆ such_that()

MP_domain flopc::MP_set::such_that ( const MP_boolean b)
inline

constructs a domain by subsetting this MP_set where the MP_boolean evaluates to 'true'

Definition at line 97 of file MP_set.hpp.

References flopc::MP_index::MP_domain_set, and flopc::MP_domain::such_that().

Member Data Documentation

◆ cardinality

int flopc::MP_set::cardinality
private

Definition at line 117 of file MP_set.hpp.

◆ Empty

MP_set flopc::MP_set::Empty = *new MP_set(1)
staticprivate

Definition at line 116 of file MP_set.hpp.

Referenced by getEmpty().


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