FLOPC++
MP_variable.hpp
Go to the documentation of this file.
1 // ******************** FlopCpp **********************************************
2 // File: MP_variable.hpp
3 // $Id$
4 // Author: Tim Helge Hultberg (thh@mat.ua.pt)
5 // Copyright (C) 2003 Tim Helge Hultberg
6 // All Rights Reserved.
7 //****************************************************************************
8 
9 #ifndef _MP_variable_hpp_
10 #define _MP_variable_hpp_
11 
12 #include "MP_set.hpp"
13 #include "MP_index.hpp"
14 #include "MP_expression.hpp"
15 #include "MP_domain.hpp"
16 #include "MP_data.hpp"
17 
18 namespace flopc {
19 
24 
25  class MP_model;
26  class MP_variable;
27 
35  class MP_variable : public RowMajor, public Functor , public Named {
36  friend class MP_model;
37  friend class DisplayVariable;
38  friend class VariableRef;
39  public:
41  const MP_set_base &s2 = MP_set::getEmpty(),
42  const MP_set_base &s3 = MP_set::getEmpty(),
43  const MP_set_base &s4 = MP_set::getEmpty(),
44  const MP_set_base &s5 = MP_set::getEmpty());
45 
46  void display(const std::string &s = "");
47 
49  }
50 
52  double level(int i1=0, int i2=0, int i3=0, int i4=0, int i5=0);
53 
56  const MP_index_exp& d1 = MP_index_exp::getEmpty(),
57  const MP_index_exp& d2 = MP_index_exp::getEmpty(),
59  const MP_index_exp& d4 = MP_index_exp::getEmpty(),
61  ) {
62  return *new VariableRef(this, d1, d2, d3, d4, d5);
63  }
64 
65  //void display(string s = "");
66 
68  void binary() {
70  type = discrete;
71  }
72 
74  void integer() {
75  type = discrete;
76  }
77 
82  private:
83  void operator()() const;
84  const MP_set_base *S1, *S2, *S3, *S4, *S5;
86 
89  int offset;
90  };
91 
97  public:
99  const MP_set_base &s2 = MP_set::getEmpty(),
100  const MP_set_base &s3 = MP_set::getEmpty(),
101  const MP_set_base &s4 = MP_set::getEmpty(),
102  const MP_set_base &s5 = MP_set::getEmpty()) :
103  MP_variable(s1,s2,s3,s4,s5) {
104  binary();
105  }
106  };
107 
108 } // End of namespace flopc
109 #endif