OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
ATable.h
Go to the documentation of this file.
1 #ifndef OPAL_ATable_HH
2 #define OPAL_ATable_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: ATable.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: ATable
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/27 09:33:42 $
17 // $Author: Andreas Adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
22 #include <iosfwd>
23 #include <vector>
24 
25 
26 namespace Expressions {
27 
28  // Class ATable.
29  // ----------------------------------------------------------------------
31  // This expression uses one or more AHash objects to represent
32  // the current index in the TABLE expression. These may retrieve
33  // the index from the ATable object by calling getHash().
34  // The result is computed by setting ``#'' to each index value in
35  // turn, evaluating the scalar expression for this value, and storing
36  // it in the proper place.
37 
38  class ATable: public OArray<double> {
39 
40  public:
41 
43  // Use the three index arguments from the TABLE() function.
44  // The expression is assigned later by [tt]defineExpression()[/tt].
45  ATable(int n1, int n2, int n3);
46 
47  ATable(const ATable &);
48  ~ATable();
49 
51  virtual OArray<double> *clone() const;
52 
54  // A representation of the expression read in the TABLE() function.
56 
58  virtual std::vector<double> evaluate() const;
59 
61  double getHash() const;
62 
64  virtual void print(std::ostream &os, int precedence = 99) const;
65 
66  private:
67 
68  // Not implemented.
69  ATable();
70  const ATable &operator=(const ATable &);
71 
72  // Column name.
74 
75  // The range specification.
77 
78  // The current value of '#'.
79  mutable int itsHash;
80  };
81 
82 }
83 
84 #endif // OPAL_ATable_HH
An array expression generated from a TABLE() function.
Definition: ATable.h:38
virtual OArray< double > * clone() const
Make clone.
Definition: ATable.cpp:45
PtrToScalar< double > itsExpr
Definition: ATable.h:73
void defineExpression(PtrToScalar< double >)
Store the generating expression.
Definition: ATable.cpp:50
virtual std::vector< double > evaluate() const
Evaluate.
Definition: ATable.cpp:55
virtual void print(std::ostream &os, int precedence=99) const
Print expression.
Definition: ATable.cpp:71
double getHash() const
Return the current value of &#39;#&#39;.
Definition: ATable.cpp:66
An array expression.
Definition: Expressions.h:149
const ATable & operator=(const ATable &)