/[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

revision 2037 by jfenwick, Thu Nov 13 06:17:12 2008 UTC revision 2066 by jfenwick, Thu Nov 20 05:31:33 2008 UTC
# Line 62  enum ES_optype Line 62  enum ES_optype
62      GEZ=GZ+2,      GEZ=GZ+2,
63      LEZ=GZ+3,      LEZ=GZ+3,
64      SYM=LEZ+1,      SYM=LEZ+1,
65      NSYM=SYM+1      NSYM=SYM+1,
66        PROD=NSYM+1
67  };  };
68    
69  ESCRIPT_DLL_API  ESCRIPT_DLL_API
# Line 120  public: Line 121  public:
121    ESCRIPT_DLL_API    ESCRIPT_DLL_API
122    DataLazy(DataAbstract_ptr left, DataAbstract_ptr right, ES_optype op);    DataLazy(DataAbstract_ptr left, DataAbstract_ptr right, ES_optype op);
123    
124      /**
125      \brief Produce a DataLazy for a binary operation with additional paramters.
126      \param left left operand
127      \param right right operand
128      \param op unary operation to perform.
129      \param axis_offset
130      \param transpose  
131      \throws DataException if op is not a binary operation requiring parameters or if left or right cannot be converted to a DataLazy.
132      */
133      ESCRIPT_DLL_API
134      DataLazy(DataAbstract_ptr left, DataAbstract_ptr right, ES_optype op, int axis_offset, int transpose);
135    
136    ESCRIPT_DLL_API    ESCRIPT_DLL_API
137    ~DataLazy();    ~DataLazy();
138    
# Line 142  public: Line 155  public:
155    
156    /**    /**
157       \brief       \brief
158       Return the number of doubles that would be stored for this Data object if it were resolved.       This method throws an exception. It does not really make sense to ask this question of lazy data.
159    */    */
160    ESCRIPT_DLL_API    ESCRIPT_DLL_API
161    ValueType::size_type    ValueType::size_type
# Line 171  public: Line 184  public:
184    getBuffsRequired() const;    getBuffsRequired() const;
185    
186    /**    /**
187        \return the largest samplesize required to evaluate the expression.
188      */
189      ESCRIPT_DLL_API
190      size_t
191      getMaxSampleSize() const;
192    
193    
194      /**
195       \brief Produces an IDENTITY DataLazy containing zero.       \brief Produces an IDENTITY DataLazy containing zero.
196       The result will have the same shape and functionspace as before.       The result will have the same shape and functionspace as before.
197    */    */
# Line 182  private: Line 203  private:
203    DataReady_ptr m_id;   //  For IDENTITY nodes, stores a wrapped value.    DataReady_ptr m_id;   //  For IDENTITY nodes, stores a wrapped value.
204    DataLazy_ptr m_left, m_right; // operands for operation.    DataLazy_ptr m_left, m_right; // operands for operation.
205    ES_optype m_op;   // operation to perform.    ES_optype m_op;   // operation to perform.
   size_t m_length;  // number of values represented by the operation  
206    
207    int m_buffsRequired;  // how many samples are required to evaluate this expression    int m_buffsRequired;  // how many samples are required to evaluate this expression
208    size_t m_samplesize;  // number of values required to store a sample    size_t m_samplesize;  // number of values required to store a sample
209    
210    char m_readytype; // E for expanded, T for tagged, C for constant    char m_readytype; // E for expanded, T for tagged, C for constant
211    
212      int m_axis_offset;    // required extra info for general tensor product
213      int m_transpose;
214      int m_SL, m_SM, m_SR; // computed properties used in general tensor product
215    
216      unsigned int m_maxsamplesize; // largest samplesize required by any node in the expression
217    
218    
219    /**    /**
220    Does the work for toString.    Does the work for toString.
# Line 278  private: Line 304  private:
304    ValueType*    ValueType*
305    resolveBinary(ValueType& v,  size_t offset,int sampleNo,  size_t& roffset) const;    resolveBinary(ValueType& v,  size_t offset,int sampleNo,  size_t& roffset) const;
306    
307      /**
308      \brief Compute the value of the expression (tensor product) for the given sample.
309      \return Vector which stores the value of the subexpression for the given sample.
310      \param v A vector to store intermediate results.
311      \param offset Index in v to begin storing results.
312      \param sampleNo Sample number to evaluate.
313      \param roffset (output parameter) the offset in the return vector where the result begins.
314    
315      The return value will be an existing vector so do not deallocate it.
316      If the result is stored in v it should be stored at the offset given.
317      Everything from offset to the end of v should be considered available for this method to use.
318      */
319      DataTypes::ValueType*
320      resolveTProd(ValueType& v,  size_t offset, int sampleNo, size_t& roffset) const;
321    
322  };  };
323    
324  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26