This is one of the main public interface classes. It is normally directly constructed given a set of indices (domain) over which it is valid. If the data is not bound at construction, either the value() or initialize() method must be called which (deep) copies in the actual data. If one wishes to refer to external data instead rather than doing a deep copy, use the constructor which takes the value pointer as an argument. This copies the original data pointer value (rather than a deep copy).
This is used for construction of :.
More...
#include <MP_data.hpp>
Inheritance diagram for flopc::MP_data:
Public Member Functions | |
void | operator() () const |
void | initialize (double d) |
similar to value() but copies the same value to all entries. | |
MP_data (const MP_set_base &s1=MP_set::getEmpty(), const MP_set_base &s2=MP_set::getEmpty(), const MP_set_base &s3=MP_set::getEmpty(), const MP_set_base &s4=MP_set::getEmpty(), const MP_set_base &s5=MP_set::getEmpty()) | |
MP_data (double *value, const MP_set_base &s1=MP_set::getEmpty(), const MP_set_base &s2=MP_set::getEmpty(), const MP_set_base &s3=MP_set::getEmpty(), const MP_set_base &s4=MP_set::getEmpty(), const MP_set_base &s5=MP_set::getEmpty()) | |
~MP_data () | |
void | value (const double *d) |
Used to bind and deep copy data into the MP_data data structure. | |
operator double () | |
double & | operator() (int lcli1, int lcli2=0, int lcli3=0, int lcli4=0, int lcli5=0) |
DataRef & | operator() (const MP_index_exp &lcli1=MP_index_exp::getEmpty(), const MP_index_exp &lcli2=MP_index_exp::getEmpty(), const MP_index_exp &lcli3=MP_index_exp::getEmpty(), const MP_index_exp &lcli4=MP_index_exp::getEmpty(), const MP_index_exp &lcli5=MP_index_exp::getEmpty()) |
void | display (string s="") |
For displaying data in a human readable format. | |
Protected Attributes | |
vector< DataRef * > | myrefs |
Private Member Functions | |
MP_data (const MP_data &) | |
MP_data & | operator= (const MP_data &) |
Private Attributes | |
MP_index | i1 |
MP_index | i2 |
MP_index | i3 |
MP_index | i4 |
MP_index | i5 |
const MP_set_base & | S1 |
const MP_set_base & | S2 |
const MP_set_base & | S3 |
const MP_set_base & | S4 |
const MP_set_base & | S5 |
double * | v |
bool | manageData |
Static Private Attributes | |
static double | outOfBoundData = 0 |
Friends | |
class | MP_variable |
class | DisplayData |
class | DataRef |
class | MP_model |
This is one of the main public interface classes. It is normally directly constructed given a set of indices (domain) over which it is valid. If the data is not bound at construction, either the value() or initialize() method must be called which (deep) copies in the actual data. If one wishes to refer to external data instead rather than doing a deep copy, use the constructor which takes the value pointer as an argument. This copies the original data pointer value (rather than a deep copy).
This is used for construction of :.
Definition at line 69 of file MP_data.hpp.
flopc::MP_data::MP_data | ( | const MP_set_base & | s1 = MP_set::getEmpty() , |
|
const MP_set_base & | s2 = MP_set::getEmpty() , |
|||
const MP_set_base & | s3 = MP_set::getEmpty() , |
|||
const MP_set_base & | s4 = MP_set::getEmpty() , |
|||
const MP_set_base & | s5 = MP_set::getEmpty() | |||
) | [inline] |
Constructs the MP_data object, and allocates space for data, but does not initialize the data.
Definition at line 85 of file MP_data.hpp.
References initialize().
flopc::MP_data::MP_data | ( | double * | value, | |
const MP_set_base & | s1 = MP_set::getEmpty() , |
|||
const MP_set_base & | s2 = MP_set::getEmpty() , |
|||
const MP_set_base & | s3 = MP_set::getEmpty() , |
|||
const MP_set_base & | s4 = MP_set::getEmpty() , |
|||
const MP_set_base & | s5 = MP_set::getEmpty() | |||
) | [inline] |
Construct the object, and uses the data in the original array (shallow copy)
Definition at line 100 of file MP_data.hpp.
flopc::MP_data::~MP_data | ( | ) | [inline] |
flopc::MP_data::MP_data | ( | const MP_data & | ) | [private] |
void MP_data::display | ( | string | s = "" |
) |
void flopc::MP_data::initialize | ( | double | d | ) | [inline] |
similar to value() but copies the same value to all entries.
Definition at line 77 of file MP_data.hpp.
References flopc::RowMajor::size(), and v.
Referenced by flopc::MP_variable::binary(), MP_data(), and flopc::MP_variable::MP_variable().
flopc::MP_data::operator double | ( | ) | [inline] |
DataRef& flopc::MP_data::operator() | ( | const MP_index_exp & | lcli1 = MP_index_exp::getEmpty() , |
|
const MP_index_exp & | lcli2 = MP_index_exp::getEmpty() , |
|||
const MP_index_exp & | lcli3 = MP_index_exp::getEmpty() , |
|||
const MP_index_exp & | lcli4 = MP_index_exp::getEmpty() , |
|||
const MP_index_exp & | lcli5 = MP_index_exp::getEmpty() | |||
) | [inline] |
returns a DataRef which refers into the MP_data.
Reimplemented in flopc::MP_stochastic_data.
Definition at line 156 of file MP_data.hpp.
double& flopc::MP_data::operator() | ( | int | lcli1, | |
int | lcli2 = 0 , |
|||
int | lcli3 = 0 , |
|||
int | lcli4 = 0 , |
|||
int | lcli5 = 0 | |||
) | [inline] |
Looks up the data based on the index values passed in.
Definition at line 137 of file MP_data.hpp.
References flopc::MP_set_base::check(), flopc::RowMajor::f(), flopc::outOfBound, outOfBoundData, S1, S2, S3, S4, S5, and v.
void MP_data::operator() | ( | ) | const [virtual] |
Implements flopc::Functor.
Definition at line 92 of file MP_data.cpp.
References flopc::MP_index::evaluate(), flopc::RowMajor::f(), flopc::MP_set::getEmpty(), i1, i2, i3, i4, i5, S1, S2, S3, S4, S5, and v.
Referenced by operator double().
void flopc::MP_data::value | ( | const double * | d | ) | [inline] |
Used to bind and deep copy data into the MP_data data structure.
Definition at line 122 of file MP_data.hpp.
References flopc::RowMajor::size(), and v.
friend class DataRef [friend] |
Definition at line 72 of file MP_data.hpp.
Referenced by flopc::MP_stochastic_data::operator()(), and operator()().
friend class DisplayData [friend] |
Definition at line 71 of file MP_data.hpp.
friend class MP_model [friend] |
Definition at line 73 of file MP_data.hpp.
friend class MP_variable [friend] |
Definition at line 70 of file MP_data.hpp.
MP_index flopc::MP_data::i1 [private] |
MP_index flopc::MP_data::i2 [private] |
MP_index flopc::MP_data::i3 [private] |
MP_index flopc::MP_data::i4 [private] |
MP_index flopc::MP_data::i5 [private] |
bool flopc::MP_data::manageData [private] |
vector<DataRef*> flopc::MP_data::myrefs [protected] |
Definition at line 171 of file MP_data.hpp.
Referenced by flopc::MP_stochastic_data::operator()(), and operator()().
double MP_data::outOfBoundData = 0 [static, private] |
const MP_set_base& flopc::MP_data::S1 [private] |
Definition at line 179 of file MP_data.hpp.
Referenced by display(), flopc::DataRef::evaluate(), flopc::DataRef::evaluate_lhs(), flopc::DataRef::getStage(), operator()(), and flopc::DataRef::operator=().
const MP_set_base & flopc::MP_data::S2 [private] |
Definition at line 179 of file MP_data.hpp.
Referenced by display(), flopc::DataRef::evaluate(), flopc::DataRef::evaluate_lhs(), flopc::DataRef::getStage(), operator()(), and flopc::DataRef::operator=().
const MP_set_base & flopc::MP_data::S3 [private] |
Definition at line 179 of file MP_data.hpp.
Referenced by display(), flopc::DataRef::evaluate(), flopc::DataRef::evaluate_lhs(), flopc::DataRef::getStage(), operator()(), and flopc::DataRef::operator=().
const MP_set_base & flopc::MP_data::S4 [private] |
Definition at line 179 of file MP_data.hpp.
Referenced by display(), flopc::DataRef::evaluate(), flopc::DataRef::evaluate_lhs(), flopc::DataRef::getStage(), operator()(), and flopc::DataRef::operator=().
const MP_set_base & flopc::MP_data::S5 [private] |
Definition at line 179 of file MP_data.hpp.
Referenced by display(), flopc::DataRef::evaluate(), flopc::DataRef::evaluate_lhs(), flopc::DataRef::getStage(), operator()(), and flopc::DataRef::operator=().
double* flopc::MP_data::v [private] |
Definition at line 180 of file MP_data.hpp.
Referenced by flopc::DataRef::evaluate(), flopc::DataRef::evaluate_lhs(), initialize(), operator()(), value(), and ~MP_data().