/[escript]/branches/lapack2681/escript/src/DataConstant.cpp
ViewVC logotype

Diff of /branches/lapack2681/escript/src/DataConstant.cpp

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

revision 1872 by jfenwick, Mon Oct 13 00:18:55 2008 UTC revision 2005 by jfenwick, Mon Nov 10 01:21:39 2008 UTC
# Line 36  namespace escript { Line 36  namespace escript {
36    
37  DataConstant::DataConstant(const boost::python::numeric::array& value,  DataConstant::DataConstant(const boost::python::numeric::array& value,
38                             const FunctionSpace& what)                             const FunctionSpace& what)
39    : DataAbstract(what,DataTypes::shapeFromNumArray(value))    : parent(what,DataTypes::shapeFromNumArray(value))
40  {  {
41  //   // extract the shape of the numarray  //   // extract the shape of the numarray
42  //   DataTypes::ShapeType tempShape;  //   DataTypes::ShapeType tempShape;
# Line 75  DataConstant::DataConstant(const boost:: Line 75  DataConstant::DataConstant(const boost::
75  // }  // }
76    
77  DataConstant::DataConstant(const DataConstant& other)  DataConstant::DataConstant(const DataConstant& other)
78    : DataAbstract(other.getFunctionSpace(),other.getShape())    : parent(other.getFunctionSpace(),other.getShape())
79  {  //  {  //
80    // copy the data in the correct format    // copy the data in the correct format
81    m_data=other.m_data;    m_data=other.m_data;
# Line 87  DataConstant::DataConstant(const DataCon Line 87  DataConstant::DataConstant(const DataCon
87    
88  DataConstant::DataConstant(const DataConstant& other,  DataConstant::DataConstant(const DataConstant& other,
89                             const DataTypes::RegionType& region)                             const DataTypes::RegionType& region)
90    : DataAbstract(other.getFunctionSpace(),DataTypes::getResultSliceShape(region))    : parent(other.getFunctionSpace(),DataTypes::getResultSliceShape(region))
91  {  {
92    //    //
93    // get the shape of the slice to copy from    // get the shape of the slice to copy from
# Line 110  DataConstant::DataConstant(const DataCon Line 110  DataConstant::DataConstant(const DataCon
110  DataConstant::DataConstant(const FunctionSpace& what,  DataConstant::DataConstant(const FunctionSpace& what,
111                             const DataTypes::ShapeType &shape,                             const DataTypes::ShapeType &shape,
112                             const DataTypes::ValueType &data)                             const DataTypes::ValueType &data)
113    : DataAbstract(what,shape)    : parent(what,shape)
114  {  {
115    //    //
116    // copy the data in the correct format    // copy the data in the correct format
# Line 141  DataConstant::getPointOffset(int sampleN Line 141  DataConstant::getPointOffset(int sampleN
141  {  {
142    EsysAssert((validSamplePointNo(dataPointNo) && validSampleNo(sampleNo)),    EsysAssert((validSamplePointNo(dataPointNo) && validSampleNo(sampleNo)),
143                "Invalid index, sampleNo: " << sampleNo << " dataPointNo: " << dataPointNo);                "Invalid index, sampleNo: " << sampleNo << " dataPointNo: " << dataPointNo);
144      //
145      // Whatever the coord's always return the same value as this is constant data.
146      return 0;
147    }
148    
149    DataTypes::ValueType::size_type
150    DataConstant::getPointOffset(int sampleNo,
151                                 int dataPointNo)
152    {
153      EsysAssert((validSamplePointNo(dataPointNo) && validSampleNo(sampleNo)),
154                  "Invalid index, sampleNo: " << sampleNo << " dataPointNo: " << dataPointNo);
155    //    //
156    // Whatever the coord's always return the same value as this is constant data.    // Whatever the coord's always return the same value as this is constant data.
157    return 0;    return 0;

Legend:
Removed from v.1872  
changed lines
  Added in v.2005

  ViewVC Help
Powered by ViewVC 1.1.26