/[escript]/branches/escript3047_with_pastix2995/escript/test/DataAlgorithmAdapterTestCase.cpp
ViewVC logotype

Diff of /branches/escript3047_with_pastix2995/escript/test/DataAlgorithmAdapterTestCase.cpp

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

revision 113 by jgs, Mon Feb 28 07:06:33 2005 UTC revision 147 by jgs, Fri Aug 12 01:45:47 2005 UTC
# Line 169  void DataAlgorithmAdapterTestCase::testA Line 169  void DataAlgorithmAdapterTestCase::testA
169      DataTagged   dataTag(dataCon);      DataTagged   dataTag(dataCon);
170    
171      // test algorithm on DataExpanded      // test algorithm on DataExpanded
172      assert(escript::algorithm(dataExp,DataAlgorithmAdapter<FMin>(numeric_limits<double>::max()))==0);      FMin fmin_func;
173      assert(escript::algorithm(dataExp,DataAlgorithmAdapter<FMax>(numeric_limits<double>::max()*-1))==5);      assert(escript::algorithm(dataExp,fmin_func,numeric_limits<double>::max())==0);
174        FMax fmax_func;
175        assert(escript::algorithm(dataExp,fmax_func,numeric_limits<double>::max()*-1)==5);
176    
177      // test algorithm on DataTagged      // test algorithm on DataTagged
178      assert(escript::algorithm(dataTag,DataAlgorithmAdapter<FMin>(numeric_limits<double>::max()))==0);      assert(escript::algorithm(dataTag,fmin_func,numeric_limits<double>::max())==0);
179      assert(escript::algorithm(dataTag,DataAlgorithmAdapter<FMax>(numeric_limits<double>::max()*-1))==5);      assert(escript::algorithm(dataTag,fmax_func,numeric_limits<double>::max()*-1)==5);
180    
181      // test algorithm on DataConstant      // test algorithm on DataConstant
182      assert(escript::algorithm(dataCon,DataAlgorithmAdapter<FMin>(numeric_limits<double>::max()))==0);      assert(escript::algorithm(dataCon,fmin_func,numeric_limits<double>::max())==0);
183      assert(escript::algorithm(dataCon,DataAlgorithmAdapter<FMax>(numeric_limits<double>::max()*-1))==5);      assert(escript::algorithm(dataCon,fmax_func,numeric_limits<double>::max()*-1)==5);
184    
185    }    }
186    
# Line 224  void DataAlgorithmAdapterTestCase::testD Line 226  void DataAlgorithmAdapterTestCase::testD
226      DataTagged   dataTag2(dataCon2);      DataTagged   dataTag2(dataCon2);
227    
228      // test dp_algorithm on DataExpanded      // test dp_algorithm on DataExpanded
229      escript::dp_algorithm(dataExp,dataExp2,DataAlgorithmAdapter<FMin>(numeric_limits<double>::max()));      FMin fmin_func;
230        escript::dp_algorithm(dataExp,dataExp2,fmin_func,numeric_limits<double>::max());
231      assert(dataExp2.getDataPoint(0,0)()==0);      assert(dataExp2.getDataPoint(0,0)()==0);
232      escript::dp_algorithm(dataExp,dataExp2,DataAlgorithmAdapter<FMax>(numeric_limits<double>::max()*-1));      FMax fmax_func;
233        escript::dp_algorithm(dataExp,dataExp2,fmax_func,numeric_limits<double>::max()*-1);
234      assert(dataExp2.getDataPoint(0,0)()==5);      assert(dataExp2.getDataPoint(0,0)()==5);
235    
236      // test dp_algorithm on DataTagged      // test dp_algorithm on DataTagged
237      escript::dp_algorithm(dataTag,dataTag2,DataAlgorithmAdapter<FMin>(numeric_limits<double>::max()));      escript::dp_algorithm(dataTag,dataTag2,fmin_func,numeric_limits<double>::max());
238      assert(dataTag2.getDataPoint(0,0)()==0);      assert(dataTag2.getDataPoint(0,0)()==0);
239      escript::dp_algorithm(dataTag,dataTag2,DataAlgorithmAdapter<FMax>(numeric_limits<double>::max()*-1));      escript::dp_algorithm(dataTag,dataTag2,fmax_func,numeric_limits<double>::max()*-1);
240      assert(dataTag2.getDataPoint(0,0)()==5);      assert(dataTag2.getDataPoint(0,0)()==5);
241    
242      // test dp_algorithm on DataConstant      // test dp_algorithm on DataConstant
243      escript::dp_algorithm(dataCon,dataCon2,DataAlgorithmAdapter<FMin>(numeric_limits<double>::max()));      escript::dp_algorithm(dataCon,dataCon2,fmin_func,numeric_limits<double>::max());
244      assert(dataCon2.getDataPoint(0,0)()==0);      assert(dataCon2.getDataPoint(0,0)()==0);
245      escript::dp_algorithm(dataCon,dataCon2,DataAlgorithmAdapter<FMax>(numeric_limits<double>::max()*-1));      escript::dp_algorithm(dataCon,dataCon2,fmax_func,numeric_limits<double>::max()*-1);
246      assert(dataCon2.getDataPoint(0,0)()==5);      assert(dataCon2.getDataPoint(0,0)()==5);
247    
248    }    }

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

  ViewVC Help
Powered by ViewVC 1.1.26