/[escript]/branches/clazy/escriptcore/src/DataLazy.cpp
ViewVC logotype

Diff of /branches/clazy/escriptcore/src/DataLazy.cpp

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

trunk/escriptcore/src/DataLazy.cpp revision 6083 by jfenwick, Tue Mar 22 03:30:18 2016 UTC branches/clazy/escriptcore/src/DataLazy.cpp revision 6512 by jfenwick, Fri Mar 3 02:01:57 2017 UTC
# Line 5  Line 5 
5  * http://www.uq.edu.au  * http://www.uq.edu.au
6  *  *
7  * Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
8  * Licensed under the Open Software License version 3.0  * Licensed under the Apache License, version 2.0
9  * http://www.opensource.org/licenses/osl-3.0.php  * http://www.apache.org/licenses/LICENSE-2.0
10  *  *
11  * Development until 2012 by Earth Systems Science Computational Center (ESSCC)  * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12  * Development 2012-2013 by School of Earth Sciences  * Development 2012-2013 by School of Earth Sciences
# Line 20  Line 20 
20  #include "EscriptParams.h"  #include "EscriptParams.h"
21  #include "FunctionSpace.h"  #include "FunctionSpace.h"
22  #include "Utils.h"  #include "Utils.h"
23  #include "DataMaths.h"  #include "DataVectorOps.h"
   
 #ifdef USE_NETCDF  
 #include <netcdfcpp.h>  
 #endif  
