FLOPC++
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
FlopCpp
src
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
23
enum
variableType
{
continuous
,
discrete
};
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
:
40
MP_variable
(
const
MP_set_base
&s1 =
MP_set::getEmpty
(),
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
48
~MP_variable
() {
49
}
50
52
double
level
(
int
i1
=0,
int
i2
=0,
int
i3
=0,
int
i4
=0,
int
i5
=0);
53
55
const
VariableRef
&
operator()
(
56
const
MP_index_exp
& d1 =
MP_index_exp::getEmpty
(),
57
const
MP_index_exp
& d2 =
MP_index_exp::getEmpty
(),
58
const
MP_index_exp
& d3 =
MP_index_exp::getEmpty
(),
59
const
MP_index_exp
& d4 =
MP_index_exp::getEmpty
(),
60
const
MP_index_exp
& d5 =
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
() {
69
upperLimit
.
initialize
(1);
70
type
=
discrete
;
71
}
72
74
void
integer
() {
75
type
=
discrete
;
76
}
77
79
MP_data
upperLimit
;
81
MP_data
lowerLimit
;
82
private
:
83
void
operator()
()
const
;
84
const
MP_set_base
*
S1
, *
S2
, *
S3
, *
S4
, *
S5
;
85
MP_index
i1
,
i2
,
i3
,
i4
,
i5
;
86
87
MP_model
*
M
;
88
variableType
type
;
89
int
offset
;
90
};
91
96
class
MP_binary_variable
:
public
MP_variable
{
97
public
:
98
MP_binary_variable
(
const
MP_set_base
&s1 =
MP_set::getEmpty
(),
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
Generated on Sat Nov 1 2014 02:49:56 for FLOPC++ by
1.8.1.2