/[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 1034 by gross, Wed Mar 14 23:49:20 2007 UTC revision 1092 by gross, Fri Apr 13 03:39:49 2007 UTC
# Line 38  using namespace boost::python; Line 38  using namespace boost::python;
38  using namespace boost;  using namespace boost;
39  using namespace escript;  using namespace escript;
40    
 #if defined DOPROF  
 //  
 // global table of profiling data for all Data objects  
 DataProf dataProfTable;  
 #endif  
   
41  Data::Data()  Data::Data()
42  {  {
43    //    //
# Line 52  Data::Data() Line 46  Data::Data()
46    shared_ptr<DataAbstract> temp_data(temp);    shared_ptr<DataAbstract> temp_data(temp);
47    m_data=temp_data;    m_data=temp_data;
48    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
49  }  }
50    
51  Data::Data(double value,  Data::Data(double value,
# Line 70  Data::Data(double value, Line 60  Data::Data(double value,
60    DataArray temp(dataPointShape,value);    DataArray temp(dataPointShape,value);
61    initialise(temp.getView(),what,expanded);    initialise(temp.getView(),what,expanded);
62    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
63  }  }
64    
65  Data::Data(double value,  Data::Data(double value,
# Line 85  Data::Data(double value, Line 71  Data::Data(double value,
71    pair<int,int> dataShape=what.getDataShape();    pair<int,int> dataShape=what.getDataShape();
72    initialise(temp.getView(),what,expanded);    initialise(temp.getView(),what,expanded);
73    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
74  }  }
75    
76  Data::Data(const Data& inData)  Data::Data(const Data& inData)
77  {  {
78    m_data=inData.m_data;    m_data=inData.m_data;
79    m_protected=inData.isProtected();    m_protected=inData.isProtected();
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
80  }  }
81    
82  Data::Data(const Data& inData,  Data::Data(const Data& inData,
# Line 110  Data::Data(const Data& inData, Line 88  Data::Data(const Data& inData,
88    shared_ptr<DataAbstract> temp_data(tmp);    shared_ptr<DataAbstract> temp_data(tmp);
89    m_data=temp_data;    m_data=temp_data;
90    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
91  }  }
92    
93  Data::Data(const Data& inData,  Data::Data(const Data& inData,
94             const FunctionSpace& functionspace)             const FunctionSpace& functionspace)
95  {  {
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
96    if (inData.getFunctionSpace()==functionspace) {    if (inData.getFunctionSpace()==functionspace) {
97      m_data=inData.m_data;      m_data=inData.m_data;
98    } else {    } else {
     #if defined DOPROF  
     profData->interpolate++;  
     #endif  
99      Data tmp(0,inData.getPointDataView().getShape(),functionspace,true);      Data tmp(0,inData.getPointDataView().getShape(),functionspace,true);
100      // Note: Must use a reference or pointer to a derived object      // Note: Must use a reference or pointer to a derived object
101      // in order to get polymorphic behaviour. Shouldn't really      // in order to get polymorphic behaviour. Shouldn't really
# Line 158  Data::Data(const DataTagged::TagListType Line 125  Data::Data(const DataTagged::TagListType
125    if (expanded) {    if (expanded) {
126      expand();      expand();
127    }    }
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
128  }  }
129    
130  Data::Data(const numeric::array& value,  Data::Data(const numeric::array& value,
# Line 170  Data::Data(const numeric::array& value, Line 133  Data::Data(const numeric::array& value,
133  {  {
134    initialise(value,what,expanded);    initialise(value,what,expanded);
135    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
136  }  }
137    
138  Data::Data(const DataArrayView& value,  Data::Data(const DataArrayView& value,
# Line 182  Data::Data(const DataArrayView& value, Line 141  Data::Data(const DataArrayView& value,
141  {  {
142    initialise(value,what,expanded);    initialise(value,what,expanded);
143    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
144  }  }
145    
146  Data::Data(const object& value,  Data::Data(const object& value,
# Line 195  Data::Data(const object& value, Line 150  Data::Data(const object& value,
150    numeric::array asNumArray(value);    numeric::array asNumArray(value);
151    initialise(asNumArray,what,expanded);    initialise(asNumArray,what,expanded);
152    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
153  }  }
154    
155  Data::Data(const object& value,  Data::Data(const object& value,
# Line 220  Data::Data(const object& value, Line 171  Data::Data(const object& value,
171      initialise(temp.getView(),other.getFunctionSpace(),false);      initialise(temp.getView(),other.getFunctionSpace(),false);
172    }    }
173    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
174  }  }
175    
176  Data::~Data()  Data::~Data()
# Line 423  Data::tag() Line 370  Data::tag()
370  Data  Data
371  Data::oneOver() const  Data::oneOver() const
372  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
373    return escript::unaryOp(*this,bind1st(divides<double>(),1.));    return escript::unaryOp(*this,bind1st(divides<double>(),1.));
374  }  }
375    
376  Data  Data
377  Data::wherePositive() const  Data::wherePositive() const
378  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
379    return escript::unaryOp(*this,bind2nd(greater<double>(),0.0));    return escript::unaryOp(*this,bind2nd(greater<double>(),0.0));
380  }  }
381    
382  Data  Data
383  Data::whereNegative() const  Data::whereNegative() const
384  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
385    return escript::unaryOp(*this,bind2nd(less<double>(),0.0));    return escript::unaryOp(*this,bind2nd(less<double>(),0.0));
386  }  }
387    
388  Data  Data
389  Data::whereNonNegative() const  Data::whereNonNegative() const
390  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
391    return escript::unaryOp(*this,bind2nd(greater_equal<double>(),0.0));    return escript::unaryOp(*this,bind2nd(greater_equal<double>(),0.0));
392  }  }
393    
394  Data  Data
395  Data::whereNonPositive() const  Data::whereNonPositive() const
396  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
397    return escript::unaryOp(*this,bind2nd(less_equal<double>(),0.0));    return escript::unaryOp(*this,bind2nd(less_equal<double>(),0.0));
398  }  }
399    
400  Data  Data
401  Data::whereZero(double tol) const  Data::whereZero(double tol) const
402  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
403    Data dataAbs=abs();    Data dataAbs=abs();
404    return escript::unaryOp(dataAbs,bind2nd(less_equal<double>(),tol));    return escript::unaryOp(dataAbs,bind2nd(less_equal<double>(),tol));
405  }  }
# Line 478  Data::whereZero(double tol) const Line 407  Data::whereZero(double tol) const
407  Data  Data
408  Data::whereNonZero(double tol) const  Data::whereNonZero(double tol) const
409  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
410    Data dataAbs=abs();    Data dataAbs=abs();
411    return escript::unaryOp(dataAbs,bind2nd(greater<double>(),tol));    return escript::unaryOp(dataAbs,bind2nd(greater<double>(),tol));
412  }  }
# Line 488  Data::whereNonZero(double tol) const Line 414  Data::whereNonZero(double tol) const
414  Data  Data
415  Data::interpolate(const FunctionSpace& functionspace) const  Data::interpolate(const FunctionSpace& functionspace) const
416  {  {
 #if defined DOPROF  
   profData->interpolate++;  
 #endif  
417    return Data(*this,functionspace);    return Data(*this,functionspace);
418  }  }
419    
# Line 512  Data::probeInterpolation(const FunctionS Line 435  Data::probeInterpolation(const FunctionS
435  Data  Data
436  Data::gradOn(const FunctionSpace& functionspace) const  Data::gradOn(const FunctionSpace& functionspace) const
437  {  {
 #if defined DOPROF  
   profData->grad++;  
 #endif  
438    if (functionspace.getDomain()!=getDomain())    if (functionspace.getDomain()!=getDomain())
439      throw DataException("Error - gradient cannot be calculated on different domains.");      throw DataException("Error - gradient cannot be calculated on different domains.");
440    DataArrayView::ShapeType grad_shape=getPointDataView().getShape();    DataArrayView::ShapeType grad_shape=getPointDataView().getShape();
# Line 848  Data::integrate() const Line 768  Data::integrate() const
768    int rank = getDataPointRank();    int rank = getDataPointRank();
769    DataArrayView::ShapeType shape = getDataPointShape();    DataArrayView::ShapeType shape = getDataPointShape();
770    
 #if defined DOPROF  
   profData->integrate++;  
 #endif  
771    
772    //    //
773    // calculate the integral values    // calculate the integral values
# Line 915  Data::integrate() const Line 832  Data::integrate() const
832  Data  Data
833  Data::sin() const  Data::sin() const
834  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
835    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sin);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sin);
836  }  }
837    
838  Data  Data
839  Data::cos() const  Data::cos() const
840  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
841    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::cos);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::cos);
842  }  }
843    
844  Data  Data
845  Data::tan() const  Data::tan() const
846  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
847    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::tan);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::tan);
848  }  }
849    
850  Data  Data
851  Data::asin() const  Data::asin() const
852  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
853    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::asin);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::asin);
854  }  }
855    
856  Data  Data
857  Data::acos() const  Data::acos() const
858  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
859    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::acos);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::acos);
860  }  }
861    
# Line 961  Data::acos() const Line 863  Data::acos() const
863  Data  Data
864  Data::atan() const  Data::atan() const
865  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
866    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::atan);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::atan);
867  }  }
868    
869  Data  Data
870  Data::sinh() const  Data::sinh() const
871  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
872    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sinh);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sinh);
873  }  }
874    
875  Data  Data
876  Data::cosh() const  Data::cosh() const
877  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
878    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::cosh);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::cosh);
879  }  }
880    
881  Data  Data
882  Data::tanh() const  Data::tanh() const
883  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
884    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::tanh);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::tanh);
885  }  }
886    
# Line 998  Data::tanh() const Line 888  Data::tanh() const
888  Data  Data
889  Data::erf() const  Data::erf() const
890  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
891  #ifdef _WIN32  #ifdef _WIN32
892    throw DataException("Error - Data:: erf function is not supported on _WIN32 platforms.");    throw DataException("Error - Data:: erf function is not supported on _WIN32 platforms.");
893  #else  #else
# Line 1011  Data::erf() const Line 898  Data::erf() const
898  Data  Data
899  Data::asinh() const  Data::asinh() const
900  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
901  #ifdef _WIN32  #ifdef _WIN32
902    return escript::unaryOp(*this,escript::asinh_substitute);    return escript::unaryOp(*this,escript::asinh_substitute);
903  #else  #else
# Line 1024  Data::asinh() const Line 908  Data::asinh() const
908  Data  Data
909  Data::acosh() const  Data::acosh() const
910  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
911  #ifdef _WIN32  #ifdef _WIN32
912    return escript::unaryOp(*this,escript::acosh_substitute);    return escript::unaryOp(*this,escript::acosh_substitute);
913  #else  #else
# Line 1037  Data::acosh() const Line 918  Data::acosh() const
918  Data  Data
919  Data::atanh() const  Data::atanh() const
920  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
921  #ifdef _WIN32  #ifdef _WIN32
922    return escript::unaryOp(*this,escript::atanh_substitute);    return escript::unaryOp(*this,escript::atanh_substitute);
923  #else  #else
# Line 1050  Data::atanh() const Line 928  Data::atanh() const
928  Data  Data
929  Data::log10() const  Data::log10() const
930  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
931    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::log10);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::log10);
932  }  }
933    
934  Data  Data
935  Data::log() const  Data::log() const
936  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
937    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::log);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::log);
938  }  }
939    
940  Data  Data
941  Data::sign() const  Data::sign() const
942  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
943    return escript::unaryOp(*this,escript::fsign);    return escript::unaryOp(*this,escript::fsign);
944  }  }
945    
946  Data  Data
947  Data::abs() const  Data::abs() const
948  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
949    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::fabs);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::fabs);
950  }  }
951    
952  Data  Data
953  Data::neg() const  Data::neg() const
954  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
955    return escript::unaryOp(*this,negate<double>());    return escript::unaryOp(*this,negate<double>());
956  }  }
957    
958  Data  Data
959  Data::pos() const  Data::pos() const
960  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
961    Data result;    Data result;
962    // perform a deep copy    // perform a deep copy
963    result.copy(*this);    result.copy(*this);
# Line 1107  Data::pos() const Line 967  Data::pos() const
967  Data  Data
968  Data::exp() const  Data::exp() const
969  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
970    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::exp);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::exp);
971  }  }
972    
973  Data  Data
974  Data::sqrt() const  Data::sqrt() const
975  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
976    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sqrt);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sqrt);
977  }  }
978    
# Line 1126  double Line 980  double
980  Data::Lsup() const  Data::Lsup() const
981  {  {
982    double localValue, globalValue;    double localValue, globalValue;
 #if defined DOPROF  
   profData->reduction1++;  
 #endif  
983    //    //
984    // set the initial absolute maximum value to zero    // set the initial absolute maximum value to zero
985    
# Line 1146  double Line 997  double
997  Data::Linf() const  Data::Linf() const
998  {  {
999    double localValue, globalValue;    double localValue, globalValue;
 #if defined DOPROF  
   profData->reduction1++;  
 #endif  
1000    //    //
1001    // set the initial absolute minimum value to max double    // set the initial absolute minimum value to max double
1002    AbsMin abs_min_func;    AbsMin abs_min_func;
# Line 1166  double Line 1014  double
1014  Data::sup() const  Data::sup() const
1015  {  {
1016    double localValue, globalValue;    double localValue, globalValue;
 #if defined DOPROF  
   profData->reduction1++;  
 #endif  
1017    //    //
1018    // set the initial maximum value to min possible double    // set the initial maximum value to min possible double
1019    FMax fmax_func;    FMax fmax_func;
# Line 1185  double Line 1030  double
1030  Data::inf() const  Data::inf() const
1031  {  {
1032    double localValue, globalValue;    double localValue, globalValue;
 #if defined DOPROF  
   profData->reduction1++;  
 #endif  
1033    //    //
1034    // set the initial minimum value to max possible double    // set the initial minimum value to max possible double
1035    FMin fmin_func;    FMin fmin_func;
# Line 1205  Data::inf() const Line 1047  Data::inf() const
1047  Data  Data
1048  Data::maxval() const  Data::maxval() const
1049  {  {
 #if defined DOPROF  
   profData->reduction2++;  
 #endif  
1050    //    //
1051    // set the initial maximum value to min possible double    // set the initial maximum value to min possible double
1052    FMax fmax_func;    FMax fmax_func;
# Line 1217  Data::maxval() const Line 1056  Data::maxval() const
1056  Data  Data
1057  Data::minval() const  Data::minval() const
1058  {  {
 #if defined DOPROF  
   profData->reduction2++;  
 #endif  
1059    //    //
1060    // set the initial minimum value to max possible double    // set the initial minimum value to max possible double
1061    FMin fmin_func;    FMin fmin_func;
# Line 1230  Data Line 1066  Data
1066  Data::swapaxes(const int axis0, const int axis1) const  Data::swapaxes(const int axis0, const int axis1) const
1067  {  {
1068       int axis0_tmp,axis1_tmp;       int axis0_tmp,axis1_tmp;
      #if defined DOPROF  
      profData->unary++;  
      #endif  
1069       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1070       DataArrayView::ShapeType ev_shape;       DataArrayView::ShapeType ev_shape;
1071       // Here's the equivalent of python s_out=s[axis_offset:]+s[:axis_offset]       // Here's the equivalent of python s_out=s[axis_offset:]+s[:axis_offset]
# Line 1276  Data::swapaxes(const int axis0, const in Line 1109  Data::swapaxes(const int axis0, const in
1109  Data  Data
1110  Data::symmetric() const  Data::symmetric() const
1111  {  {
      #if defined DOPROF  
         profData->unary++;  
      #endif  
1112       // check input       // check input
1113       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1114       if (getDataPointRank()==2) {       if (getDataPointRank()==2) {
# Line 1301  Data::symmetric() const Line 1131  Data::symmetric() const
1131  Data  Data
1132  Data::nonsymmetric() const  Data::nonsymmetric() const
1133  {  {
      #if defined DOPROF  
         profData->unary++;  
      #endif  
1134       // check input       // check input
1135       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1136       if (getDataPointRank()==2) {       if (getDataPointRank()==2) {
# Line 1338  Data::nonsymmetric() const Line 1165  Data::nonsymmetric() const
1165  Data  Data
1166  Data::trace(int axis_offset) const  Data::trace(int axis_offset) const
1167  {  {
      #if defined DOPROF  
         profData->unary++;  
      #endif  
1168       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1169       if (getDataPointRank()==2) {       if (getDataPointRank()==2) {
1170          DataArrayView::ShapeType ev_shape;          DataArrayView::ShapeType ev_shape;
# Line 1391  Data::trace(int axis_offset) const Line 1215  Data::trace(int axis_offset) const
1215  Data  Data
1216  Data::transpose(int axis_offset) const  Data::transpose(int axis_offset) const
1217  {  {
      #if defined DOPROF  
      profData->unary++;  
      #endif  
1218       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1219       DataArrayView::ShapeType ev_shape;       DataArrayView::ShapeType ev_shape;
1220       // Here's the equivalent of python s_out=s[axis_offset:]+s[:axis_offset]       // Here's the equivalent of python s_out=s[axis_offset:]+s[:axis_offset]
# Line 1415  Data::transpose(int axis_offset) const Line 1236  Data::transpose(int axis_offset) const
1236  Data  Data
1237  Data::eigenvalues() const  Data::eigenvalues() const
1238  {  {
      #if defined DOPROF  
         profData->unary++;  
      #endif  
1239       // check input       // check input
1240       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1241       if (getDataPointRank()!=2)       if (getDataPointRank()!=2)
# Line 1435  Data::eigenvalues() const Line 1253  Data::eigenvalues() const
1253  const boost::python::tuple  const boost::python::tuple
1254  Data::eigenvalues_and_eigenvectors(const double tol) const  Data::eigenvalues_and_eigenvectors(const double tol) const
1255  {  {
      #if defined DOPROF  
         profData->unary++;  
      #endif  
1256       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1257       if (getDataPointRank()!=2)       if (getDataPointRank()!=2)
1258          throw DataException("Error - Data::eigenvalues and eigenvectors can only be calculated for rank 2 object.");          throw DataException("Error - Data::eigenvalues and eigenvectors can only be calculated for rank 2 object.");
# Line 1851  Data::getItem(const boost::python::objec Line 1666  Data::getItem(const boost::python::objec
1666  Data  Data
1667  Data::getSlice(const DataArrayView::RegionType& region) const  Data::getSlice(const DataArrayView::RegionType& region) const
1668  {  {
 #if defined DOPROF  
   profData->slicing++;  
 #endif  
1669    return Data(*this,region);    return Data(*this,region);
1670  }  }
1671    
# Line 1895  Data::setSlice(const Data& value, Line 1707  Data::setSlice(const Data& value,
1707    if (isProtected()) {    if (isProtected()) {
1708          throw DataException("Error - attempt to update protected Data object.");          throw DataException("Error - attempt to update protected Data object.");
1709    }    }
 #if defined DOPROF  
   profData->slicing++;  
 #endif  
1710    Data tempValue(value);    Data tempValue(value);
1711    typeMatchLeft(tempValue);    typeMatchLeft(tempValue);
1712    typeMatchRight(tempValue);    typeMatchRight(tempValue);
# Line 1932  Data::typeMatchRight(const Data& right) Line 1741  Data::typeMatchRight(const Data& right)
1741    }    }
1742  }  }
1743    
1744  /* TODO */  void
1745  /* global reduction */  Data::setTaggedValueByName(std::string name,
1746                               const boost::python::object& value)
1747    {
1748         if (getFunctionSpace().getDomain().isValidTagName(name)) {
1749            int tagKey=getFunctionSpace().getDomain().getTag(name);
1750            setTaggedValue(tagKey,value);
1751         }
1752    }
1753  void  void
1754  Data::setTaggedValue(int tagKey,  Data::setTaggedValue(int tagKey,
1755                       const boost::python::object& value)                       const boost::python::object& value)
# Line 1958  Data::setTaggedValue(int tagKey, Line 1774  Data::setTaggedValue(int tagKey,
1774    m_data->setTaggedValue(tagKey,valueDataArray.getView());    m_data->setTaggedValue(tagKey,valueDataArray.getView());
1775  }  }
1776    
 /* TODO */  
 /* global reduction */  
1777  void  void
1778  Data::setTaggedValueFromCPP(int tagKey,  Data::setTaggedValueFromCPP(int tagKey,
1779                              const DataArrayView& value)                              const DataArrayView& value)
# Line 1980  Data::setTaggedValueFromCPP(int tagKey, Line 1794  Data::setTaggedValueFromCPP(int tagKey,
1794    m_data->setTaggedValue(tagKey,value);    m_data->setTaggedValue(tagKey,value);
1795  }  }
1796    
 /* TODO */  
 /* global reduction */  
1797  int  int
1798  Data::getTagNumber(int dpno)  Data::getTagNumber(int dpno)
1799  {  {
# Line 2338  escript::C_GeneralTensorProduct(Data& ar Line 2150  escript::C_GeneralTensorProduct(Data& ar
2150    // General tensor product: res(SL x SR) = arg_0(SL x SM) * arg_1(SM x SR)    // General tensor product: res(SL x SR) = arg_0(SL x SM) * arg_1(SM x SR)
2151    // SM is the product of the last axis_offset entries in arg_0.getShape().    // SM is the product of the last axis_offset entries in arg_0.getShape().
2152    
   #if defined DOPROF  
     // profData->binary++;  
   #endif  
2153    
2154    // Interpolate if necessary and find an appropriate function space    // Interpolate if necessary and find an appropriate function space
2155    Data arg_0_Z, arg_1_Z;    Data arg_0_Z, arg_1_Z;

Legend:
Removed from v.1034  
changed lines
  Added in v.1092

  ViewVC Help
Powered by ViewVC 1.1.26