/[escript]/trunk/escript/src/DataAlgorithm.h
ViewVC logotype

Diff of /trunk/escript/src/DataAlgorithm.h

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

revision 113 by jgs, Mon Feb 28 07:06:33 2005 UTC revision 121 by jgs, Fri May 6 04:26:16 2005 UTC
# Line 110  struct AbsMax : public std::binary_funct Line 110  struct AbsMax : public std::binary_funct
110    
111  /**  /**
112     \brief     \brief
113       Return the absolute minimum value of the two given values.
114    */
115    struct AbsMin : public std::binary_function<double,double,double>
116    {
117      inline double operator()(double x, double y) const
118      {
119        return std::min(fabs(x),fabs(y));
120      }
121    };
122    
123    /**
124       \brief
125     Return the length between the two given values.     Return the length between the two given values.
126  */  */
127  struct Length : public std::binary_function<double,double,double>  struct Length : public std::binary_function<double,double,double>
# Line 228  dp_algorithm(DataExpanded& data, Line 240  dp_algorithm(DataExpanded& data,
240               UnaryFunction operation)               UnaryFunction operation)
241  {  {
242    int i,j;    int i,j;
   int numDPPSample=data.getNumDPPSample();  
243    int numSamples=data.getNumSamples();    int numSamples=data.getNumSamples();
244      int numDPPSample=data.getNumDPPSample();
245    DataArrayView dataView=data.getPointDataView();    DataArrayView dataView=data.getPointDataView();
246    DataArrayView resultView=result.getPointDataView();    DataArrayView resultView=result.getPointDataView();
247    // perform the operation on each data-point and assign    // perform the operation on each data-point and assign
# Line 239  dp_algorithm(DataExpanded& data, Line 251  dp_algorithm(DataExpanded& data,
251      for (i=0;i<numSamples;i++) {      for (i=0;i<numSamples;i++) {
252        for (j=0;j<numDPPSample;j++) {        for (j=0;j<numDPPSample;j++) {
253  #pragma omp critical (reductionOp)  #pragma omp critical (reductionOp)
254          resultView.getData(data.getPointOffset(i,j)) =          resultView.getData(result.getPointOffset(i,j)) =
255            dataView.reductionOp(data.getPointOffset(i,j),operation);            dataView.reductionOp(data.getPointOffset(i,j),operation);
256        }        }
257      }      }

Legend:
Removed from v.113  
changed lines
  Added in v.121

  ViewVC Help
Powered by ViewVC 1.1.26