source: branches/Couenne/Couenne/src/expression/exprIVar.h @ 543

Last change on this file since 543 was 543, checked in by pbelotti, 13 years ago

changed print methods to create extended formulations. Created extended formulations both with and without auxiliary variables

File size: 1.0 KB
Line 
1/*
2 * Name:    exprIVar.h
3 * Author:  Pietro Belotti
4 * Purpose: definition of the class exprIVar for integer variables
5 *
6 * (C) Pietro Belotti. This file is licensed under the Common Public License (CPL)
7 */
8
9#ifndef COUENNE_EXPRIVAR_H
10#define COUENNE_EXPRIVAR_H
11
12#include <iostream>
13
14#include <CouenneTypes.h>
15#include <expression.h>
16#include <exprConst.h>
17#include <exprVar.h>
18
19class CouenneProblem;
20
21
22/// variable-type operator. All variables of the expression must be
23/// objects of this class
24
25class exprIVar: public exprVar {
26
27 public:
28
29  /// Constructor
30  exprIVar (int varIndex):
31    exprVar (varIndex) {}
32
33  /// copy constructor
34  exprIVar (const exprIVar &e):
35    exprVar (e.Index ()) {}
36
37  /// cloning method
38  virtual exprIVar *clone () const
39    {return new exprIVar (*this);}
40
41  /// print
42  virtual void print (std::ostream &out = std::cout, bool = false, CouenneProblem * = NULL) const
43    {out << "y_" << varIndex_;}
44
45  /// is this expression integer?
46  virtual bool isInteger ()
47    {return true;}
48};
49
50#endif
Note: See TracBrowser for help on using the repository browser.