/[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 1868 by jfenwick, Thu Oct 9 06:30:49 2008 UTC revision 1879 by jfenwick, Tue Oct 14 03:54:42 2008 UTC
# Line 23  Line 23 
23  #include <string>  #include <string>
24  #include <functional>  #include <functional>
25    
26    #include "LocalOps.h"       // for tensor_binary_op
27    
28  namespace escript {  namespace escript {
29    
30  enum ES_optype  enum ES_optype
# Line 42  opToString(ES_optype op); Line 44  opToString(ES_optype op);
44  \class escript::DataLazy  \class escript::DataLazy
45  \brief Wraps an expression tree of other DataObjects.  \brief Wraps an expression tree of other DataObjects.
46  The values of DataPoints are computed when requested rather than all at once.  The values of DataPoints are computed when requested rather than all at once.
47    
48    NOTE: This class assumes that the Data being pointed at are immutable.
49  */  */
50    
51    class DataLazy;
52    
53    typedef POINTER_WRAPPER_CLASS(DataLazy) DataLazy_ptr;
54    typedef POINTER_WRAPPER_CLASS(const DataLazy) const_DataLazy_ptr;
55    
56  class DataLazy : public DataAbstract  class DataLazy : public DataAbstract
57  {  {
58    
# Line 56  public: Line 65  public:
65    DataLazy(DataAbstract_ptr p);    DataLazy(DataAbstract_ptr p);
66    
67    ESCRIPT_DLL_API    ESCRIPT_DLL_API
68      DataLazy(DataLazy_ptr left, DataLazy_ptr right, ES_optype op);
69    
70      ESCRIPT_DLL_API
71    DataLazy(DataAbstract_ptr left, DataAbstract_ptr right, ES_optype op);    DataLazy(DataAbstract_ptr left, DataAbstract_ptr right, ES_optype op);
72    
73    ESCRIPT_DLL_API    ESCRIPT_DLL_API
# Line 67  public: Line 79  public:
79    \brief Compute all data points in the expression tree    \brief Compute all data points in the expression tree
80    */    */
81    ESCRIPT_DLL_API    ESCRIPT_DLL_API
82    DataReady_ptr resolve();    DataReady_ptr
83      resolve();
84    
85    ESCRIPT_DLL_API    ESCRIPT_DLL_API
86    std::string    std::string
# Line 96  public: Line 109  public:
109    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
110                   int dataPointNo) const;                   int dataPointNo) const;
111    
112    
113    //   // this is a top level function, the actual searching will be done by helper methods
114    //   ESCRIPT_DLL_API
115    //   void
116    //   getSample(ValueType& v, int sampleNo,size_t offset=0) const;
117    
118      ESCRIPT_DLL_API
119      int
120      getBuffsRequired() const;
121    
122  private:  private:
123    DataAbstract_ptr m_left, m_right;    DataReady_ptr m_id;
124      DataLazy_ptr m_left, m_right;
125    ES_optype m_op;    ES_optype m_op;
126    size_t length;    // number of values represented by the operation    size_t m_length;  // number of values represented by the operation
127    
128      int m_buffsRequired;  // how many buffers are required to evaluate this expression
129      size_t m_samplesize;  // number of values required to store a sample
130    
131      void
132      resolveSample(ValueType& v,int sampleNo,  size_t offset ) const;
133    
134  };  };
135    
136  }  }

Legend:
Removed from v.1868  
changed lines
  Added in v.1879

  ViewVC Help
Powered by ViewVC 1.1.26