/[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 2049 by phornby, Mon Nov 17 08:54:33 2008 UTC revision 2147 by jfenwick, Wed Dec 10 04:41:26 2008 UTC
# Line 26  Line 26 
26  #include "EscriptParams.h"  #include "EscriptParams.h"
27    
28  extern "C" {  extern "C" {
29  #include "escript/blocktimer.h"  #include "esysUtils/blocktimer.h"
30  }  }
31    
32  #include <fstream>  #include <fstream>
33  #include <algorithm>  #include <algorithm>
34  #include <vector>  #include <vector>
35  #include <functional>  #include <functional>
36    #include <sstream>  // so we can throw messages about ranks
37    
38  #include <boost/python/dict.hpp>  #include <boost/python/dict.hpp>
39  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
# Line 46  using namespace escript; Line 47  using namespace escript;
47  // ensure the current object is not a DataLazy  // ensure the current object is not a DataLazy
48  // The idea was that we could add an optional warning whenever a resolve is forced  // The idea was that we could add an optional warning whenever a resolve is forced
49  #define FORCERESOLVE if (isLazy()) {resolve();}  #define FORCERESOLVE if (isLazy()) {resolve();}
50    #define AUTOLAZYON escriptParams.getAUTOLAZY()
51    #define MAKELAZYOP(X)   if (isLazy() || (AUTOLAZYON && m_data->isExpanded())) \
52      {\
53        DataLazy* c=new DataLazy(borrowDataPtr(),X);\
54        return Data(c);\
55      }
56    #define MAKELAZYOPOFF(X,Y) if (isLazy() || (AUTOLAZYON && m_data->isExpanded())) \
57      {\
58        DataLazy* c=new DataLazy(borrowDataPtr(),X,Y);\
59        return Data(c);\
60      }
61    
62    #define MAKELAZYBINSELF(R,X)   if (isLazy() || R.isLazy() || (AUTOLAZYON && (isExpanded() || R.isExpanded()))) \
63      {\
64        DataLazy* c=new DataLazy(m_data,R.borrowDataPtr(),X);\
65            m_data=c->getPtr();\
66        return (*this);\
67      }
68    
69    // like the above but returns a new data rather than *this
70    #define MAKELAZYBIN(R,X)   if (isLazy() || R.isLazy() || (AUTOLAZYON && (isExpanded() || R.isExpanded()))) \
71      {\
72        DataLazy* c=new DataLazy(m_data,R.borrowDataPtr(),X);\
73        return Data(c);\
74      }
75    
76    #define MAKELAZYBIN2(L,R,X)   if (L.isLazy() || R.isLazy() || (AUTOLAZYON && (L.isExpanded() || R.isExpanded()))) \
77      {\
78        DataLazy* c=new DataLazy(L.borrowDataPtr(),R.borrowDataPtr(),X);\
79        return Data(c);\
80      }
81    
82  Data::Data()  Data::Data()
83  {  {
# Line 130  Data::Data(const Data& inData, Line 162  Data::Data(const Data& inData,
162      if (inData.isConstant()) {  // for a constant function, we just need to use the new function space      if (inData.isConstant()) {  // for a constant function, we just need to use the new function space
163        if (!inData.probeInterpolation(functionspace))        if (!inData.probeInterpolation(functionspace))
164        {           // Even though this is constant, we still need to check whether interpolation is allowed        {           // Even though this is constant, we still need to check whether interpolation is allowed
165      throw FunctionSpaceException("Call to probeInterpolation returned false for DataConstant.");      throw FunctionSpaceException("Cannot interpolate across to the domain of the specified FunctionSpace. (DataConstant)");
166        }        }
167        // if the data is not lazy, this will just be a cast to DataReady        // if the data is not lazy, this will just be a cast to DataReady
168        DataReady_ptr dr=inData.m_data->resolve();        DataReady_ptr dr=inData.m_data->resolve();
# Line 176  Data::Data(const numeric::array& value, Line 208  Data::Data(const numeric::array& value,
208    initialise(value,what,expanded);    initialise(value,what,expanded);
209    m_protected=false;    m_protected=false;
210  }  }
 /*  
 Data::Data(const DataArrayView& value,  
        const FunctionSpace& what,  
            bool expanded)  
 {  
   initialise(value,what,expanded);  
   m_protected=false;  
 }*/  
211    
212  Data::Data(const DataTypes::ValueType& value,  Data::Data(const DataTypes::ValueType& value,
213           const DataTypes::ShapeType& shape,           const DataTypes::ShapeType& shape,
# Line 212  Data::Data(const object& value, Line 236  Data::Data(const object& value,
236    
237    // extract the shape of the numarray    // extract the shape of the numarray
238    DataTypes::ShapeType tempShape=DataTypes::shapeFromNumArray(asNumArray);    DataTypes::ShapeType tempShape=DataTypes::shapeFromNumArray(asNumArray);
239  // /*  for (int i=0; i < asNumArray.getrank(); i++) {    if (DataTypes::getRank(tempShape)==0) {
 //     tempShape.push_back(extract<int>(asNumArray.getshape()[i]));  
 //   }*/  
 //   // get the space for the data vector  
 //   int len = DataTypes::noValues(tempShape);  
 //   DataVector temp_data(len, 0.0, len);  
 // /*  DataArrayView temp_dataView(temp_data, tempShape);  
 //   temp_dataView.copy(asNumArray);*/  
 //   temp_data.copyFromNumArray(asNumArray);  
   
   //  
   // Create DataConstant using the given value and all other parameters  
   // copied from other. If value is a rank 0 object this Data  
   // will assume the point data shape of other.  
   
   if (DataTypes::getRank(tempShape)/*temp_dataView.getRank()*/==0) {  
240    
241    
242      // get the space for the data vector      // get the space for the data vector
243      int len1 = DataTypes::noValues(tempShape);      int len1 = DataTypes::noValues(tempShape);
244      DataVector temp_data(len1, 0.0, len1);      DataVector temp_data(len1, 0.0, len1);
245      temp_data.copyFromNumArray(asNumArray);      temp_data.copyFromNumArray(asNumArray,1);
246    
247      int len = DataTypes::noValues(other.getDataPointShape());      int len = DataTypes::noValues(other.getDataPointShape());
248    
249      DataVector temp2_data(len, temp_data[0]/*temp_dataView()*/, len);      DataVector temp2_data(len, temp_data[0]/*temp_dataView()*/, len);
     //DataArrayView temp2_dataView(temp2_data, other.getPointDataView().getShape());  
 //     initialise(temp2_dataView, other.getFunctionSpace(), false);  
   
250      DataConstant* t=new DataConstant(other.getFunctionSpace(),other.getDataPointShape(),temp2_data);      DataConstant* t=new DataConstant(other.getFunctionSpace(),other.getDataPointShape(),temp2_data);
 //     boost::shared_ptr<DataAbstract> sp(t);  
 //     m_data=sp;  
251      m_data=DataAbstract_ptr(t);      m_data=DataAbstract_ptr(t);
252    
253    } else {    } else {
254      //      //
255      // Create a DataConstant with the same sample shape as other      // Create a DataConstant with the same sample shape as other
 //     initialise(temp_dataView, other.getFunctionSpace(), false);  
256      DataConstant* t=new DataConstant(asNumArray,other.getFunctionSpace());      DataConstant* t=new DataConstant(asNumArray,other.getFunctionSpace());
257  //     boost::shared_ptr<DataAbstract> sp(t);  //     boost::shared_ptr<DataAbstract> sp(t);
258  //     m_data=sp;  //     m_data=sp;
# Line 435  Data::getShapeTuple() const Line 438  Data::getShapeTuple() const
438  // It can't work out what type the function is based soley on its name.  // It can't work out what type the function is based soley on its name.
439  // There are ways to fix this involving creating function pointer variables for each form  // There are ways to fix this involving creating function pointer variables for each form
440  // but there doesn't seem to be a need given that the methods have the same name from the python point of view  // but there doesn't seem to be a need given that the methods have the same name from the python point of view
441  Data*  Data
442  Data::copySelf()  Data::copySelf()
443  {  {
444     DataAbstract* temp=m_data->deepCopy();     DataAbstract* temp=m_data->deepCopy();
445     return new Data(temp);     return Data(temp);
446  }  }
447    
448  void  void
# Line 691  Data::resolve() Line 694  Data::resolve()
694  Data  Data
695  Data::oneOver() const  Data::oneOver() const
696  {  {
697    if (isLazy())    MAKELAZYOP(RECIP)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),RECIP);  
     return Data(c);  
   }  
698    return C_TensorUnaryOperation(*this, bind1st(divides<double>(),1.));    return C_TensorUnaryOperation(*this, bind1st(divides<double>(),1.));
699  }  }
700    
701  Data  Data
702  Data::wherePositive() const  Data::wherePositive() const
703  {  {
704    if (isLazy())    MAKELAZYOP(GZ)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),GZ);  
     return Data(c);  
   }  
