/[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

revision 2721 by jfenwick, Fri Oct 16 05:40:12 2009 UTC revision 2734 by jfenwick, Fri Oct 30 05:39:48 2009 UTC
# Line 1135  DataLazy::resolveReduction(ValueType& v, Line 1135  DataLazy::resolveReduction(ValueType& v,
1135    const ValueType* vleft=m_left->resolveVectorSample(v,offset,sampleNo,roffset);    const ValueType* vleft=m_left->resolveVectorSample(v,offset,sampleNo,roffset);
1136    double* result=&(v[offset]);    double* result=&(v[offset]);
1137    roffset=offset;    roffset=offset;
1138      unsigned int ndpps=getNumDPPSample();
1139      unsigned int psize=DataTypes::noValues(getShape());
1140    switch (m_op)    switch (m_op)
1141    {    {
1142      case MINVAL:      case MINVAL:
1143      {      {
1144        FMin op;        for (unsigned int z=0;z<ndpps;++z)
1145        *result=DataMaths::reductionOp(*vleft, m_left->getShape(), roffset, op, numeric_limits<double>::max());        {
1146             FMin op;
1147             *result=DataMaths::reductionOp(*vleft, m_left->getShape(), roffset, op, numeric_limits<double>::max());
1148             roffset+=psize;
1149             result++;
1150          }
1151      }      }
1152      break;      break;
1153      case MAXVAL:      case MAXVAL:
1154      {      {
1155        FMax op;        for (unsigned int z=0;z<ndpps;++z)
1156        *result=DataMaths::reductionOp(*vleft, m_left->getShape(), roffset, op, numeric_limits<double>::max()*-1);        {
1157             FMax op;
1158             *result=DataMaths::reductionOp(*vleft, m_left->getShape(), roffset, op, numeric_limits<double>::max()*-1);
1159             roffset+=psize;
1160             result++;
1161          }
1162      }      }
1163      break;      break;
1164      default:      default:
# Line 1839  DataLazy::resolveNodeReduction(int tid, Line 1851  DataLazy::resolveNodeReduction(int tid,
1851    const DataTypes::ValueType* leftres=m_left->resolveNodeSample(tid, sampleNo, loffset);    const DataTypes::ValueType* leftres=m_left->resolveNodeSample(tid, sampleNo, loffset);
1852    
1853    roffset=m_samplesize*tid;    roffset=m_samplesize*tid;
1854      unsigned int ndpps=getNumDPPSample();
1855      unsigned int psize=DataTypes::noValues(getShape());
1856    double* result=&(m_samples[roffset]);    double* result=&(m_samples[roffset]);
1857    switch (m_op)    switch (m_op)
1858    {    {
1859      case MINVAL:      case MINVAL:
1860      {      {
1861        FMin op;        for (unsigned int z=0;z<ndpps;++z)
1862        *result=DataMaths::reductionOp(*leftres, m_left->getShape(), loffset, op, numeric_limits<double>::max());        {
1863            FMin op;
1864            *result=DataMaths::reductionOp(*leftres, m_left->getShape(), loffset, op, numeric_limits<double>::max());
1865            loffset+=psize;
1866            result++;
1867          }
1868      }      }
1869      break;      break;
1870      case MAXVAL:      case MAXVAL:
1871      {      {
1872          for (unsigned int z=0;z<ndpps;++z)
1873          {
1874        FMax op;        FMax op;
1875        *result=DataMaths::reductionOp(*leftres, m_left->getShape(), loffset, op, numeric_limits<double>::max()*-1);        *result=DataMaths::reductionOp(*leftres, m_left->getShape(), loffset, op, numeric_limits<double>::max()*-1);
1876          loffset+=psize;
1877          result++;
1878          }
1879      }      }
1880      break;      break;
1881      default:      default:

Legend:
Removed from v.2721  
changed lines
  Added in v.2734

  ViewVC Help
Powered by ViewVC 1.1.26