Couenne 0.5.8
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
19namespace Couenne {
20
22
23class 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
Define a dynamic point+bounds, with a way to save and restore previous points+bounds through a LIFO s...
virtual CouNumber Value() const
value
expression * copy_
the expression this object is a (reference) copy of
storage class for previously evaluated expressions
virtual expression * clone(Domain *d=NULL) const
Cloning method.
exprStore(expression *copy)
Constructor.
virtual ~exprStore()
Destructor.
exprStore(const exprStore &e, Domain *d=NULL)
Store constructor – Must go.
virtual CouNumber operator()()
function for evaluating the expression – returns value of exprCopy pointed to, which returns a value ...
virtual void print(std::ostream &out=std::cout, bool descend=false) const
Printing.
CouNumber value_
Value of the (previously evaluated) expression.
Expression base class.
general include file for different compilers
double CouNumber
main number type in Couenne