705    return C_TensorUnaryOperation(*this, bind2nd(greater<double>(),0.0));    return C_TensorUnaryOperation(*this, bind2nd(greater<double>(),0.0));
706  }  }
707    
708  Data  Data
709  Data::whereNegative() const  Data::whereNegative() const
710  {  {
711    if (isLazy())    MAKELAZYOP(LZ)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),LZ);  
     return Data(c);  
   }  
712    return C_TensorUnaryOperation(*this, bind2nd(less<double>(),0.0));    return C_TensorUnaryOperation(*this, bind2nd(less<double>(),0.0));
713  }  }
714    
715  Data  Data
716  Data::whereNonNegative() const  Data::whereNonNegative() const
717  {  {
718    if (isLazy())    MAKELAZYOP(GEZ)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),GEZ);  
     return Data(c);  
   }  
719    return C_TensorUnaryOperation(*this, bind2nd(greater_equal<double>(),0.0));    return C_TensorUnaryOperation(*this, bind2nd(greater_equal<double>(),0.0));
720  }  }
721    
722  Data  Data
723  Data::whereNonPositive() const  Data::whereNonPositive() const
724  {  {
725    if (isLazy())    MAKELAZYOP(LEZ)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),LEZ);  
     return Data(c);  
   }  
726    return C_TensorUnaryOperation(*this, bind2nd(less_equal<double>(),0.0));    return C_TensorUnaryOperation(*this, bind2nd(less_equal<double>(),0.0));
727  }  }
728    
729  Data  Data
730  Data::whereZero(double tol) const  Data::whereZero(double tol) const
731  {  {
732    Data dataAbs=abs();  //   Data dataAbs=abs();
733    return C_TensorUnaryOperation(dataAbs, bind2nd(less_equal<double>(),tol));  //   return C_TensorUnaryOperation(dataAbs, bind2nd(less_equal<double>(),tol));
734       MAKELAZYOPOFF(EZ,tol)
735       return C_TensorUnaryOperation(*this, bind2nd(AbsLTE(),tol));
736    
737  }  }
738    
739  Data  Data
740  Data::whereNonZero(double tol) const  Data::whereNonZero(double tol) const
741  {  {
742    Data dataAbs=abs();  //   Data dataAbs=abs();
743    return C_TensorUnaryOperation(dataAbs, bind2nd(greater<double>(),tol));  //   return C_TensorUnaryOperation(dataAbs, bind2nd(greater<double>(),tol));
744      MAKELAZYOPOFF(NEZ,tol)
745      return C_TensorUnaryOperation(*this, bind2nd(AbsGT(),tol));
746    
747  }  }
748    
749  Data  Data
# Line 767  bool Line 756  bool
756  Data::probeInterpolation(const FunctionSpace& functionspace) const  Data::probeInterpolation(const FunctionSpace& functionspace) const
757  {  {
758    return getFunctionSpace().probeInterpolation(functionspace);    return getFunctionSpace().probeInterpolation(functionspace);
 //   if (getFunctionSpace()==functionspace) {  
 //     return true;  
 //   } else {  
 //     const_Domain_ptr domain=getDomain();  
 //     if  (*domain==*functionspace.getDomain()) {  
 //       return domain->probeInterpolationOnDomain(getFunctionSpace().getTypeCode(),functionspace.getTypeCode());  
 //     } else {  
 //       return domain->probeInterpolationACross(getFunctionSpace().getTypeCode(),*(functionspace.getDomain()),functionspace.getTypeCode());  
 //     }  
 //   }  
759  }  }
760    
761  Data  Data
# Line 911  Data:: getValueOfDataPoint(int dataPoint Line 890  Data:: getValueOfDataPoint(int dataPoint
890    //    //
891    // return the array    // return the array
892    return numArray;    return numArray;
   
