-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2021 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
double values[7]={0.25,0.125,0.125,0.25,0.25,0.5,0.5};
const double *tmp=f3->getArray()->getConstPointer();
std::transform(tmp,tmp+7,values,values,std::minus<double>());
- std::transform(values,values+7,values,std::ptr_fun<double,double>(fabs));
+ std::transform(values,values+7,values,[](double c){return fabs(c);});
double max=*std::max_element(values,values+7);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
m4->decrRef();
double values1[5]={-0.1,0.23333333333333336,0.56666666666666665,0.4,0.9};
const double *tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+5,values1,values1,std::minus<double>());
- std::transform(values1,values1+5,values1,std::ptr_fun<double,double>(fabs));
+ std::transform(values1,values1+5,values1,[](double c){return fabs(c);});
double max=*std::max_element(values1,values1+5);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
double values2[9]={-0.6,-0.1,0.4,-0.1,0.4,0.9,0.4,0.9,1.4};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values2,values2,std::minus<double>());
- std::transform(values2,values2+9,values2,std::ptr_fun<double,double>(fabs));
+ std::transform(values2,values2+9,values2,[](double c){return fabs(c);});
max=*std::max_element(values2,values2+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
double values3[18]={-0.6,-1.2,-0.1,-0.2,0.4,0.8,-0.1,-0.2,0.4,0.8,0.9,1.8,0.4,0.8,0.9,1.8,1.4,2.8};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+18,values3,values3,std::minus<double>());
- std::transform(values3,values3+18,values3,std::ptr_fun<double,double>(fabs));
+ std::transform(values3,values3+18,values3,[](double c){return fabs(c);});
max=*std::max_element(values3,values3+18);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
double values4[2];
double values1[5]={-0.1,0.23333333333333336,0.56666666666666665,0.4,0.9};
const double *tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+5,values1,values1,std::minus<double>());
- std::transform(values1,values1+5,values1,std::ptr_fun<double,double>(fabs));
+ std::transform(values1,values1+5,values1,[](double c){return fabs(c);});
double max=*std::max_element(values1,values1+5);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
double values2[9]={-0.9,0.1,1.1,-0.4,0.6,1.6,0.1,1.1,2.1};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values2,values2,std::minus<double>());
- std::transform(values2,values2+9,values2,std::ptr_fun<double,double>(fabs));
+ std::transform(values2,values2+9,values2,[](double c){return fabs(c);});
max=*std::max_element(values2,values2+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
tmp=f1->getArray()->getConstPointer();
double values2Bis[9]={-0.9,0.1,1.1,-0.4,0.6,1.6,0.1,1.1,2.1};
std::transform(tmp,tmp+9,values2Bis,values2Bis,std::minus<double>());
- std::transform(values2,values2+9,values2Bis,std::ptr_fun<double,double>(fabs));
+ std::transform(values2,values2+9,values2Bis,[](double c){return fabs(c);});
max=*std::max_element(values2Bis,values2Bis+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
double values3[18]={-0.6,-1.2,-0.1,-0.2,0.4,0.8,-0.1,-0.2,0.4,0.8,0.9,1.8,0.4,0.8,0.9,1.8,1.4,2.8};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+18,values3,values3,std::minus<double>());
- std::transform(values3,values3+18,values3,std::ptr_fun<double,double>(fabs));
+ std::transform(values3,values3+18,values3,[](double c){return fabs(c);});
max=*std::max_element(values3,values3+18);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
double values4[2];
double values1[9]={-1.8,-0.3,1.2,-0.3,1.2,2.7,1.2,2.7,4.2};
const double *tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values1,values1,std::minus<double>());
- std::transform(values1,values1+9,values1,std::ptr_fun<double,double>(fabs));
+ std::transform(values1,values1+9,values1,[](double c){return fabs(c);});
double max=*std::max_element(values1,values1+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
5.0423700574830965, 17.435300118916864};
const double *tmp=f2->getArray()->getConstPointer();
std::transform(tmp,tmp+18,values2,values2,std::minus<double>());
- std::transform(values2,values2+18,values2,std::ptr_fun<double,double>(fabs));
+ std::transform(values2,values2+18,values2,[](double c){return fabs(c);});
double max=*std::max_element(values2,values2+18);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f2->decrRef();
double values1[9]={-1.8,-0.3,1.2,-0.3,1.2,2.7,1.2,2.7,4.2};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values1,values1,std::minus<double>());
- std::transform(values1,values1+9,values1,std::ptr_fun<double,double>(fabs));
+ std::transform(values1,values1+9,values1,[](double c){return fabs(c);});
max=*std::max_element(values1,values1+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
double values1[9]={-1.2,-0.2,0.8,-0.2,0.8,1.8,0.8,1.8,2.8};
const double *tmp=f3->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values1,values1,std::minus<double>());
- std::transform(values1,values1+9,values1,std::ptr_fun<double,double>(fabs));
+ std::transform(values1,values1+9,values1,[](double c){return fabs(c);});
double max=*std::max_element(values1,values1+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f3->decrRef();
double values2[9]={0.36,0.01,0.16,0.01,0.16,0.81,0.16,0.81,1.96};
tmp=f3->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values2,values2,std::minus<double>());
- std::transform(values2,values2+9,values2,std::ptr_fun<double,double>(fabs));
+ std::transform(values2,values2+9,values2,[](double c){return fabs(c);});
max=*std::max_element(values2,values2+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f3->decrRef();
double values3[9]={0.6,0.1,-0.4,0.1,-0.4,-0.9,-0.4,-0.9,-1.4};
tmp=f4->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values3,values3,std::minus<double>());
- std::transform(values3,values3+9,values3,std::ptr_fun<double,double>(fabs));
+ std::transform(values3,values3+9,values3,[](double c){return fabs(c);});
max=*std::max_element(values3,values3+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f3->decrRef();
tmp=f3->getArray()->getConstPointer();
double values4[9]={-1.2,-0.2,0.8,-0.2,0.8,1.8,0.8,1.8,2.8};
std::transform(tmp,tmp+9,values4,values4,std::minus<double>());
- std::transform(values4,values4+9,values4,std::ptr_fun<double,double>(fabs));
+ std::transform(values4,values4+9,values4,[](double c){return fabs(c);});
max=*std::max_element(values4,values4+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f5->decrRef();
tmp=f3->getArray()->getConstPointer();
double values5[9]={-1.2,-0.2,0.8,-0.2,0.8,1.8,0.8,1.8,2.8};
std::transform(tmp,tmp+9,values5,values5,std::minus<double>());
- std::transform(values5,values5+9,values5,std::ptr_fun<double,double>(fabs));
+ std::transform(values5,values5+9,values5,[](double c){return fabs(c);});
max=*std::max_element(values5,values5+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f5->decrRef();