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

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

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

revision 2211 by jfenwick, Fri Jan 9 01:28:32 2009 UTC revision 2212 by jfenwick, Wed Jan 14 00:15:00 2009 UTC
# Line 29  Line 29 
29  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
30  #include "DataMaths.h"  #include "DataMaths.h"
31    
32    #define CHECK_FOR_EX_WRITE if (!checkNoSharing()) {throw DataException("Attempt to modify shared object");}
33    
34    // #define CHECK_FOR_EX_WRITE if (!checkNoSharing()) {std::ostringstream ss; ss << " Attempt to modify shared object. line " << __LINE__ << " of " << __FILE__; throw DataException(ss.str());}
35    
36  using namespace std;  using namespace std;
37  using namespace boost::python;  using namespace boost::python;
38    
# Line 150  DataConstant::setSlice(const DataAbstrac Line 154  DataConstant::setSlice(const DataAbstrac
154    if (tempDataConst==0) {    if (tempDataConst==0) {
155      throw DataException("Programming error - casting to DataConstant.");      throw DataException("Programming error - casting to DataConstant.");
156    }    }
157      CHECK_FOR_EX_WRITE
158    //    //
159    DataTypes::ShapeType shape(DataTypes::getResultSliceShape(region));    DataTypes::ShapeType shape(DataTypes::getResultSliceShape(region));
160    DataTypes::RegionLoopRangeType region_loop_range=DataTypes::getSliceRegionLoopRange(region);    DataTypes::RegionLoopRangeType region_loop_range=DataTypes::getSliceRegionLoopRange(region);
# Line 262  DataConstant::eigenvalues_and_eigenvecto Line 267  DataConstant::eigenvalues_and_eigenvecto
267  void  void
268  DataConstant::setToZero()  DataConstant::setToZero()
269  {  {
270        CHECK_FOR_EX_WRITE
271      DataTypes::ValueType::size_type n=m_data.size();      DataTypes::ValueType::size_type n=m_data.size();
272      for (int i=0; i<n ;++i) m_data[i]=0.;      for (int i=0; i<n ;++i) m_data[i]=0.;
273  }  }
# Line 343  DataConstant::dump(const std::string fil Line 349  DataConstant::dump(const std::string fil
349     #endif     #endif
350  }  }
351    
352    // These used to be marked as inline in DataConstant.
353    // But they are marked virtual in DataReady
354    DataTypes::ValueType&
355    DataConstant::getVector()
356    {
357      CHECK_FOR_EX_WRITE
358      return m_data;
359    }
360    
361    const DataTypes::ValueType&
362    DataConstant::getVector() const
363    {
364      return m_data;
365    }
366    
367    const DataTypes::ValueType&
368    DataConstant::getVectorRO() const
369    {
370      return m_data;
371    }
372    
373  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.2211  
changed lines
  Added in v.2212

  ViewVC Help
Powered by ViewVC 1.1.26