893  }  }
894    
895  void  void
# Line 1151  Data::integrateWorker() const Line 1129  Data::integrateWorker() const
1129    // calculate the integral values    // calculate the integral values
1130    vector<double> integrals(dataPointSize);    vector<double> integrals(dataPointSize);
1131    vector<double> integrals_local(dataPointSize);    vector<double> integrals_local(dataPointSize);
1132      const AbstractContinuousDomain* dom=dynamic_cast<const AbstractContinuousDomain*>(getDomain().get());
1133      if (dom==0)
1134      {            
1135        throw DataException("Can not integrate over non-continuous domains.");
1136      }
1137  #ifdef PASO_MPI  #ifdef PASO_MPI
1138    AbstractContinuousDomain::asAbstractContinuousDomain(*getDomain()).setToIntegrals(integrals_local,*this);    dom->setToIntegrals(integrals_local,*this);
1139    // Global sum: use an array instead of a vector because elements of array are guaranteed to be contiguous in memory    // Global sum: use an array instead of a vector because elements of array are guaranteed to be contiguous in memory
1140    double *tmp = new double[dataPointSize];    double *tmp = new double[dataPointSize];
1141    double *tmp_local = new double[dataPointSize];    double *tmp_local = new double[dataPointSize];
# Line 1162  Data::integrateWorker() const Line 1145  Data::integrateWorker() const
1145    delete[] tmp;    delete[] tmp;
1146    delete[] tmp_local;    delete[] tmp_local;
1147  #else  #else
1148    AbstractContinuousDomain::asAbstractContinuousDomain(*getDomain()).setToIntegrals(integrals,*this);    dom->setToIntegrals(integrals,*this);
1149  #endif  #endif
1150    
1151    //    //
# Line 1223  Data::integrateWorker() const Line 1206  Data::integrateWorker() const
1206  Data  Data
1207  Data::sin() const  Data::sin() const
1208  {  {
1209    if (isLazy())    MAKELAZYOP(SIN)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),SIN);  
     return Data(c);  
   }  
1210    return C_TensorUnaryOperation<double (*)(double)>(*this, ::sin);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::sin);
1211  }  }
1212    
1213  Data  Data
1214  Data::cos() const  Data::cos() const
1215  {  {
1216    if (isLazy())    MAKELAZYOP(COS)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),COS);  
     return Data(c);  
   }  
1217    return C_TensorUnaryOperation<double (*)(double)>(*this, ::cos);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::cos);
1218  }  }
1219    
1220  Data  Data
1221  Data::tan() const  Data::tan() const
1222  {  {
1223    if (isLazy())    MAKELAZYOP(TAN)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),TAN);  
     return Data(c);  
   }  
1224    return C_TensorUnaryOperation<double (*)(double)>(*this, ::tan);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::tan);
1225  }  }
1226    
1227  Data  Data
1228  Data::asin() const  Data::asin() const
1229  {  {
1230    if (isLazy())    MAKELAZYOP(ASIN)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),ASIN);  
     return Data(c);  
   }  
1231    return C_TensorUnaryOperation<double (*)(double)>(*this, ::asin);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::asin);
1232  }  }
1233    
1234  Data  Data
1235  Data::acos() const  Data::acos() const
1236  {  {
1237    if (isLazy())    MAKELAZYOP(ACOS)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),ACOS);  
     return Data(c);  
   }  
1238    return C_TensorUnaryOperation<double (*)(double)>(*this, ::acos);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::acos);
1239  }  }
1240    
# Line 1279  Data::acos() const Line 1242  Data::acos() const
1242  Data  Data
1243  Data::atan() const  Data::atan() const
1244  {  {
1245    if (isLazy())    MAKELAZYOP(ATAN)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),ATAN);  
     return Data(c);  
   }  
1246    return C_TensorUnaryOperation<double (*)(double)>(*this, ::atan);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::atan);
1247  }  }
1248    
1249  Data  Data
1250  Data::sinh() const  Data::sinh() const
1251  {  {
1252    if (isLazy())    MAKELAZYOP(SINH)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),SINH);  
     return Data(c);  
   }  
1253    return C_TensorUnaryOperation<double (*)(double)>(*this, ::sinh);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::sinh);
1254  }  }
1255    
1256  Data  Data
1257  Data::cosh() const  Data::cosh() const
1258  {  {
1259    if (isLazy())    MAKELAZYOP(COSH)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),COSH);  
     return Data(c);  
   }  
1260    return C_TensorUnaryOperation<double (*)(double)>(*this, ::cosh);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::cosh);
1261  }  }
1262    
1263  Data  Data
1264  Data::tanh() const  Data::tanh() const
1265  {  {
1266    if (isLazy())    MAKELAZYOP(TANH)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),TANH);  
     return Data(c);  
   }  
1267    return C_TensorUnaryOperation<double (*)(double)>(*this, ::tanh);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::tanh);
1268  }  }
1269    
# Line 1327  Data::erf() const Line 1274  Data::erf() const
1274  #if defined (_WIN32) && !defined(__INTEL_COMPILER)  #if defined (_WIN32) && !defined(__INTEL_COMPILER)
1275    throw DataException("Error - Data:: erf function is not supported on _WIN32 platforms.");    throw DataException("Error - Data:: erf function is not supported on _WIN32 platforms.");
1276  #else  #else
1277    if (isLazy())    MAKELAZYOP(ERF)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),ERF);  
     return Data(c);  
   }  
