Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CouenneExprIVar.hpp
Go to the documentation of this file.
1 /* $Id: CouenneExprIVar.hpp 490 2011-01-14 16:07:12Z pbelotti $
2  *
3  * Name: exprIVar.hpp
4  * Author: Pietro Belotti
5  * Purpose: definition of the class exprIVar for integer variables
6  *
7  * (C) Carnegie-Mellon University, 2006-08.
8  * This file is licensed under the Eclipse Public License (EPL)
9  */
10 
11 #ifndef COUENNE_EXPRIVAR_HPP
12 #define COUENNE_EXPRIVAR_HPP
13 
14 #include <iostream>
15 
16 #include "CouenneTypes.hpp"
17 #include "CouenneExpression.hpp"
18 #include "CouenneExprVar.hpp"
19 
20 namespace Couenne {
21 
24 
25 class exprIVar: public exprVar {
26 
27  public:
28 
30  exprIVar (int varIndex, Domain *d = NULL):
31  exprVar (varIndex, d) {}
32 
34  exprIVar (const exprIVar &e, Domain *d = NULL):
35  exprVar (e, d) {}
36 
38  virtual exprVar *clone (Domain *d = NULL) const
39  {return new exprIVar (*this, d);}
40 
42  virtual void print (std::ostream &out = std::cout, bool = false) const
43  {out << "y_" << varIndex_;}
44 
46  virtual inline bool isDefinedInteger ()
47  {return true;}
48 
50  virtual inline bool isInteger ()
51  {return true;}
52 };
53 
54 }
55 
56 #endif
virtual exprVar * clone(Domain *d=NULL) const
Cloning method.
variable-type operator.
variable-type operator
virtual bool isDefinedInteger()
is this expression defined as an integer?
int varIndex_
The index of the variable.
exprIVar(const exprIVar &e, Domain *d=NULL)
Copy constructor – must go.
exprIVar(int varIndex, Domain *d=NULL)
Constructor.
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...
virtual bool isInteger()
Is this expression integer?
virtual void print(std::ostream &out=std::cout, bool=false) const
Print.