/[escript]/trunk-mpi-branch/escript/src/Data.cpp
ViewVC logotype

Diff of /trunk-mpi-branch/escript/src/Data.cpp

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

revision 1086 by ksteube, Tue Feb 13 22:56:57 2007 UTC revision 1087 by gross, Thu Apr 12 10:01:47 2007 UTC
# Line 19  Line 19 
19  #include "DataEmpty.h"  #include "DataEmpty.h"
20  #include "DataArray.h"  #include "DataArray.h"
21  #include "DataArrayView.h"  #include "DataArrayView.h"
 #include "DataProf.h"  
22  #include "FunctionSpaceFactory.h"  #include "FunctionSpaceFactory.h"
23  #include "AbstractContinuousDomain.h"  #include "AbstractContinuousDomain.h"
24  #include "UnaryFuncs.h"  #include "UnaryFuncs.h"
# Line 38  using namespace boost::python; Line 37  using namespace boost::python;
37  using namespace boost;  using namespace boost;
38  using namespace escript;  using namespace escript;
39    
 #if defined DOPROF  
 //  
 // global table of profiling data for all Data objects  
 DataProf dataProfTable;  
 #endif  
   
40  Data::Data()  Data::Data()
41  {  {
42    //    //
# Line 52  Data::Data() Line 45  Data::Data()
45    shared_ptr<DataAbstract> temp_data(temp);    shared_ptr<DataAbstract> temp_data(temp);
46    m_data=temp_data;    m_data=temp_data;
47    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
48  }  }
49    
50  Data::Data(double value,  Data::Data(double value,
# Line 70  Data::Data(double value, Line 59  Data::Data(double value,
59    DataArray temp(dataPointShape,value);    DataArray temp(dataPointShape,value);
60    initialise(temp.getView(),what,expanded);    initialise(temp.getView(),what,expanded);
61    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
62  }  }
63    
64  Data::Data(double value,  Data::Data(double value,
# Line 85  Data::Data(double value, Line 70  Data::Data(double value,
70    pair<int,int> dataShape=what.getDataShape();    pair<int,int> dataShape=what.getDataShape();
71    initialise(temp.getView(),what,expanded);    initialise(temp.getView(),what,expanded);
72    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
73  }  }
74    
75  Data::Data(const Data& inData)  Data::Data(const Data& inData)
76  {  {
77    m_data=inData.m_data;    m_data=inData.m_data;
78    m_protected=inData.isProtected();    m_protected=inData.isProtected();
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
79  }  }
80    
81  Data::Data(const Data& inData,  Data::Data(const Data& inData,
# Line 110  Data::Data(const Data& inData, Line 87  Data::Data(const Data& inData,
87    shared_ptr<DataAbstract> temp_data(tmp);    shared_ptr<DataAbstract> temp_data(tmp);
88    m_data=temp_data;    m_data=temp_data;
89    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
90  }  }
91    
92  Data::Data(const Data& inData,  Data::Data(const Data& inData,
93             const FunctionSpace& functionspace)             const FunctionSpace& functionspace)
94  {  {
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
95    if (inData.getFunctionSpace()==functionspace) {    if (inData.getFunctionSpace()==functionspace) {
96      m_data=inData.m_data;      m_data=inData.m_data;
97    } else {    } else {
     #if defined DOPROF  
     profData->interpolate++;  
     #endif  
98      Data tmp(0,inData.getPointDataView().getShape(),functionspace,true);      Data tmp(0,inData.getPointDataView().getShape(),functionspace,true);
99      // Note: Must use a reference or pointer to a derived object      // Note: Must use a reference or pointer to a derived object
100      // 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 124  Data::Data(const DataTagged::TagListType
124    if (expanded) {    if (expanded) {
125      expand();      expand();
126    }    }
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
127  }  }
128    
129  Data::Data(const numeric::array& value,  Data::Data(const numeric::array& value,
# Line 170  Data::Data(const numeric::array& value, Line 132  Data::Data(const numeric::array& value,
132  {  {
133    initialise(value,what,expanded);    initialise(value,what,expanded);
134    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
135  }  }
136    
137  Data::Data(const DataArrayView& value,  Data::Data(const DataArrayView& value,
# Line 182  Data::Data(const DataArrayView& value, Line 140  Data::Data(const DataArrayView& value,
140  {  {
141    initialise(value,what,expanded);    initialise(value,what,expanded);
142    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
143  }  }
144    
145  Data::Data(const object& value,  Data::Data(const object& value,
# Line 195  Data::Data(const object& value, Line 149  Data::Data(const object& value,
149    numeric::array asNumArray(value);    numeric::array asNumArray(value);
150    initialise(asNumArray,what,expanded);    initialise(asNumArray,what,expanded);
151    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
152  }  }
153    
154  Data::Data(const object& value,  Data::Data(const object& value,
# Line 220  Data::Data(const object& value, Line 170  Data::Data(const object& value,
170      initialise(temp.getView(),other.getFunctionSpace(),false);      initialise(temp.getView(),other.getFunctionSpace(),false);
171    }    }
172    m_protected=false;    m_protected=false;
 #if defined DOPROF  
   // create entry in global profiling table for this object  
   profData = dataProfTable.newData();  
 #endif  
173  }  }
174    
175  Data::~Data()  Data::~Data()
# Line 423  Data::tag() Line 369  Data::tag()
369  Data  Data
370  Data::oneOver() const  Data::oneOver() const
371  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
372    return escript::unaryOp(*this,bind1st(divides<double>(),1.));    return escript::unaryOp(*this,bind1st(divides<double>(),1.));
373  }  }
374    
375  Data  Data
376  Data::wherePositive() const  Data::wherePositive() const
377  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
378    return escript::unaryOp(*this,bind2nd(greater<double>(),0.0));    return escript::unaryOp(*this,bind2nd(greater<double>(),0.0));
379  }  }
380    
381  Data  Data
382  Data::whereNegative() const  Data::whereNegative() const
383  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
384    return escript::unaryOp(*this,bind2nd(less<double>(),0.0));    return escript::unaryOp(*this,bind2nd(less<double>(),0.0));
385  }  }
386    
387  Data  Data
388  Data::whereNonNegative() const  Data::whereNonNegative() const
389  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
390    return escript::unaryOp(*this,bind2nd(greater_equal<double>(),0.0));    return escript::unaryOp(*this,bind2nd(greater_equal<double>(),0.0));
391  }  }
392    
393  Data  Data
394  Data::whereNonPositive() const  Data::whereNonPositive() const
395  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
396    return escript::unaryOp(*this,bind2nd(less_equal<double>(),0.0));    return escript::unaryOp(*this,bind2nd(less_equal<double>(),0.0));
397  }  }
398    
399  Data  Data
400  Data::whereZero(double tol) const  Data::whereZero(double tol) const
401  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
402    Data dataAbs=abs();    Data dataAbs=abs();
403    return escript::unaryOp(dataAbs,bind2nd(less_equal<double>(),tol));    return escript::unaryOp(dataAbs,bind2nd(less_equal<double>(),tol));
404  }  }
# Line 478  Data::whereZero(double tol) const Line 406  Data::whereZero(double tol) const
406  Data  Data
407  Data::whereNonZero(double tol) const  Data::whereNonZero(double tol) const
408  {  {
 #if defined DOPROF  
   profData->where++;  
 #endif  
409    Data dataAbs=abs();    Data dataAbs=abs();
410    return escript::unaryOp(dataAbs,bind2nd(greater<double>(),tol));    return escript::unaryOp(dataAbs,bind2nd(greater<double>(),tol));
411  }  }
# Line 488  Data::whereNonZero(double tol) const Line 413  Data::whereNonZero(double tol) const
413  Data  Data
414  Data::interpolate(const FunctionSpace& functionspace) const  Data::interpolate(const FunctionSpace& functionspace) const
415  {  {
 #if defined DOPROF  
   profData->interpolate++;  
 #endif  
416    return Data(*this,functionspace);    return Data(*this,functionspace);
417  }  }
418    
# Line 512  Data::probeInterpolation(const FunctionS Line 434  Data::probeInterpolation(const FunctionS
434  Data  Data
435  Data::gradOn(const FunctionSpace& functionspace) const  Data::gradOn(const FunctionSpace& functionspace) const
436  {  {
 #if defined DOPROF  
   profData->grad++;  
 #endif  
437    if (functionspace.getDomain()!=getDomain())    if (functionspace.getDomain()!=getDomain())
438      throw DataException("Error - gradient cannot be calculated on different domains.");      throw DataException("Error - gradient cannot be calculated on different domains.");
439    DataArrayView::ShapeType grad_shape=getPointDataView().getShape();    DataArrayView::ShapeType grad_shape=getPointDataView().getShape();
# Line 970  Data::integrate() const Line 889  Data::integrate() const
889    int rank = getDataPointRank();    int rank = getDataPointRank();
890    DataArrayView::ShapeType shape = getDataPointShape();    DataArrayView::ShapeType shape = getDataPointShape();
891    
 #if defined DOPROF  
   profData->integrate++;  
 #endif  
   
892    //    //
893    // calculate the integral values    // calculate the integral values
894    vector<double> integrals(getDataPointSize());    vector<double> integrals(getDataPointSize());
# Line 1037  Data::integrate() const Line 952  Data::integrate() const
952  Data  Data
953  Data::erf() const  Data::erf() const
954  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
955    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::erf);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::erf);
956  }  }
957    
958  Data  Data
959  Data::sin() const  Data::sin() const
960  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
961    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sin);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sin);
962  }  }
963    
964  Data  Data
965  Data::cos() const  Data::cos() const
966  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
967    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::cos);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::cos);
968  }  }
969    
970  Data  Data
971  Data::tan() const  Data::tan() const
972  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
973    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::tan);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::tan);
974  }  }
975    
976  Data  Data
977  Data::asin() const  Data::asin() const
978  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
979    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::asin);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::asin);
980  }  }
981    
982  Data  Data
983  Data::acos() const  Data::acos() const
984  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
985    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::acos);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::acos);
986  }  }
987    
988  Data  Data
989  Data::atan() const  Data::atan() const
990  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
991    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::atan);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::atan);
992  }  }
993    
994  Data  Data
995  Data::sinh() const  Data::sinh() const
996  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
997    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sinh);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sinh);
998  }  }
999    
1000  Data  Data
1001  Data::cosh() const  Data::cosh() const
1002  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1003    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::cosh);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::cosh);
1004  }  }
1005    
1006  Data  Data
1007  Data::tanh() const  Data::tanh() const
1008  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1009    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::tanh);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::tanh);
1010  }  }
1011    
1012  Data  Data
1013  Data::asinh() const  Data::asinh() const
1014  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1015    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::asinh);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::asinh);
1016  }  }
1017    
1018  Data  Data
1019  Data::acosh() const  Data::acosh() const
1020  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1021    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::acosh);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::acosh);
1022  }  }
1023    
1024  Data  Data
1025  Data::atanh() const  Data::atanh() const
1026  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1027    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::atanh);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::atanh);
1028  }  }
1029    
1030  Data  Data
1031  Data::log10() const  Data::log10() const
1032  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1033    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::log10);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::log10);
1034  }  }
1035    
1036  Data  Data
1037  Data::log() const  Data::log() const
1038  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1039    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::log);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::log);
1040  }  }
1041    
1042  Data  Data
1043  Data::sign() const  Data::sign() const
1044  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1045    return escript::unaryOp(*this,escript::fsign);    return escript::unaryOp(*this,escript::fsign);
1046  }  }
1047    
1048  Data  Data
1049  Data::abs() const  Data::abs() const
1050  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1051    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::fabs);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::fabs);
1052  }  }
1053    
1054  Data  Data
1055  Data::neg() const  Data::neg() const
1056  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1057    return escript::unaryOp(*this,negate<double>());    return escript::unaryOp(*this,negate<double>());
1058  }  }
1059    
1060  Data  Data
1061  Data::pos() const  Data::pos() const
1062  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1063    Data result;    Data result;
1064    // perform a deep copy    // perform a deep copy
1065    result.copy(*this);    result.copy(*this);
# Line 1211  Data::pos() const Line 1069  Data::pos() const
1069  Data  Data
1070  Data::exp() const  Data::exp() const
1071  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1072    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::exp);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::exp);
1073  }  }
1074    
1075  Data  Data
1076  Data::sqrt() const  Data::sqrt() const
1077  {  {
 #if defined DOPROF  
   profData->unary++;  
 #endif  
1078    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sqrt);    return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sqrt);
1079  }  }
1080    
# Line 1230  double Line 1082  double
1082  Data::Lsup() const  Data::Lsup() const
1083  {  {
1084    double localValue, globalValue;    double localValue, globalValue;
 #if defined DOPROF  
   profData->reduction1++;  
 #endif  
1085    //    //
1086    // set the initial absolute maximum value to zero    // set the initial absolute maximum value to zero
1087    
# Line 1250  double Line 1099  double
1099  Data::Linf() const  Data::Linf() const
1100  {  {
1101    double localValue, globalValue;    double localValue, globalValue;
 #if defined DOPROF  
   profData->reduction1++;  
 #endif  
1102    //    //
1103    // set the initial absolute minimum value to max double    // set the initial absolute minimum value to max double
1104    AbsMin abs_min_func;    AbsMin abs_min_func;
# Line 1270  double Line 1116  double
1116  Data::sup() const  Data::sup() const
1117  {  {
1118    double localValue, globalValue;    double localValue, globalValue;
 #if defined DOPROF  
   profData->reduction1++;  
 #endif  
1119    //    //
1120    // set the initial maximum value to min possible double    // set the initial maximum value to min possible double
1121    FMax fmax_func;    FMax fmax_func;
# Line 1289  double Line 1132  double
1132  Data::inf() const  Data::inf() const
1133  {  {
1134    double localValue, globalValue;    double localValue, globalValue;
 #if defined DOPROF  
   profData->reduction1++;  
 #endif  
1135    //    //
1136    // set the initial minimum value to max possible double    // set the initial minimum value to max possible double
1137    FMin fmin_func;    FMin fmin_func;
# Line 1309  Data::inf() const Line 1149  Data::inf() const
1149  Data  Data
1150  Data::maxval() const  Data::maxval() const
1151  {  {
 #if defined DOPROF  
   profData->reduction2++;  
 #endif  
1152    //    //
1153    // set the initial maximum value to min possible double    // set the initial maximum value to min possible double
1154    FMax fmax_func;    FMax fmax_func;
# Line 1321  Data::maxval() const Line 1158  Data::maxval() const
1158  Data  Data
1159  Data::minval() const  Data::minval() const
1160  {  {
 #if defined DOPROF  
   profData->reduction2++;  
 #endif  
1161    //    //
1162    // set the initial minimum value to max possible double    // set the initial minimum value to max possible double
1163    FMin fmin_func;    FMin fmin_func;
# Line 1334  Data Line 1168  Data
1168  Data::swapaxes(const int axis0, const int axis1) const  Data::swapaxes(const int axis0, const int axis1) const
1169  {  {
1170       int axis0_tmp,axis1_tmp;       int axis0_tmp,axis1_tmp;
      #if defined DOPROF  
      profData->unary++;  
      #endif  
1171       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1172       DataArrayView::ShapeType ev_shape;       DataArrayView::ShapeType ev_shape;
1173       // 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 1380  Data::swapaxes(const int axis0, const in Line 1211  Data::swapaxes(const int axis0, const in
1211  Data  Data
1212  Data::symmetric() const  Data::symmetric() const
1213  {  {
      #if defined DOPROF  
         profData->unary++;  
      #endif  
1214       // check input       // check input
1215       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1216       if (getDataPointRank()==2) {       if (getDataPointRank()==2) {
# Line 1405  Data::symmetric() const Line 1233  Data::symmetric() const
1233  Data  Data
1234  Data::nonsymmetric() const  Data::nonsymmetric() const
1235  {  {
      #if defined DOPROF  
         profData->unary++;  
      #endif  
1236       // check input       // check input
1237       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1238       if (getDataPointRank()==2) {       if (getDataPointRank()==2) {
# Line 1442  Data::nonsymmetric() const Line 1267  Data::nonsymmetric() const
1267  Data  Data
1268  Data::trace(int axis_offset) const  Data::trace(int axis_offset) const
1269  {  {
      #if defined DOPROF  
         profData->unary++;  
      #endif  
1270       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1271       if (getDataPointRank()==2) {       if (getDataPointRank()==2) {
1272          DataArrayView::ShapeType ev_shape;          DataArrayView::ShapeType ev_shape;
# Line 1495  Data::trace(int axis_offset) const Line 1317  Data::trace(int axis_offset) const
1317  Data  Data
1318  Data::transpose(int axis_offset) const  Data::transpose(int axis_offset) const
1319  {  {
      #if defined DOPROF  
      profData->unary++;  
      #endif  
1320       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1321       DataArrayView::ShapeType ev_shape;       DataArrayView::ShapeType ev_shape;
1322       // 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 1519  Data::transpose(int axis_offset) const Line 1338  Data::transpose(int axis_offset) const
1338  Data  Data
1339  Data::eigenvalues() const  Data::eigenvalues() const
1340  {  {
      #if defined DOPROF  
         profData->unary++;  
      #endif  
1341       // check input       // check input
1342       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1343       if (getDataPointRank()!=2)       if (getDataPointRank()!=2)
# Line 1539  Data::eigenvalues() const Line 1355  Data::eigenvalues() const
1355  const boost::python::tuple  const boost::python::tuple
1356  Data::eigenvalues_and_eigenvectors(const double tol) const  Data::eigenvalues_and_eigenvectors(const double tol) const
1357  {  {
      #if defined DOPROF  
         profData->unary++;  
      #endif  
1358       DataArrayView::ShapeType s=getDataPointShape();       DataArrayView::ShapeType s=getDataPointShape();
1359       if (getDataPointRank()!=2)       if (getDataPointRank()!=2)
1360          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 1955  Data::getItem(const boost::python::objec Line 1768  Data::getItem(const boost::python::objec
1768  Data  Data
1769  Data::getSlice(const DataArrayView::RegionType& region) const  Data::getSlice(const DataArrayView::RegionType& region) const
1770  {  {
 #if defined DOPROF  
   profData->slicing++;  
 #endif  
1771    return Data(*this,region);    return Data(*this,region);
1772  }  }
1773    
# Line 1999  Data::setSlice(const Data& value, Line 1809  Data::setSlice(const Data& value,
1809    if (isProtected()) {    if (isProtected()) {
1810          throw DataException("Error - attempt to update protected Data object.");          throw DataException("Error - attempt to update protected Data object.");
1811    }    }
 #if defined DOPROF  
   profData->slicing++;  
 #endif  
1812    Data tempValue(value);    Data tempValue(value);
1813    typeMatchLeft(tempValue);    typeMatchLeft(tempValue);
1814    typeMatchRight(tempValue);    typeMatchRight(tempValue);
# Line 2442  escript::C_GeneralTensorProduct(Data& ar Line 2249  escript::C_GeneralTensorProduct(Data& ar
2249    // 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)
2250    // 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().
2251    
   #if defined DOPROF  
     // profData->binary++;  
   #endif  
   
2252    // Interpolate if necessary and find an appropriate function space    // Interpolate if necessary and find an appropriate function space
2253    Data arg_0_Z, arg_1_Z;    Data arg_0_Z, arg_1_Z;
2254    if (arg_0.getFunctionSpace()!=arg_1.getFunctionSpace()) {    if (arg_0.getFunctionSpace()!=arg_1.getFunctionSpace()) {

Legend:
Removed from v.1086  
changed lines
  Added in v.1087

  ViewVC Help
Powered by ViewVC 1.1.26