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

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

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

revision 2455 by jfenwick, Wed Jun 3 03:29:07 2009 UTC revision 2458 by jfenwick, Wed Jun 3 06:18:21 2009 UTC
# Line 323  Data::Data(const object& value, Line 323  Data::Data(const object& value,
323             bool expanded)             bool expanded)
324      : m_shared(false), m_lazy(false)      : m_shared(false), m_lazy(false)
325  {  {
   //numeric::array asNumArray(value);  
326    WrappedArray w(value);    WrappedArray w(value);
327    initialise(w,what,expanded);    initialise(w,what,expanded);
328    m_protected=false;    m_protected=false;
# Line 336  Data::Data(const object& value, Line 335  Data::Data(const object& value,
335  {  {
336    WrappedArray w(value);    WrappedArray w(value);
337    
338    // extract the shape of the numarray    // extract the shape of the array
339    const DataTypes::ShapeType& tempShape=w.getShape();    const DataTypes::ShapeType& tempShape=w.getShape();
340    if (w.getRank()==0) {    if (w.getRank()==0) {
341    
# Line 1066  Data::setValueOfDataPointToArray(int dat Line 1065  Data::setValueOfDataPointToArray(int dat
1065    //    //
1066    // check rank    // check rank
1067    if (static_cast<unsigned int>(w.getRank())<getDataPointRank())    if (static_cast<unsigned int>(w.getRank())<getDataPointRank())
1068        throw DataException("Rank of numarray does not match Data object rank");        throw DataException("Rank of array does not match Data object rank");
1069    
1070    //    //
1071    // check shape of num_array    // check shape of array
1072    for (unsigned int i=0; i<getDataPointRank(); i++) {    for (unsigned int i=0; i<getDataPointRank(); i++) {
1073      if (w.getShape()[i]!=getDataPointShape()[i])      if (w.getShape()[i]!=getDataPointShape()[i])
1074         throw DataException("Shape of numarray does not match Data object rank");         throw DataException("Shape of array does not match Data object rank");
1075    }    }
1076    //    //
1077    // make sure data is expanded:    // make sure data is expanded:

Legend:
Removed from v.2455  
changed lines
  Added in v.2458

  ViewVC Help
Powered by ViewVC 1.1.26