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

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

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

revision 107 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 108 by jgs, Thu Jan 27 06:21:59 2005 UTC
# Line 77  DataConstant::DataConstant(const DataCon Line 77  DataConstant::DataConstant(const DataCon
77    // create a view of the data with the correct shape    // create a view of the data with the correct shape
78    DataArrayView tempView(m_data,shape);    DataArrayView tempView(m_data,shape);
79    // copy the data from the slice to the temp view    // copy the data from the slice to the temp view
80    tempView.copySlice(other.getPointDataView(),region);    DataArrayView::RegionLoopRangeType region_loop_range=getSliceRegionLoopRange(region);
81      tempView.copySlice(other.getPointDataView(),region_loop_range);
82    //    //
83    // store the temp view of the data in this object    // store the temp view of the data in this object
84    setPointDataView(tempView);    setPointDataView(tempView);
# Line 129  DataConstant::setSlice(const DataAbstrac Line 130  DataConstant::setSlice(const DataAbstrac
130    if (tempDataConst==0) {    if (tempDataConst==0) {
131      throw DataException("Programming error - casting to DataConstant.");      throw DataException("Programming error - casting to DataConstant.");
132    }    }
133    getPointDataView().copySliceFrom(tempDataConst->getPointDataView(),region);    //
134      DataArrayView::ShapeType shape(DataArrayView::getResultSliceShape(region));
135      DataArrayView::RegionLoopRangeType region_loop_range=getSliceRegionLoopRange(region);
136      //
137      // check shape:
138      if (getPointDataView().getRank()!=region.size()) {
139        throw DataException("Error - Invalid slice region.");
140      }
141      if (tempDataConst->getPointDataView().getRank()>0 and !value->getPointDataView().checkShape(shape)) {
142        throw DataException (value->getPointDataView().createShapeErrorMessage(
143                    "Error - Couldn't copy slice due to shape mismatch.",shape));
144      }
145      //
146      getPointDataView().copySliceFrom(tempDataConst->getPointDataView(),region_loop_range);
147  }  }
148    
149  void  void

Legend:
Removed from v.107  
changed lines
  Added in v.108

  ViewVC Help
Powered by ViewVC 1.1.26