00001 /* $Id: exprIVar.hpp 217 2009-07-08 17:02:07Z pbelotti $ 00002 * 00003 * Name: exprIVar.hpp 00004 * Author: Pietro Belotti 00005 * Purpose: definition of the class exprIVar for integer variables 00006 * 00007 * (C) Carnegie-Mellon University, 2006-08. 00008 * This file is licensed under the Common Public License (CPL) 00009 */ 00010 00011 #ifndef COUENNE_EXPRIVAR_HPP 00012 #define COUENNE_EXPRIVAR_HPP 00013 00014 #include <iostream> 00015 00016 #include "CouenneTypes.hpp" 00017 #include "expression.hpp" 00018 #include "exprVar.hpp" 00019 00020 00023 00024 class exprIVar: public exprVar { 00025 00026 public: 00027 00029 exprIVar (int varIndex, Domain *d = NULL): 00030 exprVar (varIndex, d) {} 00031 00033 exprIVar (const exprIVar &e, Domain *d = NULL): 00034 exprVar (e, d) {} 00035 00037 virtual exprVar *clone (Domain *d = NULL) const 00038 {return new exprIVar (*this, d);} 00039 00041 virtual void print (std::ostream &out = std::cout, bool = false) const 00042 {out << "y_" << varIndex_;} 00043 00045 virtual inline bool isDefinedInteger () 00046 {return true;} 00047 00049 virtual inline bool isInteger () 00050 {return true;} 00051 }; 00052 00053 #endif