source: branches/Couenne/Couenne/src/include/exprIVar.h @ 377

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

fixed cloning methods, initial var/bound passing, LP and NLP handling

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  // destructor
34  //  ~exprIVar () {}
35
36  // copy constructor
37  exprIVar (const exprIVar &e):
38    exprVar (e.Index ()) {}
39
40  // cloning method
41  virtual exprIVar *clone () const
42    {return new exprIVar (*this);}
43
44  // string equivalent
45  const std::string name () const;
46
47  // print
48  virtual void print (std::ostream &out) const
49    {out << "y_" << varIndex_;}
50
51  // is this expression integer?
52  virtual bool isInteger ()
53    {return true;}
54};
55
56#endif
Note: See TracBrowser for help on using the repository browser.