/[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 2497 by jfenwick, Mon Jun 29 00:04:45 2009 UTC revision 2521 by jfenwick, Tue Jul 7 00:08:58 2009 UTC
# Line 23  Line 23 
23    
24  #include "LocalOps.h"       // for tensor_binary_op  #include "LocalOps.h"       // for tensor_binary_op
25  #include "BufferGroup.h"  #include "BufferGroup.h"
26    #include "DataVector.h"     // for ElementType
27    
28    
29    #define LAZY_NODE_STORAGE
30    
31  namespace escript {  namespace escript {
32    
# Line 238  public: Line 242  public:
242    size_t    size_t
243    getSampleBufferSize() const;    getSampleBufferSize() const;
244    
   /**  
   \brief Compute the value of the expression for the given sample.  
   \return Vector which stores the value of the subexpression for the given sample.  
   \param v A vector to store intermediate results.  
   \param offset Index in v to begin storing results.  
   \param sampleNo Sample number to evaluate.  
   \param roffset (output parameter) the offset in the return vector where the result begins.  
   
   The return value will be an existing vector so do not deallocate it.  
   */  
   ESCRIPT_DLL_API  
   const ValueType*  
   resolveSample(ValueType& v,  size_t offset, int sampleNo, size_t& roffset);  
   
245     /**     /**
246    \brief Compute the value of the expression for the given sample.    \brief Compute the value of the expression for the given sample.
247    \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.
248    \param v A BufferGroup to store intermediate results.    \param bg A BufferGroup to store intermediate results.
249    \param sampleNo Sample number to evaluate.    \param sampleNo Sample number to evaluate.
250    \param roffset (output parameter) the offset in the return vector where the result begins.    \param roffset (output parameter) the offset in the return vector where the result begins.
251    
# Line 301  private: Line 291  private:
291    size_t m_children;    size_t m_children;
292    size_t m_height;    size_t m_height;
293    
294    #ifdef LAZY_NODE_STORAGE
295    
296      int* m_sampleids;     // may be NULL
297      DataVector m_samples;  
298    
299    #endif // LAZY_NODE_STORAGE
300    
301    
302    #ifdef LAZY_NODE_STORAGE
303      /**
304      Allocates sample storage at each node
305      */
306      void LazyNodeSetup();
307    
308    
309      const DataTypes::ValueType*
310      resolveNodeUnary(int tid, int sampleNo, size_t& roffset);
311    
312      const DataTypes::ValueType*
313      resolveNodeSample(int tid, int sampleNo, size_t& roffset);
314    
315      const DataTypes::ValueType*
316      resolveNodeBinary(int tid, int sampleNo, size_t& roffset);
317    
318      const DataTypes::ValueType*
319      resolveNodeNP1OUT(int tid, int sampleNo, size_t& roffset);
320    
321      const DataTypes::ValueType*
322      resolveNodeNP1OUT_P(int tid, int sampleNo, size_t& roffset);
323    
324      const DataTypes::ValueType*
325      resolveNodeTProd(int tid, int sampleNo, size_t& roffset);
326    
327      const DataTypes::ValueType*
328      resolveNodeNP1OUT_2P(int tid, int sampleNo, size_t& roffset);
329      
330    #endif
331    
332    /**    /**
333    Does the work for toString.    Does the work for toString.
# Line 345  private: Line 372  private:
372    DataReady_ptr    DataReady_ptr
373    resolveVectorWorker();    resolveVectorWorker();
374    
375    #ifdef LAZY_NODE_STORAGE
376      /**
377      \brief resolve to a ReadyData object using storage at nodes
378      */
379      DataReady_ptr
380      resolveNodeWorker();
381    #endif
382    
383      /**
384      \brief Compute the value of the expression for the given sample - using the vector buffer approach.
385      \return Vector which stores the value of the subexpression for the given sample.
386      \param v A vector to store intermediate results.
387      \param offset Index in v to begin storing results.
388      \param sampleNo Sample number to evaluate.
389      \param roffset (output parameter) the offset in the return vector where the result begins.
390    
391      The return value will be an existing vector so do not deallocate it.
392      */
393      ESCRIPT_DLL_API
394      const ValueType*
395      resolveVectorSample(ValueType& v,  size_t offset, int sampleNo, size_t& roffset);
396    
397    
398    /**    /**
399    \brief Compute the value of the expression (unary operation) for the given sample.    \brief Compute the value of the expression (unary operation) for the given sample.
400    \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.

Legend:
Removed from v.2497  
changed lines
  Added in v.2521

  ViewVC Help
Powered by ViewVC 1.1.26