// ******************** flopc++ ********************************************** // File: MP_data.hpp // $Id$ // Author: Tim Helge Hultberg (thh@mat.ua.pt) // Copyright (C) 2003 Tim Helge Hultberg // All Rights Reserved. //**************************************************************************** #ifndef _MP_data_hpp_ #define _MP_data_hpp_ #include #include "MP_index.hpp" #include "MP_set.hpp" #include "MP_constant.hpp" #include "MP_boolean.hpp" namespace flopc { class MP_data; class DataRef : public Constant_base, public Functor { public: DataRef(MP_data* d, const MP_index_exp& i1, const MP_index_exp& i2, const MP_index_exp& i3, const MP_index_exp& i4, const MP_index_exp& i5) : D(d),I1(i1),I2(i2),I3(i3),I4(i4),I5(i5),C(0) {} ~DataRef() {} DataRef& such_that(const MP_boolean& b); double evaluate() const; const DataRef& operator=(const DataRef& r); const DataRef& operator=(const Constant& c); void evaluate_lhs(double v) const; void operator()() const; private: MP_data* D; MP_index_exp I1,I2,I3,I4,I5; Constant C; MP_boolean B; }; class MP_data : public RowMajor, public Functor , public Named { friend class MP_variable; friend class DisplayData; friend class DataRef; friend class MP_model; public: void operator()() const; void initialize(double d) { for (int i=0; i myrefs; MP_index i1,i2,i3,i4,i5; const MP_set_base &S1,&S2,&S3,&S4,&S5; double* v; bool manageData; }; } // End of namespace flopc #endif