1278    return C_TensorUnaryOperation(*this, ::erf);    return C_TensorUnaryOperation(*this, ::erf);
1279  #endif  #endif
1280  }  }
# Line 1339  Data::erf() const Line 1282  Data::erf() const
1282  Data  Data
1283  Data::asinh() const  Data::asinh() const
1284  {  {
1285    if (isLazy())    MAKELAZYOP(ASINH)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),ASINH);  
     return Data(c);  
   }  
1286  #if defined (_WIN32) && !defined(__INTEL_COMPILER)  #if defined (_WIN32) && !defined(__INTEL_COMPILER)
1287    return C_TensorUnaryOperation(*this, escript::asinh_substitute);    return C_TensorUnaryOperation(*this, escript::asinh_substitute);
1288  #else  #else
# Line 1354  Data::asinh() const Line 1293  Data::asinh() const
1293  Data  Data
1294  Data::acosh() const  Data::acosh() const
1295  {  {
1296    if (isLazy())    MAKELAZYOP(ACOSH)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),ACOSH);  
     return Data(c);  
   }  
1297  #if defined (_WIN32) && !defined(__INTEL_COMPILER)  #if defined (_WIN32) && !defined(__INTEL_COMPILER)
1298    return C_TensorUnaryOperation(*this, escript::acosh_substitute);    return C_TensorUnaryOperation(*this, escript::acosh_substitute);
1299  #else  #else
# Line 1369  Data::acosh() const Line 1304  Data::acosh() const
1304  Data  Data
1305  Data::atanh() const  Data::atanh() const
1306  {  {
1307    if (isLazy())    MAKELAZYOP(ATANH)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),ATANH);  
     return Data(c);  
   }  
1308  #if defined (_WIN32) && !defined(__INTEL_COMPILER)  #if defined (_WIN32) && !defined(__INTEL_COMPILER)
1309    return C_TensorUnaryOperation(*this, escript::atanh_substitute);    return C_TensorUnaryOperation(*this, escript::atanh_substitute);
1310  #else  #else
# Line 1383  Data::atanh() const Line 1314  Data::atanh() const
1314    
1315  Data  Data
1316  Data::log10() const  Data::log10() const
1317  {  if (isLazy())  {
1318    {    MAKELAZYOP(LOG10)
     DataLazy* c=new DataLazy(borrowDataPtr(),LOG10);  
     return Data(c);  
   }  
1319    return C_TensorUnaryOperation<double (*)(double)>(*this, ::log10);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::log10);
1320  }  }
1321    
1322  Data  Data
1323  Data::log() const  Data::log() const
1324  {  {
1325    if (isLazy())    MAKELAZYOP(LOG)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),LOG);  
     return Data(c);  
   }  
1326    return C_TensorUnaryOperation<double (*)(double)>(*this, ::log);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::log);
1327  }  }
1328    
1329  Data  Data
1330  Data::sign() const  Data::sign() const
1331  {  {
1332    if (isLazy())    MAKELAZYOP(SIGN)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),SIGN);  
     return Data(c);  
   }  
1333    return C_TensorUnaryOperation(*this, escript::fsign);    return C_TensorUnaryOperation(*this, escript::fsign);
1334  }  }
1335    
1336  Data  Data
1337  Data::abs() const  Data::abs() const
1338  {  {
1339    if (isLazy())    MAKELAZYOP(ABS)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),ABS);  
     return Data(c);  
   }  
1340    return C_TensorUnaryOperation<double (*)(double)>(*this, ::fabs);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::fabs);
1341  }  }
1342    
1343  Data  Data
1344  Data::neg() const  Data::neg() const
1345  {  {
1346    if (isLazy())    MAKELAZYOP(NEG)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),NEG);  
     return Data(c);  
   }  
1347    return C_TensorUnaryOperation(*this, negate<double>());    return C_TensorUnaryOperation(*this, negate<double>());
1348  }  }
1349    
# Line 1448  Data::pos() const Line 1360  Data::pos() const
1360    
1361  Data  Data
1362  Data::exp() const  Data::exp() const
1363  {    {
1364    if (isLazy())    MAKELAZYOP(EXP)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),EXP);  
     return Data(c);  
   }  
