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

trunk/escript/test/DataAlgorithmAdapterTestCase.cpp revision 2005 by jfenwick, Mon Nov 10 01:21:39 2008 UTC branches/escript3047_with_pastix2995/escript/test/DataAlgorithmAdapterTestCase.cpp revision 3048 by lgao, Fri Jun 25 03:46:37 2010 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3  *  *
4  * Copyright (c) 2003-2008 by University of Queensland  * Copyright (c) 2003-2010 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * Earth Systems Science Computational Center (ESSCC)
6  * http://www.uq.edu.au/esscc  * http://www.uq.edu.au/esscc
7  *  *
# Line 49  void DataAlgorithmAdapterTestCase::tearD Line 49  void DataAlgorithmAdapterTestCase::tearD
49  namespace  namespace
50  {  {
51    
52  ValueType::reference  ValueType::const_reference
53  getSRef(DataReady& data,int sample, int point)  getSRefRO(DataReady& data,int sample, int point)
54  {  {
55     return data.getVector()[data.getPointOffset(sample,point)];     return data.getVectorRO()[data.getPointOffset(sample,point)];
56  }  }
57    
58    
# Line 249  void DataAlgorithmAdapterTestCase::testD Line 249  void DataAlgorithmAdapterTestCase::testD
249      // test dp_algorithm on DataExpanded      // test dp_algorithm on DataExpanded
250      FMin fmin_func;      FMin fmin_func;
251      escript::dp_algorithm(dataExp,dataExp2,fmin_func,numeric_limits<double>::max());      escript::dp_algorithm(dataExp,dataExp2,fmin_func,numeric_limits<double>::max());
252      assert(std::abs(getSRef(dataExp2,0,0)-0)<=REL_TOL*0);      assert(std::abs(getSRefRO(dataExp2,0,0)-0)<=REL_TOL*0);
253      FMax fmax_func;      FMax fmax_func;
254      escript::dp_algorithm(dataExp,dataExp2,fmax_func,numeric_limits<double>::max()*-1);      escript::dp_algorithm(dataExp,dataExp2,fmax_func,numeric_limits<double>::max()*-1);
255      assert(std::abs(getSRef(dataExp2,0,0)-5)<=REL_TOL*5);      assert(std::abs(getSRefRO(dataExp2,0,0)-5)<=REL_TOL*5);
256    
257      // test dp_algorithm on DataTagged      // test dp_algorithm on DataTagged
258      escript::dp_algorithm(dataTag,dataTag2,fmin_func,numeric_limits<double>::max());      escript::dp_algorithm(dataTag,dataTag2,fmin_func,numeric_limits<double>::max());
259      assert(std::abs(getSRef(dataTag2,0,0)-0)<=REL_TOL*0);      assert(std::abs(getSRefRO(dataTag2,0,0)-0)<=REL_TOL*0);
260      escript::dp_algorithm(dataTag,dataTag2,fmax_func,numeric_limits<double>::max()*-1);      escript::dp_algorithm(dataTag,dataTag2,fmax_func,numeric_limits<double>::max()*-1);
261      assert(std::abs(getSRef(dataTag2,0,0)-5)<=REL_TOL*5);      assert(std::abs(getSRefRO(dataTag2,0,0)-5)<=REL_TOL*5);
262    
263      // test dp_algorithm on DataConstant      // test dp_algorithm on DataConstant
264      escript::dp_algorithm(dataCon,dataCon2,fmin_func,numeric_limits<double>::max());      escript::dp_algorithm(dataCon,dataCon2,fmin_func,numeric_limits<double>::max());
265      assert(std::abs(getSRef(dataCon2,0,0)-0)<=REL_TOL*0);      assert(std::abs(getSRefRO(dataCon2,0,0)-0)<=REL_TOL*0);
266      escript::dp_algorithm(dataCon,dataCon2,fmax_func,numeric_limits<double>::max()*-1);      escript::dp_algorithm(dataCon,dataCon2,fmax_func,numeric_limits<double>::max()*-1);
267      assert(std::abs(getSRef(dataCon2,0,0)-5)<=REL_TOL*5);      assert(std::abs(getSRefRO(dataCon2,0,0)-5)<=REL_TOL*5);
268    
269    }    }
270    

Legend:
Removed from v.2005  
changed lines
  Added in v.3048

  ViewVC Help
Powered by ViewVC 1.1.26