/[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 2724 by jfenwick, Sun Oct 18 23:50:18 2009 UTC revision 2735 by jfenwick, Mon Nov 2 02:03:24 2009 UTC
# Line 1731  Data::infWorker() const Line 1731  Data::infWorker() const
1731  #endif  #endif
1732  }  }
1733    
 /* TODO */  
1734  /* global reduction */  /* global reduction */
1735  Data  
1736  Data::maxval() const  
1737    inline Data
1738    Data::minval_nonlazy() const
1739    {
1740      //
1741      // set the initial minimum value to max possible double
1742      FMin fmin_func;
1743      return dp_algorithm(fmin_func,numeric_limits<double>::max());
1744    }
1745    
1746    
1747    inline Data
1748    Data::maxval_nonlazy() const
1749  {  {
    MAKELAZYOP(MAXVAL)  
1750    //    //
1751    // set the initial maximum value to min possible double    // set the initial maximum value to min possible double
1752    FMax fmax_func;    FMax fmax_func;
1753    return dp_algorithm(fmax_func,numeric_limits<double>::max()*-1);    return dp_algorithm(fmax_func,numeric_limits<double>::max()*-1);
1754  }  }
1755    
1756    
1757    
1758    Data
1759    Data::maxval() const
1760    {
1761       MAKELAZYOP(MAXVAL)
1762       return maxval_nonlazy();
1763    }
1764    
1765    
1766  Data  Data
1767  Data::minval() const  Data::minval() const
1768  {  {
1769    MAKELAZYOP(MINVAL)    MAKELAZYOP(MINVAL)
1770    //    return minval_nonlazy();
   // set the initial minimum value to max possible double  
   FMin fmin_func;  
   return dp_algorithm(fmin_func,numeric_limits<double>::max());  
1771  }  }
1772    
1773    
1774  Data  Data
1775  Data::swapaxes(const int axis0, const int axis1) const  Data::swapaxes(const int axis0, const int axis1) const
1776  {  {
# Line 2017  Data::calc_minGlobalDataPoint(int& ProcN Line 2035  Data::calc_minGlobalDataPoint(int& ProcN
2035    int lowi=0,lowj=0;    int lowi=0,lowj=0;
2036    double min=numeric_limits<double>::max();    double min=numeric_limits<double>::max();
2037    
2038    Data temp=minval();    Data temp=minval_nonlazy();   // need to do this to prevent autolazy from reintroducing laziness
2039    
2040    int numSamples=temp.getNumSamples();    int numSamples=temp.getNumSamples();
2041    int numDPPSample=temp.getNumDataPointsPerSample();    int numDPPSample=temp.getNumDataPointsPerSample();
# Line 2099  Data::calc_maxGlobalDataPoint(int& ProcN Line 2117  Data::calc_maxGlobalDataPoint(int& ProcN
2117  //-------------  //-------------
2118    double max= -numeric_limits<double>::max();    double max= -numeric_limits<double>::max();
2119    
2120    Data temp=maxval();    Data temp=maxval_nonlazy();   // need to do this to prevent autolazy from reintroducing laziness
2121    
2122    int numSamples=temp.getNumSamples();    int numSamples=temp.getNumSamples();
2123    int numDPPSample=temp.getNumDataPointsPerSample();    int numDPPSample=temp.getNumDataPointsPerSample();

Legend:
Removed from v.2724  
changed lines
  Added in v.2735

  ViewVC Help
Powered by ViewVC 1.1.26