24    
25  #include <iomanip> // for some fancy formatting in debug  #include <iomanip> // for some fancy formatting in debug
26    
# Line 42  bool privdebug=false; Line 38  bool privdebug=false;
38  #define DISABLEDEBUG privdebug=false;  #define DISABLEDEBUG privdebug=false;
39  }  }
40    
41  // #define SIZELIMIT if ((m_height>escript::escriptParams.getTOO_MANY_LEVELS()) || (m_children>escript::escriptParams.getTOO_MANY_NODES())) {cerr << "\n!!!!!!! SIZE LIMIT EXCEEDED " << m_children << ";" << m_height << endl << toString() << endl;resolveToIdentity();}  //#define SIZELIMIT if ((m_height>escript::escriptParams.getInt("TOO_MANY_LEVELS")) || (m_children>escript::escriptParams.getInt("TOO_MANY_NODES"))) {cerr << "\n!!!!!!! SIZE LIMIT EXCEEDED " << m_children << ";" << m_height << endl << toString() << endl;resolveToIdentity();}
42    
43  // #define SIZELIMIT if ((m_height>escript::escriptParams.getTOO_MANY_LEVELS()) || (m_children>escript::escriptParams.getTOO_MANY_NODES())) {cerr << "SIZE LIMIT EXCEEDED " << m_height << endl;resolveToIdentity();}  //#define SIZELIMIT if ((m_height>escript::escriptParams.getInt("TOO_MANY_LEVELS")) || (m_children>escript::escriptParams.getInt("TOO_MANY_NODES"))) {cerr << "SIZE LIMIT EXCEEDED " << m_height << endl;resolveToIdentity();}
44    
45    
46  #define SIZELIMIT if (m_height>escript::escriptParams.getTOO_MANY_LEVELS())  {if (escript::escriptParams.getLAZY_VERBOSE()){cerr << "SIZE LIMIT EXCEEDED height=" << m_height << endl;}resolveToIdentity();}  #define SIZELIMIT \
47        if (m_height > escript::escriptParams.getTooManyLevels()) {\
48            if (escript::escriptParams.getLazyVerbose()) {\
49                cerr << "SIZE LIMIT EXCEEDED height=" << m_height << endl;\
50            }\
51            resolveToIdentity();\
52        }
53    
54  /*  /*
55  How does DataLazy work?  How does DataLazy work?
# Line 131  std::vector<void*> stackend(getNumberOfT Line 133  std::vector<void*> stackend(getNumberOfT
133  size_t maxstackuse=0;  size_t maxstackuse=0;
134  #endif  #endif
135    
 enum ES_opgroup  
 {  
    G_UNKNOWN,  
    G_IDENTITY,  
    G_BINARY,            // pointwise operations with two arguments  
    G_UNARY,             // pointwise operations with one argument  
    G_UNARY_P,           // pointwise operations with one argument, requiring a parameter  
    G_NP1OUT,            // non-pointwise op with one output  
    G_NP1OUT_P,          // non-pointwise op with one output requiring a parameter  
    G_TENSORPROD,        // general tensor product  
    G_NP1OUT_2P,         // non-pointwise op with one output requiring two params  
    G_REDUCTION,         // non-pointwise unary op with a scalar output  
    G_CONDEVAL  
 };  
   
   
   
   
 string ES_opstrings[]={"UNKNOWN","IDENTITY","+","-","*","/","^",  
                         "sin","cos","tan",  
                         "asin","acos","atan","sinh","cosh","tanh","erf",  
                         "asinh","acosh","atanh",  
                         "log10","log","sign","abs","neg","pos","exp","sqrt",  
                         "1/","where>0","where<0","where>=0","where<=0", "where<>0","where=0",  
                         "symmetric","nonsymmetric",  
                         "prod",  
                         "transpose", "trace",  
                         "swapaxes",  
                         "minval", "maxval",  
                         "condEval"};  
 int ES_opcount=44;  
 ES_opgroup opgroups[]={G_UNKNOWN,G_IDENTITY,G_BINARY,G_BINARY,G_BINARY,G_BINARY, G_BINARY,  
                         G_UNARY,G_UNARY,G_UNARY, //10  
                         G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,        // 17  
                         G_UNARY,G_UNARY,G_UNARY,                                        // 20  
                         G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY,        // 28  
                         G_UNARY,G_UNARY,G_UNARY,G_UNARY,G_UNARY, G_UNARY_P, G_UNARY_P,          // 35  
                         G_NP1OUT,G_NP1OUT,  
                         G_TENSORPROD,  
                         G_NP1OUT_P, G_NP1OUT_P,  
                         G_NP1OUT_2P,  
                         G_REDUCTION, G_REDUCTION,  
                         G_CONDEVAL};  
 inline  
 ES_opgroup  
 getOpgroup(ES_optype op)  
 {  
   return opgroups[op];  
 }  
136    
137  // return the FunctionSpace of the result of "left op right"  // return the FunctionSpace of the result of "left op right"
138  FunctionSpace  FunctionSpace
# Line 432  GTPShape(DataAbstract_ptr left, DataAbst Line 385  GTPShape(DataAbstract_ptr left, DataAbst
385    
386  }       // end anonymous namespace  }       // end anonymous namespace
387    
   
   
 // Return a string representing the operation  
 const std::string&  
 opToString(ES_optype op)  
 {  
   if (op<0 || op>=ES_opcount)  
   {  
     op=UNKNOWNOP;  
   }  
   return ES_opstrings[op];  
 }  
   
388  void DataLazy::LazyNodeSetup()  void DataLazy::LazyNodeSetup()
389  {  {
390  #ifdef _OPENMP  #ifdef _OPENMP
391      int numthreads=omp_get_max_threads();      int numthreads=omp_get_max_threads();
392      m_samples.resize(numthreads*m_samplesize);      m_samples_r.resize(numthreads*m_samplesize);
393      m_sampleids=new int[numthreads];      m_sampleids=new int[numthreads];
394      for (int i=0;i<numthreads;++i)      for (int i=0;i<numthreads;++i)
395      {      {
396          m_sampleids[i]=-1;            m_sampleids[i]=-1;  
397      }      }
398  #else  #else
399      m_samples.resize(m_samplesize);      if (m_iscompl)
400        {
401            m_samples_c.resize(m_samplesize);
402        }
403        else
404        {
405            m_samples_r.resize(m_samplesize);
406        }
407      m_sampleids=new int[1];      m_sampleids=new int[1];
408      m_sampleids[0]=-1;      m_sampleids[0]=-1;
409  #endif  // _OPENMP  #endif  // _OPENMP
# Line 467  void DataLazy::LazyNodeSetup() Line 414  void DataLazy::LazyNodeSetup()
414  DataLazy::DataLazy(DataAbstract_ptr p)  DataLazy::DataLazy(DataAbstract_ptr p)
415          : parent(p->getFunctionSpace(),p->getShape())          : parent(p->getFunctionSpace(),p->getShape())
416          ,m_sampleids(0),          ,m_sampleids(0),
417          m_samples(1)          m_samples_r(1)
418  {  {
419     if (p->isLazy())     if (p->isLazy())
420     {     {
# Line 478  DataLazy::DataLazy(DataAbstract_ptr p) Line 425  DataLazy::DataLazy(DataAbstract_ptr p)
425     }     }
426     else     else
427     {     {
         p->makeLazyShared();  
428          DataReady_ptr dr=dynamic_pointer_cast<DataReady>(p);          DataReady_ptr dr=dynamic_pointer_cast<DataReady>(p);
429          makeIdentity(dr);          makeIdentity(dr);
430  LAZYDEBUG(cout << "Wrapping " << dr.get() << " id=" << m_id.get() << endl;)  LAZYDEBUG(cout << "Wrapping " << dr.get() << " id=" << m_id.get() << endl;)
# Line 943  DataLazy::collapseToReady() const Line 889  DataLazy::collapseToReady() const
889          result=left.symmetric();          result=left.symmetric();
890          break;          break;
891      case NSYM:      case NSYM:
892          result=left.nonsymmetric();          result=left.antisymmetric();
893          break;          break;
894      case PROD:      case PROD:
895          result=C_GeneralTensorProduct(left,right,m_axis_offset, m_transpose);          result=C_GeneralTensorProduct(left,right,m_axis_offset, m_transpose);
# Line 963  DataLazy::collapseToReady() const Line 909  DataLazy::collapseToReady() const
909      case MAXVAL:      case MAXVAL:
910          result=left.minval();          result=left.minval();
911          break;          break;
912        case HER:
913        result=left.hermitian();
914        break;
915      default:      default:
916          throw DataException("Programmer error - collapseToReady does not know how to resolve operator "+opToString(m_op)+".");          throw DataException("Programmer error - collapseToReady does not know how to resolve operator "+opToString(m_op)+".");
917    }    }
# Line 1021  if (&x<stackend[omp_get_thread_num()]) Line 970  if (&x<stackend[omp_get_thread_num()])
970    if (m_sampleids[tid]==sampleNo)    if (m_sampleids[tid]==sampleNo)
971    {    {
972          roffset=tid*m_samplesize;          roffset=tid*m_samplesize;
973          return &(m_samples);            // sample is already resolved          return &(m_samples_r);            // sample is already resolved
974    }    }
975    m_sampleids[tid]=sampleNo;    m_sampleids[tid]=sampleNo;
976    
# Line 1059  DataLazy::resolveNodeUnary(int tid, int Line 1008  DataLazy::resolveNodeUnary(int tid, int
1008    const DataTypes::RealVectorType* leftres=m_left->resolveNodeSample(tid, sampleNo, roffset);    const DataTypes::RealVectorType* leftres=m_left->resolveNodeSample(tid, sampleNo, roffset);
1009    const double* left=&((*leftres)[roffset]);    const double* left=&((*leftres)[roffset]);
1010    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
1011    double* result=&(m_samples[roffset]);    double* result=&(m_samples_r[roffset]);
1012    escript::ESFunction operation=SINF;    if (m_op==POS)
   switch (m_op)  
1013    {    {
1014      case SIN:      // this should be prevented earlier
1015      operation=SINF;      // operation is meaningless for lazy
1016      break;          throw DataException("Programmer error - POS not supported for lazy data.");    
     case COS:  
         operation=COSF;  
     break;  
     case TAN:  
         operation=TANF;  
     break;  
     case ASIN:  
         operation=ASINF;  
     break;  
     case ACOS:  
         operation=ACOSF;  
     break;  
     case ATAN:  
         operation=ATANF;  
     break;  
     case SINH:  
         operation=SINHF;  
     break;  
     case COSH:  
         operation=COSHF;  
     break;  
     case TANH:  
         operation=TANHF;  
     break;  
     case ERF:  
         operation=ERFF;  
     break;  
    case ASINH:  
         operation=ASINHF;  
     break;  
    case ACOSH:  
         operation=ACOSHF;  
     break;  
    case ATANH:  
         operation=ATANHF;  
     break;  
     case LOG10:  
         operation=LOG10F;  
     break;  
     case LOG:  
         operation=LOGF;  
     break;  
     case SIGN:  
         operation=SIGNF;  
     break;  
     case ABS:  
         operation=ABSF;  
     break;  
     case NEG:  
         operation=NEGF;  
     break;  
     case POS:  
         // it doesn't mean anything for delayed.  
         // it will just trigger a deep copy of the lazy object  
         throw DataException("Programmer error - POS not supported for lazy data.");  
         break;  
     case EXP:  
         operation=EXPF;  
     break;  
     case SQRT:  
         operation=SQRTF;  
     break;  
     case RECIP:  
         operation=INVF;  
     break;  
     case GZ:  
         operation=GTZEROF;  
     break;  
     case LZ:  
         operation=LTZEROF;  
     break;  
     case GEZ:  
         operation=GEZEROF;  
     break;  
     case LEZ:  
         operation=LEZEROF;  
     break;  
 // There are actually G_UNARY_P but I don't see a compelling reason to treat them differently  
     case NEZ:  
         operation=NEQZEROF;  
     break;  
     case EZ:  
         operation=EQZEROF;  
     break;  
     default:  
         throw DataException("Programmer error - resolveUnary can not resolve operator "+opToString(m_op)+".");  
1017    }    }
1018    tensor_unary_array_operation(m_samplesize,    tensor_unary_array_operation(m_samplesize,
1019                               left,                               left,
1020                               result,                               result,
1021                               operation,                               m_op,
1022                               m_tol);                                 m_tol);  
1023    return &(m_samples);    return &(m_samples_r);
1024  }  }
1025    
1026    
# Line 1183  DataLazy::resolveNodeReduction(int tid, Line 1045  DataLazy::resolveNodeReduction(int tid,
1045    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
1046    unsigned int ndpps=getNumDPPSample();    unsigned int ndpps=getNumDPPSample();
1047    unsigned int psize=DataTypes::noValues(m_left->getShape());    unsigned int psize=DataTypes::noValues(m_left->getShape());
1048    double* result=&(m_samples[roffset]);    double* result=&(m_samples_r[roffset]);
1049    switch (m_op)    switch (m_op)
1050    {    {
1051      case MINVAL:      case MINVAL:
# Line 1211  DataLazy::resolveNodeReduction(int tid, Line 1073  DataLazy::resolveNodeReduction(int tid,
1073      default:      default:
1074          throw DataException("Programmer error - resolveUnary can not resolve operator "+opToString(m_op)+".");          throw DataException("Programmer error - resolveUnary can not resolve operator "+opToString(m_op)+".");
1075    }    }
1076    return &(m_samples);    return &(m_samples_r);
1077  }  }
1078    
1079  const DataTypes::RealVectorType*  const DataTypes::RealVectorType*
# Line 1240  DataLazy::resolveNodeNP1OUT(int tid, int Line 1102  DataLazy::resolveNodeNP1OUT(int tid, int
1102      case SYM:      case SYM:
1103          for (loop=0;loop<numsteps;++loop)          for (loop=0;loop<numsteps;++loop)
1104          {          {
1105              escript::symmetric(*leftres,m_left->getShape(),subroffset, m_samples, getShape(), offset);              escript::symmetric(*leftres,m_left->getShape(),subroffset, m_samples_r, getShape(), offset);
1106              subroffset+=step;              subroffset+=step;
1107              offset+=step;              offset+=step;
1108          }          }
# Line 1248  DataLazy::resolveNodeNP1OUT(int tid, int Line 1110  DataLazy::resolveNodeNP1OUT(int tid, int
1110      case NSYM:      case NSYM:
1111          for (loop=0;loop<numsteps;++loop)          for (loop=0;loop<numsteps;++loop)
1112          {          {
1113              escript::nonsymmetric(*leftres,m_left->getShape(),subroffset, m_samples, getShape(), offset);              escript::antisymmetric(*leftres,m_left->getShape(),subroffset, m_samples_r, getShape(), offset);
1114              subroffset+=step;              subroffset+=step;
1115              offset+=step;              offset+=step;
1116          }          }
# Line 1256  DataLazy::resolveNodeNP1OUT(int tid, int Line 1118  DataLazy::resolveNodeNP1OUT(int tid, int
1118      default:      default:
1119          throw DataException("Programmer error - resolveNP1OUT can not resolve operator "+opToString(m_op)+".");          throw DataException("Programmer error - resolveNP1OUT can not resolve operator "+opToString(m_op)+".");
1120    }    }
1121    return &m_samples;    return &m_samples_r;
1122  }  }
1123    
1124  const DataTypes::RealVectorType*  const DataTypes::RealVectorType*
# Line 1287  DataLazy::resolveNodeNP1OUT_P(int tid, i Line 1149  DataLazy::resolveNodeNP1OUT_P(int tid, i
1149      case TRACE:      case TRACE:
1150          for (loop=0;loop<numsteps;++loop)          for (loop=0;loop<numsteps;++loop)
1151          {          {
1152              escript::trace(*leftres,m_left->getShape(),subroffset, m_samples ,getShape(),offset,m_axis_offset);              escript::trace(*leftres,m_left->getShape(),subroffset, m_samples_r ,getShape(),offset,m_axis_offset);
1153              subroffset+=instep;              subroffset+=instep;
1154              offset+=outstep;              offset+=outstep;
1155          }          }
# Line 1295  DataLazy::resolveNodeNP1OUT_P(int tid, i Line 1157  DataLazy::resolveNodeNP1OUT_P(int tid, i
1157      case TRANS:      case TRANS:
1158          for (loop=0;loop<numsteps;++loop)          for (loop=0;loop<numsteps;++loop)
1159          {          {
1160              escript::transpose(*leftres,m_left->getShape(),subroffset, m_samples, getShape(),offset,m_axis_offset);              escript::transpose(*leftres,m_left->getShape(),subroffset, m_samples_r, getShape(),offset,m_axis_offset);
1161              subroffset+=instep;              subroffset+=instep;
1162              offset+=outstep;              offset+=outstep;
1163          }          }
# Line 1303  DataLazy::resolveNodeNP1OUT_P(int tid, i Line 1165  DataLazy::resolveNodeNP1OUT_P(int tid, i
1165      default:      default:
1166          throw DataException("Programmer error - resolveNP1OUTP can not resolve operator "+opToString(m_op)+".");          throw DataException("Programmer error - resolveNP1OUTP can not resolve operator "+opToString(m_op)+".");
1167    }    }
1168    return &m_samples;    return &m_samples_r;
1169  }  }
1170    
1171    
# Line 1332  DataLazy::resolveNodeNP1OUT_2P(int tid, Line 1194  DataLazy::resolveNodeNP1OUT_2P(int tid,
1194      case SWAP:      case SWAP:
1195          for (loop=0;loop<numsteps;++loop)          for (loop=0;loop<numsteps;++loop)
1196          {          {
1197              escript::swapaxes(*leftres,m_left->getShape(),subroffset, m_samples, getShape(),offset, m_axis_offset, m_transpose);              escript::swapaxes(*leftres,m_left->getShape(),subroffset, m_samples_r, getShape(),offset, m_axis_offset, m_transpose);
1198              subroffset+=instep;              subroffset+=instep;
1199              offset+=outstep;              offset+=outstep;
1200          }          }
# Line 1340  DataLazy::resolveNodeNP1OUT_2P(int tid, Line 1202  DataLazy::resolveNodeNP1OUT_2P(int tid,
1202      default:      default:
1203          throw DataException("Programmer error - resolveNodeNP1OUT2P can not resolve operator "+opToString(m_op)+".");          throw DataException("Programmer error - resolveNodeNP1OUT2P can not resolve operator "+opToString(m_op)+".");
1204    }    }
1205    return &m_samples;    return &m_samples_r;
1206  }  }
1207    
1208  const DataTypes::RealVectorType*  const DataTypes::RealVectorType*
# Line 1372  DataLazy::resolveNodeCondEval(int tid, i Line 1234  DataLazy::resolveNodeCondEval(int tid, i
1234    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
1235    for (int i=0;i<m_samplesize;++i)    for (int i=0;i<m_samplesize;++i)
1236    {    {
1237          m_samples[roffset+i]=(*srcres)[subroffset+i];            m_samples_r[roffset+i]=(*srcres)[subroffset+i];  
1238    }    }
1239    
1240    return &m_samples;    return &m_samples_r;
1241  }  }
1242    
1243  // This method assumes that any subexpressions which evaluate to Constant or Tagged Data  // This method assumes that any subexpressions which evaluate to Constant or Tagged Data
# Line 1515  LAZYDEBUG(cout << "Right res["<< rroffse Line 1377  LAZYDEBUG(cout << "Right res["<< rroffse
1377    
1378    
1379    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
1380    double* resultp=&(m_samples[roffset]);                // results are stored at the vector offset we received    double* resultp=&(m_samples_r[roffset]);                // results are stored at the vector offset we received
1381    switch(m_op)    switch(m_op)
1382    {    {
1383      case ADD:      case ADD:
# Line 1533  LAZYDEBUG(cout << "Right res["<< rroffse Line 1395  LAZYDEBUG(cout << "Right res["<< rroffse
1395               orightstep,               orightstep,
1396               lroffset,               lroffset,
1397               rroffset,               rroffset,
1398               escript::ESFunction::PLUSF);                 escript::ES_optype::ADD);  
1399          break;          break;
1400      case SUB:      case SUB:
1401        escript::binaryOpVectorLazyHelper<real_t, real_t, real_t>(resultp,        escript::binaryOpVectorLazyHelper<real_t, real_t, real_t>(resultp,
# Line 1549  LAZYDEBUG(cout << "Right res["<< rroffse Line 1411  LAZYDEBUG(cout << "Right res["<< rroffse
1411               orightstep,               orightstep,
1412               lroffset,               lroffset,
1413               rroffset,               rroffset,
1414               escript::ESFunction::MINUSF);                       escript::ES_optype::SUB);        
1415          //PROC_OP(NO_ARG,minus<double>());          //PROC_OP(NO_ARG,minus<double>());
1416          break;          break;
1417      case MUL:      case MUL:
# Line 1567  LAZYDEBUG(cout << "Right res["<< rroffse Line 1429  LAZYDEBUG(cout << "Right res["<< rroffse
1429               orightstep,               orightstep,
1430               lroffset,               lroffset,
1431               rroffset,               rroffset,
1432               escript::ESFunction::MULTIPLIESF);                     escript::ES_optype::MUL);        
1433          break;          break;
1434      case DIV:      case DIV:
1435          //PROC_OP(NO_ARG,divides<double>());          //PROC_OP(NO_ARG,divides<double>());
# Line 1584  LAZYDEBUG(cout << "Right res["<< rroffse Line 1446  LAZYDEBUG(cout << "Right res["<< rroffse
1446               orightstep,               orightstep,
1447               lroffset,               lroffset,
1448               rroffset,               rroffset,
1449               escript::ESFunction::DIVIDESF);                         escript::ES_optype::DIV);        
1450          break;          break;
1451      case POW:      case POW:
1452         //PROC_OP(double (double,double),::pow);         //PROC_OP(double (double,double),::pow);
# Line 1601  LAZYDEBUG(cout << "Right res["<< rroffse Line 1463  LAZYDEBUG(cout << "Right res["<< rroffse
1463               orightstep,               orightstep,
1464               lroffset,               lroffset,
1465               rroffset,               rroffset,
1466               escript::ESFunction::POWF);                         escript::ES_optype::POW);        
1467          break;          break;
1468      default:      default:
1469          throw DataException("Programmer error - resolveBinary can not resolve operator "+opToString(m_op)+".");          throw DataException("Programmer error - resolveBinary can not resolve operator "+opToString(m_op)+".");
1470    }    }
1471  LAZYDEBUG(cout << "Result res[" << roffset<< "]" << m_samples[roffset] << endl;)  LAZYDEBUG(cout << "Result res[" << roffset<< "]" << m_samples_r[roffset] << endl;)
1472    return &m_samples;    return &m_samples_r;
1473  }  }
1474    
1475    
# Line 1647  LAZYDEBUG(cout << "m_samplesize=" << m_s Line 1509  LAZYDEBUG(cout << "m_samplesize=" << m_s
1509  LAZYDEBUG(cout << "outputshape=" << DataTypes::shapeToString(getShape()) << endl;)  LAZYDEBUG(cout << "outputshape=" << DataTypes::shapeToString(getShape()) << endl;)
1510  LAZYDEBUG(cout << "DPPS=" << m_right->getNumDPPSample() <<"."<<endl;)  LAZYDEBUG(cout << "DPPS=" << m_right->getNumDPPSample() <<"."<<endl;)
1511    
1512    double* resultp=&(m_samples[offset]);         // results are stored at the vector offset we received    double* resultp=&(m_samples_r[offset]);         // results are stored at the vector offset we received
1513    switch(m_op)    switch(m_op)
1514    {    {
1515      case PROD:      case PROD:
# Line 1669  LAZYDEBUG(cout << DataTypes::pointToStri Line 1531  LAZYDEBUG(cout << DataTypes::pointToStri
1531          throw DataException("Programmer error - resolveTProduct can not resolve operator "+opToString(m_op)+".");          throw DataException("Programmer error - resolveTProduct can not resolve operator "+opToString(m_op)+".");
1532    }    }
1533    roffset=offset;    roffset=offset;
1534    return &m_samples;    return &m_samples_r;
1535  }  }
1536    
1537    
# Line 1725  void DataLazy::makeIdentity(const DataRe Line 1587  void DataLazy::makeIdentity(const DataRe
1587     m_samplesize=p->getNumDPPSample()*p->getNoValues();     m_samplesize=p->getNumDPPSample()*p->getNoValues();
1588     m_left.reset();     m_left.reset();
1589     m_right.reset();     m_right.reset();
1590       m_iscompl=p->isComplex();
1591  }  }
1592    
1593    
# Line 1879  DataLazy::toString() const Line 1742  DataLazy::toString() const
1742  {  {
1743    ostringstream oss;    ostringstream oss;
1744    oss << "Lazy Data: [depth=" << m_height<< "] ";    oss << "Lazy Data: [depth=" << m_height<< "] ";
1745    switch (escriptParams.getLAZY_STR_FMT())    switch (escriptParams.getLazyStrFmt())
1746    {    {
1747    case 1:       // tree format    case 1:       // tree format
1748          oss << endl;          oss << endl;
# Line 2040  DataLazy::deepCopy() const Line 1903  DataLazy::deepCopy() const
1903    }    }
1904  }  }
1905    
1906    // For this, we don't care what op you were doing because the answer is now zero
1907    DataAbstract*
1908    DataLazy::zeroedCopy() const
1909    {
1910      return new DataLazy(m_id->zeroedCopy()->getPtr());
1911    }
1912    
1913  // There is no single, natural interpretation of getLength on DataLazy.  // There is no single, natural interpretation of getLength on DataLazy.
1914  // Instances of DataReady can look at the size of their vectors.  // Instances of DataReady can look at the size of their vectors.

Legend:
Removed from v.6083  
changed lines
  Added in v.6512

  ViewVC Help
Powered by ViewVC 1.1.26