/[escript]/branches/arrayview_from_1695_trunk/escript/src/DataArrayView.cpp
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/escript/src/DataArrayView.cpp

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

revision 1733 by jfenwick, Mon Aug 25 05:38:57 2008 UTC revision 1734 by jfenwick, Thu Aug 28 06:11:56 2008 UTC
# Line 94  namespace escript { Line 94  namespace escript {
94        }        }
95    
96        EsysAssert((!isEmpty()&&checkShape(tempShape)),        EsysAssert((!isEmpty()&&checkShape(tempShape)),
97                   createShapeErrorMessage("Error - Couldn't copy due to shape mismatch.",tempShape));                   createShapeErrorMessage("Error - Couldn't copy due to shape mismatch.",tempShape,m_shape));
98    
99        if (value.getrank()==0) {        if (value.getrank()==0) {
100           (*this)()=extract<double>(value[value.getshape()]);           (*this)()=extract<double>(value[value.getshape()]);
# Line 142  namespace escript { Line 142  namespace escript {
142        EsysAssert((!isEmpty()&&!other.isEmpty()&&checkOffset(offset)),        EsysAssert((!isEmpty()&&!other.isEmpty()&&checkOffset(offset)),
143                   "Error - Couldn't copy due to insufficient storage.");                   "Error - Couldn't copy due to insufficient storage.");
144        EsysAssert((checkShape(other.getShape())),        EsysAssert((checkShape(other.getShape())),
145                   createShapeErrorMessage("Error - Couldn't copy due to shape mismatch.",other.getShape()));                   createShapeErrorMessage("Error - Couldn't copy due to shape mismatch.",other.getShape(),m_shape));
146        if (checkOffset(offset)) {        if (checkOffset(offset)) {
147           memcpy(&(*m_data)[offset],&(*other.m_data)[other.m_offset],sizeof(double)*noValues());           memcpy(&(*m_data)[offset],&(*other.m_data)[other.m_offset],sizeof(double)*noValues());
148        } else {        } else {
# Line 158  namespace escript { Line 158  namespace escript {
158        EsysAssert((!isEmpty()&&!other.isEmpty()&&checkOffset(thisOffset)&&other.checkOffset(otherOffset)),        EsysAssert((!isEmpty()&&!other.isEmpty()&&checkOffset(thisOffset)&&other.checkOffset(otherOffset)),
159                   "Error - Couldn't copy due to insufficient storage.");                   "Error - Couldn't copy due to insufficient storage.");
160        EsysAssert((checkShape(other.getShape())),        EsysAssert((checkShape(other.getShape())),
161                   createShapeErrorMessage("Error - Couldn't copy due to shape mismatch.",other.getShape()));                   createShapeErrorMessage("Error - Couldn't copy due to shape mismatch.",other.getShape(),m_shape));
162        if (checkOffset(thisOffset)&&other.checkOffset(otherOffset)) {        if (checkOffset(thisOffset)&&other.checkOffset(otherOffset)) {
163           memcpy(&(*m_data)[thisOffset],&(*other.m_data)[otherOffset],sizeof(double)*noValues());           memcpy(&(*m_data)[thisOffset],&(*other.m_data)[otherOffset],sizeof(double)*noValues());
164        } else {        } else {
# Line 443  namespace escript { Line 443  namespace escript {
443        EsysAssert(other.getRank()==region.size(),        EsysAssert(other.getRank()==region.size(),
444                   "Error - slice not same rank as view to be sliced from.");                   "Error - slice not same rank as view to be sliced from.");
445    
446        EsysAssert(noValues()==noValues(getResultSliceShape(region)),        EsysAssert(noValues()==DataTypes::noValues(getResultSliceShape(region)),
447                   "Error - slice shape not compatible shape for this view.");                   "Error - slice shape not compatible shape for this view.");
448    
449        //        //
# Line 539  namespace escript { Line 539  namespace escript {
539        EsysAssert(getRank()==region.size(),        EsysAssert(getRank()==region.size(),
540                   "Error - slice not same rank as this view.");                   "Error - slice not same rank as this view.");
541    
542        EsysAssert(other.getRank()==0 || other.noValues()==noValues(getResultSliceShape(region)),        EsysAssert(other.getRank()==0 || other.noValues()==DataTypes::noValues(getResultSliceShape(region)),
543                   "Error - slice shape not compatible shape for other view.");                   "Error - slice shape not compatible shape for other view.");
544    
545        //        //

Legend:
Removed from v.1733  
changed lines
  Added in v.1734

  ViewVC Help
Powered by ViewVC 1.1.26