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

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

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

revision 1899 by jfenwick, Mon Oct 20 05:13:24 2008 UTC revision 1901 by jfenwick, Wed Oct 22 02:44:34 2008 UTC
# Line 212  cout << "(1)Lazy created with " << m_sam Line 212  cout << "(1)Lazy created with " << m_sam
212    
213    
214    
215    
216  DataLazy::DataLazy(DataAbstract_ptr left, ES_optype op)  DataLazy::DataLazy(DataAbstract_ptr left, ES_optype op)
217      : parent(left->getFunctionSpace(),left->getShape()),      : parent(left->getFunctionSpace(),left->getShape()),
218      m_op(op)      m_op(op)
# Line 832  DataLazy::getPointOffset(int sampleNo, Line 833  DataLazy::getPointOffset(int sampleNo,
833    throw DataException("getPointOffset - not implemented for Lazy objects - yet.");    throw DataException("getPointOffset - not implemented for Lazy objects - yet.");
834  }  }
835    
836    // It would seem that DataTagged will need to be treated differently since even after setting all tags
837    // to zero, all the tags from all the DataTags would be in the result.
838    // However since they all have the same value (0) whether they are there or not should not matter.
839    // So I have decided that for all types this method will create a constant 0.
840    // It can be promoted up as required.
841    // A possible efficiency concern might be expanded->constant->expanded which has an extra memory management
842    // but we can deal with that if it arrises.
843    void
844    DataLazy::setToZero()
845    {
846      DataTypes::ValueType v(getNoValues(),0);
847      m_id=DataReady_ptr(new DataConstant(getFunctionSpace(),getShape(),v));
848      m_op=IDENTITY;
849      m_right.reset();  
850      m_left.reset();
851      m_readytype='C';
852      m_buffsRequired=1;
853    }
854    
855  }   // end namespace  }   // end namespace

Legend:
Removed from v.1899  
changed lines
  Added in v.1901

  ViewVC Help
Powered by ViewVC 1.1.26