1365    return C_TensorUnaryOperation<double (*)(double)>(*this, ::exp);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::exp);
1366  }  }
1367    
1368  Data  Data
1369  Data::sqrt() const  Data::sqrt() const
1370  {  {
1371    if (isLazy())    MAKELAZYOP(SQRT)
   {  
     DataLazy* c=new DataLazy(borrowDataPtr(),SQRT);  
     return Data(c);  
   }  
1372    return C_TensorUnaryOperation<double (*)(double)>(*this, ::sqrt);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::sqrt);
1373  }  }
1374    
# Line 1483  Data::Lsup() Line 1387  Data::Lsup()
1387  {  {
1388     if (isLazy())     if (isLazy())
1389     {     {
1390      expand();      resolve();
1391     }     }
1392     return LsupWorker();     return LsupWorker();
1393  }  }
# Line 1503  Data::sup() Line 1407  Data::sup()
1407  {  {
1408     if (isLazy())     if (isLazy())
1409     {     {
1410      expand();      resolve();
1411     }     }
1412     return supWorker();     return supWorker();
1413  }  }
# Line 1523  Data::inf() Line 1427  Data::inf()
1427  {  {
1428     if (isLazy())     if (isLazy())
1429     {     {
1430      expand();      resolve();
1431     }     }
1432     return infWorker();     return infWorker();
1433  }  }
# Line 1615  Data::minval() const Line 1519  Data::minval() const
1519  Data  Data
1520  Data::swapaxes(const int axis0, const int axis1) const  Data::swapaxes(const int axis0, const int axis1) const
1521  {  {
1522         if (isLazy())
1523         {
1524        Data temp(*this);
1525        temp.resolve();
1526        return temp.swapaxes(axis0,axis1);
1527         }
1528       int axis0_tmp,axis1_tmp;       int axis0_tmp,axis1_tmp;
1529       DataTypes::ShapeType s=getDataPointShape();       DataTypes::ShapeType s=getDataPointShape();
1530       DataTypes::ShapeType ev_shape;       DataTypes::ShapeType ev_shape;
# Line 1672  Data::symmetric() const Line 1582  Data::symmetric() const
1582       else {       else {
1583          throw DataException("Error - Data::symmetric can only be calculated for rank 2 or 4 object.");          throw DataException("Error - Data::symmetric can only be calculated for rank 2 or 4 object.");
1584       }       }
1585       if (isLazy())       MAKELAZYOP(SYM)
      {  
     DataLazy* c=new DataLazy(borrowDataPtr(),SYM);  
     return Data(c);  
      }  
1586       Data ev(0.,getDataPointShape(),getFunctionSpace());       Data ev(0.,getDataPointShape(),getFunctionSpace());
1587       ev.typeMatchRight(*this);       ev.typeMatchRight(*this);
1588       m_data->symmetric(ev.m_data.get());       m_data->symmetric(ev.m_data.get());
# Line 1686  Data::symmetric() const Line 1592  Data::symmetric() const
1592  Data  Data
1593  Data::nonsymmetric() const  Data::nonsymmetric() const
1594  {  {
1595       if (isLazy())       MAKELAZYOP(NSYM)
      {  
     DataLazy* c=new DataLazy(borrowDataPtr(),NSYM);  
     return Data(c);  
      }  
1596       // check input       // check input
1597       DataTypes::ShapeType s=getDataPointShape();       DataTypes::ShapeType s=getDataPointShape();
1598       if (getDataPointRank()==2) {       if (getDataPointRank()==2) {
# Line 1722  Data::nonsymmetric() const Line 1624  Data::nonsymmetric() const
1624       }       }
1625  }  }
1626    
   
 // Doing a lazy version of this would require some thought.  
 // First it needs a parameter (which DataLazy doesn't support at the moment).  
 // (secondly although it does not apply to trace) we can't handle operations which return  
 // multiple results (like eigenvectors_values) or return values of different shapes to their input  
 // (like eigenvalues).  
1627  Data  Data
1628  Data::trace(int axis_offset) const  Data::trace(int axis_offset) const
1629  {  {    
1630       if (isLazy())       MAKELAZYOPOFF(TRACE,axis_offset)
      {  
     Data temp(*this);   // to get around the fact that you can't resolve a const Data  
     temp.resolve();  
     return temp.trace(axis_offset);  
      }  
1631       DataTypes::ShapeType s=getDataPointShape();       DataTypes::ShapeType s=getDataPointShape();
1632       if (getDataPointRank()==2) {       if (getDataPointRank()==2) {
1633          DataTypes::ShapeType ev_shape;          DataTypes::ShapeType ev_shape;
# Line 1787  Data::trace(int axis_offset) const Line 1678  Data::trace(int axis_offset) const
1678  Data  Data
1679  Data::transpose(int axis_offset) const  Data::transpose(int axis_offset) const
1680  {      {    
1681       if (isLazy())       MAKELAZYOPOFF(TRANS,axis_offset)
      {  
     Data temp(*this);   // to get around the fact that you can't resolve a const Data  
     temp.resolve();  
     return temp.transpose(axis_offset);  
      }  
1682       DataTypes::ShapeType s=getDataPointShape();       DataTypes::ShapeType s=getDataPointShape();
1683       DataTypes::ShapeType ev_shape;       DataTypes::ShapeType ev_shape;
1684       // 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 1894  Data::calc_minGlobalDataPoint(int& ProcN Line 1780  Data::calc_minGlobalDataPoint(int& ProcN
1780    double next,local_min;    double next,local_min;
1781    int local_lowi=0,local_lowj=0;        int local_lowi=0,local_lowj=0;    
1782    
1783    #pragma omp parallel private(next,local_min,local_lowi,local_lowj)    #pragma omp parallel firstprivate(local_lowi,local_lowj) private(next,local_min)
1784    {    {
1785      local_min=min;      local_min=min;
1786      #pragma omp for private(i,j) schedule(static)      #pragma omp for private(i,j) schedule(static)
# Line 1921  Data::calc_minGlobalDataPoint(int& ProcN Line 1807  Data::calc_minGlobalDataPoint(int& ProcN
1807      next = temp.getDataPoint(lowi,lowj);      next = temp.getDataPoint(lowi,lowj);
1808      int lowProc = 0;      int lowProc = 0;
1809      double *globalMins = new double[get_MPISize()+1];      double *globalMins = new double[get_MPISize()+1];
1810      int error = MPI_Gather ( &next, 1, MPI_DOUBLE, globalMins, 1, MPI_DOUBLE, 0, get_MPIComm() );      int error;
1811        error = MPI_Gather ( &next, 1, MPI_DOUBLE, globalMins, 1, MPI_DOUBLE, 0, get_MPIComm() );
1812    
1813      if( get_MPIRank()==0 ){      if( get_MPIRank()==0 ){
1814          next = globalMins[lowProc];          next = globalMins[lowProc];
# Line 1987  Data::operator+=(const Data& right) Line 1874  Data::operator+=(const Data& right)
1874    if (isProtected()) {    if (isProtected()) {
1875          throw DataException("Error - attempt to update protected Data object.");          throw DataException("Error - attempt to update protected Data object.");
1876    }    }
1877    if (isLazy() || right.isLazy())    MAKELAZYBINSELF(right,ADD)    // for lazy + is equivalent to +=
1878    {    binaryOp(right,plus<double>());
1879      DataLazy* c=new DataLazy(m_data,right.borrowDataPtr(),ADD); // for lazy + is equivalent to +=    return (*this);
         m_data=c->getPtr();  
     return (*this);  
   }  
   else  
   {  
     binaryOp(right,plus<double>());  
     return (*this);  
   }  
1880  }  }
1881    
1882  Data&  Data&
# Line 2007  Data::operator+=(const boost::python::ob Line 1886  Data::operator+=(const boost::python::ob
1886          throw DataException("Error - attempt to update protected Data object.");          throw DataException("Error - attempt to update protected Data object.");
1887    }    }
1888    Data tmp(right,getFunctionSpace(),false);    Data tmp(right,getFunctionSpace(),false);
1889    if (isLazy())    MAKELAZYBINSELF(tmp,ADD)
1890    {    binaryOp(tmp,plus<double>());
1891      DataLazy* c=new DataLazy(m_data,tmp.borrowDataPtr(),ADD);   // for lazy + is equivalent to +=    return (*this);
         m_data=c->getPtr();  
     return (*this);  
   }  
   else  
   {  
     binaryOp(tmp,plus<double>());  
     return (*this);  
   }  
1892  }  }
1893    
1894  // Hmmm, operator= makes a deep copy but the copy constructor does not?  // Hmmm, operator= makes a deep copy but the copy constructor does not?
# Line 2034  Data::operator-=(const Data& right) Line 1905  Data::operator-=(const Data& right)
1905    if (isProtected()) {    if (isProtected()) {
1906          throw DataException("Error - attempt to update protected Data object.");          throw DataException("Error - attempt to update protected Data object.");
1907    }    }
1908    if (isLazy() || right.isLazy())    MAKELAZYBINSELF(right,SUB)
1909    {    binaryOp(right,minus<double>());
1910      DataLazy* c=new DataLazy(m_data,right.borrowDataPtr(),SUB); // for lazy - is equivalent to -=    return (*this);
         m_data=c->getPtr();  
     return (*this);  
   }  
   else  
   {  
     binaryOp(right,minus<double>());  
     return (*this);  
   }  
1911  }  }
1912    
1913  Data&  Data&
# Line 2054  Data::operator-=(const boost::python::ob Line 1917  Data::operator-=(const boost::python::ob
1917          throw DataException("Error - attempt to update protected Data object.");          throw DataException("Error - attempt to update protected Data object.");
1918    }    }
1919    Data tmp(right,getFunctionSpace(),false);    Data tmp(right,getFunctionSpace(),false);
1920    if (isLazy())    MAKELAZYBINSELF(tmp,SUB)
1921    {    binaryOp(tmp,minus<double>());
1922      DataLazy* c=new DataLazy(m_data,tmp.borrowDataPtr(),SUB);   // for lazy - is equivalent to -=    return (*this);
         m_data=c->getPtr();  
     return (*this);  
   }  
   else  
   {  
     binaryOp(tmp,minus<double>());  
     return (*this);  
   }  
1923  }  }
1924    
1925  Data&  Data&
# Line 2073  Data::operator*=(const Data& right) Line 1928  Data::operator*=(const Data& right)
1928    if (isProtected()) {    if (isProtected()) {
1929          throw DataException("Error - attempt to update protected Data object.");          throw DataException("Error - attempt to update protected Data object.");
1930    }    }
1931    if (isLazy() || right.isLazy())    MAKELAZYBINSELF(right,MUL)
1932    {    binaryOp(right,multiplies<double>());
1933      DataLazy* c=new DataLazy(m_data,right.borrowDataPtr(),MUL); // for lazy * is equivalent to *=    return (*this);
         m_data=c->getPtr();  
     return (*this);  
   }  
   else  
   {  
     binaryOp(right,multiplies<double>());  
     return (*this);  
   }  
