OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
ConcreteFun.h
Go to the documentation of this file.
1 #ifndef OPAL_ConcreteFun_HH
2 #define OPAL_ConcreteFun_HH 1
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: ConcreteFun.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: ConcreteFun
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/27 09:33:43 $
17 // $Author: Andreas Adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
21 #include "Match/AbstractFun.h"
23 #include <vector>
24 
25 
26 // Class ConcreteFun
27 // ------------------------------------------------------------------------
29 // The left and right hand sides and the weights of the constraint are
30 // all given by array expressions.
31 
32 class ConcreteFun: public AbstractFun {
33 
34 public:
35 
37  // Uses the following arguments:
38  // [ol]
39  // [li] The left-hand side(s) for the constraint.
40  // [li] A code for the type of constraint.
41  // [li] The right-hand side(s) for the constraint.
42  // [li] The weight(s) for the constraint.
43  // [/ol]
44  ConcreteFun(Attribute &lhs, int rel, Attribute &rhs, Attribute &wgt);
45 
46  virtual ~ConcreteFun();
47 
49  virtual int countConstraints() const;
50 
52  // Increment [b]n[/b] for each constrained value and store the value
53  // in vector [b]f[/b].
54  virtual void evaluate(Vector<double> &f, int &) const;
55 
57  virtual void print(std::ostream &) const;
58 
59 private:
60 
61  // Not implemented.
62  ConcreteFun();
63  ConcreteFun(const ConcreteFun &);
64  void operator=(const ConcreteFun &);
65 
66  // The constraint expression to be adjusted and its weight.
69  int relation;
70  std::vector<double> itsWeight;
71 
72  // The value cache.
73  mutable std::vector<double> lValue;
74  mutable std::vector<double> rValue;
75  mutable std::vector<double> value;
76 };
77 
78 #endif // OPAL_ConcreteFun_HH
std::vector< double > value
Definition: ConcreteFun.h:75
Abstract base for matching constraints.
Definition: AbstractFun.h:32
Attribute itsLhs
Definition: ConcreteFun.h:67
virtual void evaluate(Vector< double > &f, int &) const
Evaluate the matching function(s).
Definition: ConcreteFun.cpp:52
A single matching constraints or an array of matching constraints.
Definition: ConcreteFun.h:32
A representation of an Object attribute.
Definition: Attribute.h:55
virtual ~ConcreteFun()
Definition: ConcreteFun.cpp:43
std::vector< double > itsWeight
Definition: ConcreteFun.h:70
Attribute itsRhs
Definition: ConcreteFun.h:68
std::vector< double > lValue
Definition: ConcreteFun.h:73
void operator=(const ConcreteFun &)
std::vector< double > rValue
Definition: ConcreteFun.h:74
virtual int countConstraints() const
Get the number of constrained values.
Definition: ConcreteFun.cpp:47
virtual void print(std::ostream &) const
Print the function name and value(s).
Definition: ConcreteFun.cpp:86