Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CouenneExprStore.hpp
Go to the documentation of this file.
1 /* $Id: CouenneExprStore.hpp 645 2011-06-14 10:04:49Z pbelotti $
2  *
3  * Name: exprStore.hpp
4  * Author: Pietro Belotti
5  * Purpose: definition of a storage class for expressions
6  *
7  * (C) Carnegie-Mellon University, 2007.
8  * This file is licensed under the Eclipse Public License (EPL)
9  */
10 
11 #ifndef COUENNE_EXPRSTORE_HPP
12 #define COUENNE_EXPRSTORE_HPP
13 
14 #include <iostream>
15 
16 #include "CouenneTypes.hpp"
17 #include "CouenneExprCopy.hpp"
18 
19 namespace Couenne {
20 
22 
23 class exprStore: public exprCopy {
24 
25  protected:
26 
29 
30  public:
31 
34  exprCopy (copy) {}
35 
37  exprStore (const exprStore &e, Domain *d = NULL):
38  exprCopy (e, d) {
39  //copy_ = e.Original () -> clone ();
40  }
41 
43  virtual ~exprStore ()
44  {copy_ = NULL;}
45 
47  virtual void print (std::ostream &out = std::cout,
48  bool descend = false) const;
49 
51  virtual inline expression *clone (Domain *d = NULL) const
52  {return new exprStore (*this, d);}
53 
57  virtual inline CouNumber operator () ()
58  {return (copy_ -> Value ());}
59 };
60 
61 }
62 
63 #endif
virtual CouNumber operator()()
function for evaluating the expression – returns value of exprCopy pointed to, which returns a value ...
exprStore(const exprStore &e, Domain *d=NULL)
Store constructor – Must go.
virtual ~exprStore()
Destructor.
virtual expression * clone(Domain *d=NULL) const
Cloning method.
CouNumber value_
Value of the (previously evaluated) expression.
virtual void print(std::ostream &out=std::cout, bool descend=false) const
Printing.
expression * copy_
the expression this object is a (reference) copy of
double CouNumber
main number type in Couenne
storage class for previously evaluated expressions
Expression base class.
exprStore(expression *copy)
Constructor.
virtual CouNumber Value() const
value
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...