1934  }  }
1935    
1936  Data&  Data&
# Line 2093  Data::operator*=(const boost::python::ob Line 1940  Data::operator*=(const boost::python::ob
1940          throw DataException("Error - attempt to update protected Data object.");          throw DataException("Error - attempt to update protected Data object.");
1941    }    }
1942    Data tmp(right,getFunctionSpace(),false);    Data tmp(right,getFunctionSpace(),false);
1943    if (isLazy())    MAKELAZYBINSELF(tmp,MUL)
1944    {    binaryOp(tmp,multiplies<double>());
1945      DataLazy* c=new DataLazy(m_data,tmp.borrowDataPtr(),MUL);   // for lazy * is equivalent to *=    return (*this);
         m_data=c->getPtr();  
     return (*this);  
   }  
   else  
   {  
     binaryOp(tmp,multiplies<double>());  
     return (*this);  
   }  
1946  }  }
1947    
1948  Data&  Data&
# Line 2112  Data::operator/=(const Data& right) Line 1951  Data::operator/=(const Data& right)
1951    if (isProtected()) {    if (isProtected()) {
1952          throw DataException("Error - attempt to update protected Data object.");          throw DataException("Error - attempt to update protected Data object.");
1953    }    }
1954    if (isLazy() || right.isLazy())    MAKELAZYBINSELF(right,DIV)
1955    {    binaryOp(right,divides<double>());
1956      DataLazy* c=new DataLazy(m_data,right.borrowDataPtr(),DIV); // for lazy / is equivalent to /=    return (*this);
         m_data=c->getPtr();  
     return (*this);  
   }  
   else  
   {  
     binaryOp(right,divides<double>());  
     return (*this);  
   }  
1957  }  }
1958    
1959  Data&  Data&
# Line 2132  Data::operator/=(const boost::python::ob Line 1963  Data::operator/=(const boost::python::ob
1963          throw DataException("Error - attempt to update protected Data object.");          throw DataException("Error - attempt to update protected Data object.");
1964    }    }
1965    Data tmp(right,getFunctionSpace(),false);    Data tmp(right,getFunctionSpace(),false);
1966    if (isLazy())    MAKELAZYBINSELF(tmp,DIV)
1967    {    binaryOp(tmp,divides<double>());
1968      DataLazy* c=new DataLazy(m_data,tmp.borrowDataPtr(),DIV);   // for lazy / is equivalent to /=    return (*this);
         m_data=c->getPtr();  
     return (*this);  
   }  
   else  
   {  
     binaryOp(tmp,divides<double>());  
     return (*this);  
   }  
