/[escript]/trunk/escript/src/DataLazy.h
ViewVC logotype

Diff of /trunk/escript/src/DataLazy.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

branches/schroedinger/escript/src/DataLazy.h revision 1903 by jfenwick, Wed Oct 22 06:11:01 2008 UTC trunk/escript/src/DataLazy.h revision 2037 by jfenwick, Thu Nov 13 06:17:12 2008 UTC
# Line 25  Line 25 
25    
26  namespace escript {  namespace escript {
27    
28    // For the purposes of unit testing and maintaining sanity, it is important that this enum be contiguous
29  enum ES_optype  enum ES_optype
30  {  {
31      UNKNOWNOP=0,      UNKNOWNOP=0,
# Line 33  enum ES_optype Line 34  enum ES_optype
34      SUB=3,      SUB=3,
35      MUL=4,      MUL=4,
36      DIV=5,      DIV=5,
37      SIN=6,      POW=6,
38      COS=7,      SIN=POW+1,
39      TAN=8,      COS=SIN+1,
40      ASIN=9,      TAN=SIN+2,
41      ACOS=10,      ASIN=SIN+3,
42      ATAN=11,      ACOS=SIN+4,
43      SINH=12,      ATAN=SIN+5,
44      COSH=13,      SINH=SIN+6,
45      TANH=14,      COSH=SIN+7,
46      ERF=15,      TANH=SIN+8,
47      ASINH=16,      ERF=SIN+9,
48      ACOSH=17,      ASINH=SIN+10,
49      ATANH=18,      ACOSH=SIN+11,
50      LOG10=19,      ATANH=SIN+12,
51      LOG=20,      LOG10=ATANH+1,
52      SIGN=21,      LOG=LOG10+1,
53      ABS=22,      SIGN=LOG10+2,
54      NEG=23,      ABS=LOG10+3,
55      POS=24,      NEG=LOG10+4,
56      EXP=25,      POS=LOG10+5,
57      SQRT=26,      EXP=LOG10+6,
58      RECIP=27,      SQRT=LOG10+7,
59      GZ=28,      RECIP=LOG10+8,
60      LZ=29,      GZ=RECIP+1,
61      GEZ=30,      LZ=GZ+1,
62      LEZ=31      GEZ=GZ+2,
63        LEZ=GZ+3,
64        SYM=LEZ+1,
65        NSYM=SYM+1
66  };  };
67    
68    ESCRIPT_DLL_API
69  const std::string&  const std::string&
70  opToString(ES_optype op);  opToString(ES_optype op);
71    
# Line 153  public: Line 158  public:
158    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
159                   int dataPointNo) const;                   int dataPointNo) const;
160    
161      DataTypes::ValueType::size_type
162      getPointOffset(int sampleNo,
163                     int dataPointNo);
164    
165    
166    /**    /**
167      \return the number of samples which need to be stored to evaluate the expression.      \return the number of samples which need to be stored to evaluate the expression.
# Line 219  private: Line 228  private:
228    resolveSample(ValueType& v,  size_t offset ,int sampleNo, size_t& roffset);    resolveSample(ValueType& v,  size_t offset ,int sampleNo, size_t& roffset);
229    
230    /**    /**
231    \brief Compute the value of the expression (binary operation) for the given sample.    \brief Compute the value of the expression (unary operation) for the given sample.
232    \return Vector which stores the value of the subexpression for the given sample.    \return Vector which stores the value of the subexpression for the given sample.
233    \param v A vector to store intermediate results.    \param v A vector to store intermediate results.
234    \param offset Index in v to begin storing results.    \param offset Index in v to begin storing results.
# Line 234  private: Line 243  private:
243    resolveUnary(ValueType& v,  size_t offset,int sampleNo,  size_t& roffset) const;    resolveUnary(ValueType& v,  size_t offset,int sampleNo,  size_t& roffset) const;
244    
245    /**    /**
246      \brief Compute the value of the expression (unary non-pointwise operation) for the given sample.
247      \return Vector which stores the value of the subexpression for the given sample.
248      \param v A vector to store intermediate results.
249      \param offset Index in v to begin storing results.
250      \param sampleNo Sample number to evaluate.
251      \param roffset (output parameter) the offset in the return vector where the result begins.
252    
253      The return value will be an existing vector so do not deallocate it.
254      If the result is stored in v it should be stored at the offset given.
255      Everything from offset to the end of v should be considered available for this method to use.
256    
257      This method differs from the one above in that deals with operations that are not
258      point-wise. That is, the answer cannot just be written on top of the input.
259      Extra buffers are required for these operations.
260      */
261    
262      ValueType*
263      resolveNP1OUT(ValueType& v, size_t offset, int sampleNo, size_t& roffset) const;
264    
265    
266      /**
267    \brief Compute the value of the expression (binary operation) for the given sample.    \brief Compute the value of the expression (binary operation) for the given sample.
268    \return Vector which stores the value of the subexpression for the given sample.    \return Vector which stores the value of the subexpression for the given sample.
269    \param v A vector to store intermediate results.    \param v A vector to store intermediate results.

Legend:
Removed from v.1903  
changed lines
  Added in v.2037

  ViewVC Help
Powered by ViewVC 1.1.26