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

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

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

revision 513 by jgs, Mon Feb 13 04:46:51 2006 UTC revision 541 by jgs, Mon Feb 20 06:50:39 2006 UTC
# Line 200  DataTagged::setSlice(const DataAbstract* Line 200  DataTagged::setSlice(const DataAbstract*
200    if (getPointDataView().getRank()!=region.size()) {    if (getPointDataView().getRank()!=region.size()) {
201      throw DataException("Error - Invalid slice region.");      throw DataException("Error - Invalid slice region.");
202    }    }
203    if (otherTemp->getPointDataView().getRank()>0 && !other->getPointDataView().checkShape(regionShape)) {    if (otherTemp->getPointDataView().getRank()>0 and !other->getPointDataView().checkShape(regionShape)) {
204      throw DataException (other->getPointDataView().createShapeErrorMessage(      throw DataException (other->getPointDataView().createShapeErrorMessage(
205                           "Error - Couldn't copy slice due to shape mismatch.",regionShape));                           "Error - Couldn't copy slice due to shape mismatch.",regionShape));
206    }    }
# Line 208  DataTagged::setSlice(const DataAbstract* Line 208  DataTagged::setSlice(const DataAbstract*
208    // copy slice from other default value to this default value    // copy slice from other default value to this default value
209    getDefaultValue().copySliceFrom(otherTemp->getDefaultValue(), regionLoopRange);    getDefaultValue().copySliceFrom(otherTemp->getDefaultValue(), regionLoopRange);
210    
211    // loop through the tag values copying slices from other to this    // loop through tag values in other, adding any which aren't in this, using default value
212    DataMapType::const_iterator pos;    DataMapType::const_iterator pos;
213      for (pos=otherTemp->m_offsetLookup.begin();pos!=otherTemp->m_offsetLookup.end();pos++) {
214        if (!isCurrentTag(pos->first)) {
215          addTaggedValue(pos->first,getDefaultValue());
216        }
217      }
218    
219      // loop through the tag values copying slices from other to this
220    for (pos=m_offsetLookup.begin();pos!=m_offsetLookup.end();pos++) {    for (pos=m_offsetLookup.begin();pos!=m_offsetLookup.end();pos++) {
221      getDataPointByTag(pos->first).copySliceFrom(otherTemp->getDataPointByTag(pos->first), regionLoopRange);      getDataPointByTag(pos->first).copySliceFrom(otherTemp->getDataPointByTag(pos->first), regionLoopRange);
222    }    }

Legend:
Removed from v.513  
changed lines
  Added in v.541

  ViewVC Help
Powered by ViewVC 1.1.26