1969  }  }
1970    
1971  Data  Data
# Line 2162  Data::powO(const boost::python::object& Line 1985  Data::powO(const boost::python::object&
1985  Data  Data
1986  Data::powD(const Data& right) const  Data::powD(const Data& right) const
1987  {  {
1988    if (isLazy() || right.isLazy())    MAKELAZYBIN(right,POW)
   {  
     DataLazy* c=new DataLazy(m_data,right.borrowDataPtr(),POW);  
     return Data(c);  
   }  
1989    return C_TensorBinaryOperation<double (*)(double, double)>(*this, right, ::pow);    return C_TensorBinaryOperation<double (*)(double, double)>(*this, right, ::pow);
1990  }  }
1991    
# Line 2175  Data::powD(const Data& right) const Line 1994  Data::powD(const Data& right) const
1994  Data  Data
1995  escript::operator+(const Data& left, const Data& right)  escript::operator+(const Data& left, const Data& right)
1996  {  {
1997    if (left.isLazy() || right.isLazy())    MAKELAZYBIN2(left,right,ADD)
   {  
     DataLazy* c=new DataLazy(left.borrowDataPtr(),right.borrowDataPtr(),ADD);  
     return Data(c);  
   }  
1998    return C_TensorBinaryOperation(left, right, plus<double>());    return C_TensorBinaryOperation(left, right, plus<double>());
1999  }  }
2000    
# Line 2188  escript::operator+(const Data& left, con Line 2003  escript::operator+(const Data& left, con
2003  Data  Data
2004  escript::operator-(const Data& left, const Data& right)  escript::operator-(const Data& left, const Data& right)
2005  {  {
2006    if (left.isLazy() || right.isLazy())    MAKELAZYBIN2(left,right,SUB)
   {  
     DataLazy* c=new DataLazy(left.borrowDataPtr(),right.borrowDataPtr(),SUB);  
     return Data(c);  
   }  
2007    return C_TensorBinaryOperation(left, right, minus<double>());    return C_TensorBinaryOperation(left, right, minus<double>());
2008  }  }
2009    
# Line 2201  escript::operator-(const Data& left, con Line 2012  escript::operator-(const Data& left, con
2012  Data  Data
2013  escript::operator*(const Data& left, const Data& right)  escript::operator*(const Data& left, const Data& right)
2014  {  {
2015    if (left.isLazy() || right.isLazy())    MAKELAZYBIN2(left,right,MUL)
   {  
     DataLazy* c=new DataLazy(left.borrowDataPtr(),right.borrowDataPtr(),MUL);  
     return Data(c);  
   }  
2016    return C_TensorBinaryOperation(left, right, multiplies<double>());    return C_TensorBinaryOperation(left, right, multiplies<double>());
2017  }  }
2018    
# Line 2214  escript::operator*(const Data& left, con Line 2021  escript::operator*(const Data& left, con
2021  Data  Data
2022  escript::operator/(const Data& left, const Data& right)  escript::operator/(const Data& left, const Data& right)
2023  {  {
2024    if (left.isLazy() || right.isLazy())    MAKELAZYBIN2(left,right,DIV)
   {  
     DataLazy* c=new DataLazy(left.borrowDataPtr(),right.borrowDataPtr(),DIV);  
     return Data(c);  
   }  
2025    return C_TensorBinaryOperation(left, right, divides<double>());    return C_TensorBinaryOperation(left, right, divides<double>());
2026  }  }
2027    
# Line 2227  escript::operator/(const Data& left, con Line 2030  escript::operator/(const Data& left, con
2030  Data  Data
2031  escript::operator+(const Data& left, const boost::python::object& right)  escript::operator+(const Data& left, const boost::python::object& right)
2032  {  {
2033    if (left.isLazy())    Data tmp(right,left.getFunctionSpace(),false);
2034    {    MAKELAZYBIN2(left,tmp,ADD)
2035      DataLazy* c=new DataLazy(left.borrowDataPtr(),Data(right,left.getFunctionSpace(),false).borrowDataPtr(),ADD);    return left+tmp;
     return Data(c);  
   }  
   return left+Data(right,left.getFunctionSpace(),false);  
2036  }  }
2037    
2038  //  //
# Line 2240  escript::operator+(const Data& left, con Line 2040  escript::operator+(const Data& left, con
2040  Data  Data
2041  escript::operator-(const Data& left, const boost::python::object& right)  escript::operator-(const Data& left, const boost::python::object& right)
2042  {  {
2043    if (left.isLazy())    Data tmp(right,left.getFunctionSpace(),false);
2044    {    MAKELAZYBIN2(left,tmp,SUB)
2045      DataLazy* c=new DataLazy(left.borrowDataPtr(),Data(right,left.getFunctionSpace(),false).borrowDataPtr(),SUB);    return left-tmp;
     return Data(c);  
   }  
   return left-Data(right,left.getFunctionSpace(),false);  
2046  }  }
2047    
2048  //  //
# Line 2253  escript::operator-(const Data& left, con Line 2050  escript::operator-(const Data& left, con
2050  Data  Data
2051  escript::operator*(const Data& left, const boost::python::object& right)  escript::operator*(const Data& left, const boost::python::object& right)
2052  {  {
2053    if (left.isLazy())    Data tmp(right,left.getFunctionSpace(),false);
2054    {    MAKELAZYBIN2(left,tmp,MUL)
2055      DataLazy* c=new DataLazy(left.borrowDataPtr(),Data(right,left.getFunctionSpace(),false).borrowDataPtr(),MUL);    return left*tmp;
     return Data(c);  
   }  
   return left*Data(right,left.getFunctionSpace(),false);  
2056  }  }
2057    
2058  //  //
# Line 2266  escript::operator*(const Data& left, con Line 2060  escript::operator*(const Data& left, con
2060  Data  Data
2061  escript::operator/(const Data& left, const boost::python::object& right)  escript::operator/(const Data& left, const boost::python::object& right)
2062  {  {
2063    if (left.isLazy())    Data tmp(right,left.getFunctionSpace(),false);
2064    {    MAKELAZYBIN2(left,tmp,DIV)
2065      DataLazy* c=new DataLazy(left.borrowDataPtr(),Data(right,left.getFunctionSpace(),false).borrowDataPtr(),DIV);    return left/tmp;
     return Data(c);  
   }  
   return left/Data(right,left.getFunctionSpace(),false);  
2066  }  }
2067    
2068  //  //
# Line 2279  escript::operator/(const Data& left, con Line 2070  escript::operator/(const Data& left, con
2070  Data  Data
2071  escript::operator+(const boost::python::object& left, const Data& right)  escript::operator+(const boost::python::object& left, const Data& right)
2072  {  {
2073    if (right.isLazy())    Data tmp(left,right.getFunctionSpace(),false);
2074    {    MAKELAZYBIN2(tmp,right,ADD)
2075      DataLazy* c=new DataLazy(Data(left,right.getFunctionSpace(),false).borrowDataPtr(),right.borrowDataPtr(),ADD);    return tmp+right;
     return Data(c);  
   }  
   return Data(left,right.getFunctionSpace(),false)+right;  
2076  }  }
2077    
2078  //  //
# Line 2292  escript::operator+(const boost::python:: Line 2080  escript::operator+(const boost::python::
2080  Data  Data
2081  escript::operator-(const boost::python::object& left, const Data& right)  escript::operator-(const boost::python::object& left, const Data& right)
2082  {  {
2083    if (right.isLazy())    Data tmp(left,right.getFunctionSpace(),false);
2084    {    MAKELAZYBIN2(tmp,right,SUB)
2085      DataLazy* c=new DataLazy(Data(left,right.getFunctionSpace(),false).borrowDataPtr(),right.borrowDataPtr(),SUB);    return tmp-right;
     return Data(c);  
   }  
   return Data(left,right.getFunctionSpace(),false)-right;  
2086  }  }
2087    
2088  //  //
# Line 2305  escript::operator-(const boost::python:: Line 2090  escript::operator-(const boost::python::
2090  Data  Data
2091  escript::operator*(const boost::python::object& left, const Data& right)  escript::operator*(const boost::python::object& left, const Data& right)
2092  {  {
2093    if (right.isLazy())    Data tmp(left,right.getFunctionSpace(),false);
2094    {    MAKELAZYBIN2(tmp,right,MUL)
2095      DataLazy* c=new DataLazy(Data(left,right.getFunctionSpace(),false).borrowDataPtr(),right.borrowDataPtr(),MUL);    return tmp*right;
     return Data(c);  
   }  
   return Data(left,right.getFunctionSpace(),false)*right;  
2096  }  }
2097    
2098  //  //
# Line 2318  escript::operator*(const boost::python:: Line 2100  escript::operator*(const boost::python::
2100  Data  Data
2101  escript::operator/(const boost::python::object& left, const Data& right)  escript::operator/(const boost::python::object& left, const Data& right)
2102  {  {
2103    if (right.isLazy())    Data tmp(left,right.getFunctionSpace(),false);
2104    {    MAKELAZYBIN2(tmp,right,DIV)
2105      DataLazy* c=new DataLazy(Data(left,right.getFunctionSpace(),false).borrowDataPtr(),right.borrowDataPtr(),DIV);    return tmp/right;
     return Data(c);  
   }  
   return Data(left,right.getFunctionSpace(),false)/right;  
2106  }  }
2107    
2108    
# Line 2461  Data::setTaggedValue(int tagKey, Line 2240  Data::setTaggedValue(int tagKey,
2240    }    }
2241    
2242    DataVector temp_data2;    DataVector temp_data2;
2243    temp_data2.copyFromNumArray(asNumArray);    temp_data2.copyFromNumArray(asNumArray,1);
2244    
2245    m_data->setTaggedValue(tagKey,tempShape, temp_data2);    m_data->setTaggedValue(tagKey,tempShape, temp_data2);
2246  }  }
# Line 2512  escript::C_GeneralTensorProduct(Data& ar Line 2291  escript::C_GeneralTensorProduct(Data& ar
2291    // 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().
2292    
2293    // deal with any lazy data    // deal with any lazy data
2294    if (arg_0.isLazy()) {arg_0.resolve();}  //   if (arg_0.isLazy()) {arg_0.resolve();}
2295    if (arg_1.isLazy()) {arg_1.resolve();}  //   if (arg_1.isLazy()) {arg_1.resolve();}
2296      if (arg_0.isLazy() || arg_1.isLazy())
2297      {
2298        DataLazy* c=new DataLazy(arg_0.borrowDataPtr(), arg_1.borrowDataPtr(), PROD, axis_offset,transpose);
2299        return Data(c);
2300      }
2301    
2302    // Interpolate if necessary and find an appropriate function space    // Interpolate if necessary and find an appropriate function space
2303    Data arg_0_Z, arg_1_Z;    Data arg_0_Z, arg_1_Z;
# Line 2590  escript::C_GeneralTensorProduct(Data& ar Line 2374  escript::C_GeneralTensorProduct(Data& ar
2374       for (int i=axis_offset; i<rank1; i++, ++out_index)   { shape2[out_index]=tmpShape1[i]; } // Last part of arg_1_Z       for (int i=axis_offset; i<rank1; i++, ++out_index)   { shape2[out_index]=tmpShape1[i]; } // Last part of arg_1_Z
2375    }    }
2376    
2377      if (shape2.size()>ESCRIPT_MAX_DATA_RANK)
2378      {
2379         ostringstream os;
2380         os << "C_GeneralTensorProduct: Error - Attempt to create a rank " << shape2.size() << " object. The maximum rank is " << ESCRIPT_MAX_DATA_RANK << ".";
2381         throw DataException(os.str());
2382      }
2383    
2384    // Declare output Data object    // Declare output Data object
2385    Data res;    Data res;
2386    
# Line 2923  Data::borrowReadyPtr() const Line 2714  Data::borrowReadyPtr() const
2714  std::string  std::string
2715  Data::toString() const  Data::toString() const
2716  {  {
2717      if (!m_data->isEmpty() &&      if (!m_data->isEmpty() &&
2718      getNumDataPoints()*getDataPointSize()>escriptParams.getInt("TOO_MANY_LINES"))      !m_data->isLazy() &&
2719        getLength()>escriptParams.getInt("TOO_MANY_LINES"))
2720      {      {
2721      stringstream temp;      stringstream temp;
2722      temp << "Summary: inf="<< inf_const() << " sup=" << sup_const() << " data points=" << getNumDataPoints();      temp << "Summary: inf="<< inf_const() << " sup=" << sup_const() << " data points=" << getNumDataPoints();

Legend:
Removed from v.2049  
changed lines
  Added in v.2147

  ViewVC Help
Powered by ViewVC 1.1.26