/[escript]/branches/arrexp_2137_win/escript/src/DataTagged.cpp
ViewVC logotype

Diff of /branches/arrexp_2137_win/escript/src/DataTagged.cpp

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

revision 756 by elspeth, Wed Mar 22 02:12:00 2006 UTC revision 757 by woo409, Mon Jun 26 13:12:56 2006 UTC
# Line 78  DataTagged::DataTagged(const FunctionSpa Line 78  DataTagged::DataTagged(const FunctionSpa
78    }    }
79  }  }
80    
81    DataTagged::DataTagged(const FunctionSpace& what,
82                           const DataArrayView::ShapeType &shape,
83                           const TagListType& tags,
84                           const ValueType& data)
85      : DataAbstract(what)
86    {
87      // alternative constructor
88      // not unit_tested tested yet
89    
90      // copy the data
91      m_data=data;
92    
93      // create the view of the data
94      DataArrayView tempView(m_data,shape);
95      setPointDataView(tempView);
96    
97      // create the tag lookup map
98      for (int sampleNo=0; sampleNo<getNumSamples(); sampleNo++) {
99        m_offsetLookup.insert(DataMapType::value_type(sampleNo,tags[sampleNo]));
100      }
101    }
102    
103    
104  DataTagged::DataTagged(const DataTagged& other)  DataTagged::DataTagged(const DataTagged& other)
105    : DataAbstract(other.getFunctionSpace()),    : DataAbstract(other.getFunctionSpace()),
106    m_data(other.m_data),    m_data(other.m_data),
# Line 198  DataTagged::setSlice(const DataAbstract* Line 221  DataTagged::setSlice(const DataAbstract*
221    if (getPointDataView().getRank()!=region.size()) {    if (getPointDataView().getRank()!=region.size()) {
222      throw DataException("Error - Invalid slice region.");      throw DataException("Error - Invalid slice region.");
223    }    }
224    if (otherTemp->getPointDataView().getRank()>0 and !other->getPointDataView().checkShape(regionShape)) {    if (otherTemp->getPointDataView().getRank()>0 && !other->getPointDataView().checkShape(regionShape)) {
225      throw DataException (other->getPointDataView().createShapeErrorMessage(      throw DataException (other->getPointDataView().createShapeErrorMessage(
226                           "Error - Couldn't copy slice due to shape mismatch.",regionShape));                           "Error - Couldn't copy slice due to shape mismatch.",regionShape));
227    }    }

Legend:
Removed from v.756  
changed lines
  Added in v.757

  ViewVC Help
Powered by ViewVC 1.1.26