/[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

trunk/esys2/escript/src/Data/DataConstant.cpp revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC trunk/escript/src/DataConstant.cpp revision 474 by jgs, Mon Jan 30 04:23:44 2006 UTC
# Line 13  Line 13 
13   ******************************************************************************   ******************************************************************************
14  */  */
15    
16  #include "escript/Data/DataConstant.h"  #include "DataConstant.h"
17  #include "escript/Data/DataException.h"  #include "DataException.h"
18  #include "esysUtils/EsysAssert.h"  #include "EsysAssert.h"
19    
20  #include <iostream>  #include <iostream>
21  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
# Line 72  DataConstant::DataConstant(const DataCon Line 72  DataConstant::DataConstant(const DataCon
72    DataArrayView::ShapeType shape(DataArrayView::getResultSliceShape(region));    DataArrayView::ShapeType shape(DataArrayView::getResultSliceShape(region));
73    //    //
74    // allocate space for this new DataConstant's data    // allocate space for this new DataConstant's data
75    m_data.resize(DataArrayView::noValues(shape));    int len = DataArrayView::noValues(shape);
76      m_data.resize(len,0.,len);
77    //    //
78    // create a view of the data with the correct shape    // create a view of the data with the correct shape
79    DataArrayView tempView(m_data,shape);    DataArrayView tempView(m_data,shape);
# Line 170  DataConstant::reshapeDataPoint(const Dat Line 171  DataConstant::reshapeDataPoint(const Dat
171           << "This Data has data points with rank: " << getPointDataView().getRank();           << "This Data has data points with rank: " << getPointDataView().getRank();
172      throw DataException(temp.str());      throw DataException(temp.str());
173    }    }
174    m_data.resize(DataArrayView::noValues(shape),getPointDataView()());    int len = DataArrayView::noValues(shape);
175      m_data.resize(len,getPointDataView()(),len);
176    DataArrayView newView(m_data,shape);    DataArrayView newView(m_data,shape);
177    setPointDataView(newView);    setPointDataView(newView);
178  }  }

Legend:
Removed from v.123  
changed lines
  Added in v.474

  ViewVC Help
Powered by ViewVC 1.1.26