source: branches/Couenne/Couenne/src/expression/exprClone.h @ 534

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

moved include files to make them doxygenable. Introduced three-way branching, with fixed intervals for now. Added check for small bound interval within all generateCuts()

File size: 1.0 KB
Line 
1/*
2 * Name:    exprClone.h
3 * Author:  Pietro Belotti
4 * Purpose: definition of the clone class (different from exprCopy in
5 *          that evaluation are propagated)
6 *
7 * (C) Pietro Belotti. This file is licensed under the Common Public License (CPL)
8 */
9
10#ifndef COUENNE_EXPRCLONE_H
11#define COUENNE_EXPRCLONE_H
12
13#include <iostream>
14
15#include <CouenneTypes.h>
16#include <exprCopy.h>
17
18
19/// expression clone (points to VALUE and EXPRESSION of another expression)
20
21class exprClone: public exprCopy {
22
23 public:
24
25  /// Constructor
26  exprClone  (expression *copy): 
27    exprCopy (copy) {}
28
29  /// copy constructor
30  exprClone (const exprClone &e):
31    exprCopy (e) {}
32
33  /// cloning method
34  exprClone *clone () const
35  {return new exprClone (*this);}
36
37  /// I/O
38  void print (std::ostream &out) const
39    {copy_ -> Original () -> print (out);}
40
41  /// value
42  inline CouNumber Value () const 
43    {return copy_ -> Value ();}
44
45  /// null function for evaluating the expression
46  inline CouNumber operator () () 
47    {return (currValue_ = (*copy_) ());}
48};
49
50#endif
Note: See TracBrowser for help on using the repository browser.