Couenne 0.5.8
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
20namespace Couenne {
21
24
25class 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
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...
variable-type operator.
virtual void print(std::ostream &out=std::cout, bool=false) const
Print.
virtual exprVar * clone(Domain *d=NULL) const
Cloning method.
virtual bool isDefinedInteger()
is this expression defined as an integer?
exprIVar(int varIndex, Domain *d=NULL)
Constructor.
virtual bool isInteger()
Is this expression integer?
exprIVar(const exprIVar &e, Domain *d=NULL)
Copy constructor – must go.
variable-type operator
int varIndex_
The index of the variable.
general include file for different compilers