]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
fix removed functions c++17 vuzlov/suppress_warnings
authorvuzlov <vuzlov@opencascade.com>
Fri, 4 Sep 2020 11:48:13 +0000 (14:48 +0300)
committervuzlov <vuzlov@opencascade.com>
Fri, 4 Sep 2020 11:48:13 +0000 (14:48 +0300)
34 files changed:
src/INTERP_KERNEL/Bases/InterpKernelStlExt.hxx
src/INTERP_KERNEL/ExprEval/InterpKernelValue.cxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx
src/INTERP_KERNEL/InterpKernelCellSimplify.cxx
src/INTERP_KERNEL/InterpolationUtils.hxx
src/INTERP_KERNEL/VolSurfUser.cxx
src/INTERP_KERNEL/VolSurfUser.txx
src/MEDCoupling/MEDCoupling1GTUMesh.cxx
src/MEDCoupling/MEDCouplingAMRAttribute.cxx
src/MEDCoupling/MEDCouplingCMesh.cxx
src/MEDCoupling/MEDCouplingCartesianAMRMesh.cxx
src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx
src/MEDCoupling/MEDCouplingFieldDiscretization.cxx
src/MEDCoupling/MEDCouplingFieldDouble.cxx
src/MEDCoupling/MEDCouplingGaussLocalization.cxx
src/MEDCoupling/MEDCouplingIMesh.cxx
src/MEDCoupling/MEDCouplingMappedExtrudedMesh.cxx
src/MEDCoupling/MEDCouplingMemArray.cxx
src/MEDCoupling/MEDCouplingMemArray.txx
src/MEDCoupling/MEDCouplingPartDefinition.cxx
src/MEDCoupling/MEDCouplingPointSet.cxx
src/MEDCoupling/MEDCouplingRemapper.cxx
src/MEDCoupling/MEDCouplingStructuredMesh.cxx
src/MEDCoupling/MEDCouplingTimeDiscretization.cxx
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling/MEDCouplingUMesh_internal.cxx
src/MEDCoupling/MEDCouplingUMesh_internal.hxx
src/MEDCoupling/MEDCouplingUMesh_intersection.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx
src/MEDLoader/MEDFileField1TS.cxx
src/MEDLoader/MEDFileFieldOverView.cxx
src/MEDLoader/MEDFileMesh.cxx
src/MEDLoader/MEDFileMeshElt.cxx

index 270417155df169c64c6bb097ac0520380abee7ca..3f49558aa06f484eeb35c97f0c3ce4e306efacfb 100644 (file)
@@ -26,8 +26,8 @@ namespace INTERP_KERNEL
 {
   namespace STLEXT
   {
-    template<typename _Pair>
-    struct Select1st : public std::unary_function<_Pair, typename _Pair::first_type>
+    template<typename _Pair> 
+    struct Select1st //: public std::unary_function<_Pair, typename _Pair::first_type> 
     {
       typename _Pair::first_type& operator()(_Pair& __x) const { return __x.first; }
       const typename _Pair::first_type&operator()(const _Pair& __x) const { return __x.first; }
index 3388bd97faea416fd780004b5b15368d57a25cc5..165f7dd57c4437827229bdbc672631578d58193b 100644 (file)
@@ -438,93 +438,93 @@ void ValueDoubleExpr::negate()
 
 void ValueDoubleExpr::sqrt()
 {
-  double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::less<double>(),0.));
+  double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind(std::less<double>(), std::placeholders::_1,0.));
   if(it!=_dest_data+_sz_dest_data)
     throw INTERP_KERNEL::Exception("Trying to apply sqrt on < 0. value !");
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::sqrt));
+  std::transform(_dest_data, _dest_data + _sz_dest_data, _dest_data, [](double c) {return std::sqrt(c); }); //std::ptr_fun<double,double>(std::sqrt)
 }
 
 void ValueDoubleExpr::cos()
 {
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::cos));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::cos(c); });
 }
 
 void ValueDoubleExpr::sin()
 {
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::sin));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::sin(c); });
 }
 
 void ValueDoubleExpr::tan()
 {
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::tan));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::tan(c); });
 }
 
 void ValueDoubleExpr::acos()
 {
-  double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::less<double>(),-1.));
+  double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind(std::less<double>(), std::placeholders::_1,-1.));
   if(it!=_dest_data+_sz_dest_data)
     throw INTERP_KERNEL::Exception("Trying to apply acos on < 1. value !");
-  it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::greater<double>(),1.));
+  it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind(std::greater<double>(),std::placeholders::_1,1.));
   if(it!=_dest_data+_sz_dest_data)
     throw INTERP_KERNEL::Exception("Trying to apply acos on > 1. value !");
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::acos));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::acos(c); }); //std::ptr_fun<double,double>(std::acos)
 }
 
 void ValueDoubleExpr::asin()
 {
-   double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::less<double>(),-1.));
+   double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind(std::less<double>(), std::placeholders::_1,-1.));
    if(it!=_dest_data+_sz_dest_data)
     throw INTERP_KERNEL::Exception("Trying to apply asin on < 1. value !");
-  it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::greater<double>(),1.));
+  it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind(std::greater<double>(),std::placeholders::_1,1.));
   if(it!=_dest_data+_sz_dest_data)
     throw INTERP_KERNEL::Exception("Trying to apply asin on > 1. value !");
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::asin));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::asin(c); });
 }
 
 void ValueDoubleExpr::atan()
 {
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::atan));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::atan(c); });
 }
 
 void ValueDoubleExpr::cosh()
 {
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::cosh));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::cosh(c); });
 }
 
 void ValueDoubleExpr::sinh()
 {
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::sinh));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::sinh(c); });
 }
 
 void ValueDoubleExpr::tanh()
 {
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::tanh));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::tanh(c); });
 }
 
 void ValueDoubleExpr::abs()
 {
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(fabs));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::fabs(c); });
 }
 
 void ValueDoubleExpr::exp()
 {
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::exp));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::exp(c); });
 }
 
 void ValueDoubleExpr::ln()
 {
-  double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::less_equal<double>(),0.));
+  double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind(std::less_equal<double>(),std::placeholders::_1,0.));
   if(it!=_dest_data+_sz_dest_data)
     throw INTERP_KERNEL::Exception("Trying to apply neperian/natural log on <= 0. value !");
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::log));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::log(c); });
 }
 
 void ValueDoubleExpr::log10()
 {
-  double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::less_equal<double>(),0.));
+  double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind(std::less_equal<double>(),std::placeholders::_1,0.));
   if(it!=_dest_data+_sz_dest_data)
     throw INTERP_KERNEL::Exception("Trying to apply log10 on <= 0. value !");
-  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::log10));
+  std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data, [](double c) {return std::log10(c); });
 }
 
 Value *ValueDoubleExpr::plus(const Value *other) const
@@ -566,11 +566,11 @@ Value *ValueDoubleExpr::pow(const Value *other) const
 {
   const ValueDoubleExpr *otherC=static_cast<const ValueDoubleExpr *>(other);
   double p=otherC->getData()[0];
-  double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::less<double>(),0.));
+  double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind(std::less<double>(),std::placeholders::_1,0.));
   if(it!=_dest_data+_sz_dest_data)
     throw INTERP_KERNEL::Exception("Trying to operate pow(a,b) with a<0. !");
   ValueDoubleExpr *ret=new ValueDoubleExpr(_sz_dest_data,_src_data);
-  std::transform(_dest_data,_dest_data+_sz_dest_data,ret->getData(),std::bind2nd(std::ptr_fun<double,double,double>(std::pow),p));
+  std::transform(_dest_data, _dest_data + _sz_dest_data, ret->getData(), std::bind([](double x, double y) {return std::pow(x, y); }, std::placeholders::_1, p)); //std::ptr_fun<double,double,double>(std::pow)
   return ret;
 }
 
@@ -578,7 +578,7 @@ Value *ValueDoubleExpr::max(const Value *other) const
 {
   const ValueDoubleExpr *otherC=static_cast<const ValueDoubleExpr *>(other);
   ValueDoubleExpr *ret=new ValueDoubleExpr(_sz_dest_data,_src_data);
-  std::transform(_dest_data,_dest_data+_sz_dest_data,otherC->getData(),ret->getData(),std::ptr_fun<const double&, const double&, const double& >(std::max));
+  std::transform(_dest_data, _dest_data + _sz_dest_data, otherC->getData(), ret->getData(), [](const double& x, const double& y) {return std::max(x, y); }); //std::ptr_fun<const double&, const double&, const double& >(std::max)
   return ret;
 }
 
@@ -586,7 +586,7 @@ Value *ValueDoubleExpr::min(const Value *other) const
 {
   const ValueDoubleExpr *otherC=static_cast<const ValueDoubleExpr *>(other);
   ValueDoubleExpr *ret=new ValueDoubleExpr(_sz_dest_data,_src_data);
-  std::transform(_dest_data,_dest_data+_sz_dest_data,otherC->getData(),ret->getData(),std::ptr_fun<const double&, const double&, const double& >(std::min));
+  std::transform(_dest_data, _dest_data + _sz_dest_data, otherC->getData(), ret->getData(), [](const double& x, const double& y) {return std::min(x, y); }); //std::ptr_fun<const double&, const double&, const double& >(std::min)
   return ret;
 }
 
index be520b484e67bc1ce62b5502d159688187186ecb..dc041eaacb8a8acfd6b377b5403381505b36e384 100644 (file)
@@ -605,7 +605,7 @@ void Edge::getNormalVector(double *vectOutput) const
   std::copy((const double *)(*_end),(const double *)(*_end)+2,vectOutput);
   std::transform(vectOutput,vectOutput+2,(const double *)(*_start),vectOutput,std::minus<double>());
   double norm=1./Node::norm(vectOutput);
-  std::transform(vectOutput,vectOutput+2,vectOutput,bind2nd(std::multiplies<double>(),norm));
+  std::transform(vectOutput,vectOutput+2,vectOutput,bind(std::multiplies<double>(),std::placeholders::_1,norm));
   double tmp=vectOutput[0];
   vectOutput[0]=vectOutput[1];
   vectOutput[1]=-tmp;
@@ -691,7 +691,7 @@ void Edge::Interpolate1DLin(const std::vector<double>& distrib1, const std::vect
   MergePoints commonNode;
   for(unsigned int i=0;i<nbOfV1;i++)
     {
-      std::vector<double>::const_iterator iter=find_if(distrib2.begin()+1,distrib2.end(),bind2nd(std::greater_equal<double>(),distrib1[i]));
+      std::vector<double>::const_iterator iter=find_if(distrib2.begin()+1,distrib2.end(),bind(std::greater_equal<double>(),std::placeholders::_1,distrib1[i]));
       if(iter!=distrib2.end())
         {
           for(unsigned int j=(unsigned)((iter-1)-distrib2.begin());j<nbOfV2;j++)
index c04435a2c27344d4611f77c0326fe4317067e0b4..b29cbe2c7d06d417cf40f1f545588cb595f71d9f 100644 (file)
@@ -314,7 +314,7 @@ bool CellSimplify::tryToArrangeOppositeFace(const mcIdType *conn, mcIdType lgth,
  */
 INTERP_KERNEL::NormalizedCellType CellSimplify::tryToUnPolyHex8(const mcIdType *conn, mcIdType nbOfFaces, mcIdType lgth, mcIdType *retConn, mcIdType& retLgth)
 {
-  if(std::find_if(conn+lgth,conn+lgth+nbOfFaces,std::bind2nd(std::not_equal_to<mcIdType>(),ToIdType(INTERP_KERNEL::NORM_QUAD4)))==conn+lgth+nbOfFaces)
+  if(std::find_if(conn+lgth,conn+lgth+nbOfFaces,std::bind(std::not_equal_to<mcIdType>(),std::placeholders::_1,ToIdType(INTERP_KERNEL::NORM_QUAD4)))==conn+lgth+nbOfFaces)
     {//6 faces are QUAD4.
       int oppositeFace=-1;
       std::set<mcIdType> conn1(conn,conn+4);
@@ -493,7 +493,7 @@ INTERP_KERNEL::NormalizedCellType CellSimplify::tryToUnPolyPyra5(const mcIdType
  */
 INTERP_KERNEL::NormalizedCellType CellSimplify::tryToUnPolyTetra4(const mcIdType *conn, mcIdType nbOfFaces, mcIdType lgth, mcIdType *retConn, mcIdType& retLgth)
 {
-  if(std::find_if(conn+lgth,conn+lgth+nbOfFaces,std::bind2nd(std::not_equal_to<mcIdType>(),ToIdType(INTERP_KERNEL::NORM_TRI3)))==conn+lgth+nbOfFaces)
+  if(std::find_if(conn+lgth,conn+lgth+nbOfFaces,std::bind(std::not_equal_to<mcIdType>(),std::placeholders::_1,ToIdType(INTERP_KERNEL::NORM_TRI3)))==conn+lgth+nbOfFaces)
     {
       std::set<mcIdType> tribase(conn,conn+3);
       mcIdType point=-1;
index f429f2fd84b26ed00bd056bf825115e30ed9065d..9308374e94e699d5adba9c9a4f49a67265429f47 100644 (file)
@@ -153,13 +153,13 @@ namespace INTERP_KERNEL
     double tmp[SPACEDIM];
     std::transform(triIn,triIn+SPACEDIM,triIn+SPACEDIM,tmp,std::plus<double>());
     //2nd point
-    std::transform(tmp,tmp+SPACEDIM,quadOut+SPACEDIM,std::bind2nd(std::multiplies<double>(),0.5));
+    std::transform(tmp,tmp+SPACEDIM,quadOut+SPACEDIM,std::bind(std::multiplies<double>(),std::placeholders::_1,0.5));
     std::transform(tmp,tmp+SPACEDIM,triIn+2*SPACEDIM,tmp,std::plus<double>());
     //3rd point
-    std::transform(tmp,tmp+SPACEDIM,quadOut+2*SPACEDIM,std::bind2nd(std::multiplies<double>(),1/3.));
+    std::transform(tmp,tmp+SPACEDIM,quadOut+2*SPACEDIM,std::bind(std::multiplies<double>(), std::placeholders::_1,1/3.));
     //4th point
     std::transform(triIn,triIn+SPACEDIM,triIn+2*SPACEDIM,tmp,std::plus<double>());
-    std::transform(tmp,tmp+SPACEDIM,quadOut+3*SPACEDIM,std::bind2nd(std::multiplies<double>(),0.5));
+    std::transform(tmp,tmp+SPACEDIM,quadOut+3*SPACEDIM,std::bind(std::multiplies<double>(), std::placeholders::_1,0.5));
   }
 
   /*!
@@ -176,15 +176,15 @@ namespace INTERP_KERNEL
     std::copy(polygIn,polygIn+SPACEDIM,polygOut);
     std::transform(polygIn,polygIn+SPACEDIM,polygIn+SPACEDIM,polygOut+SPACEDIM,std::plus<double>());
     //2nd point
-    std::transform(polygOut+SPACEDIM,polygOut+2*SPACEDIM,polygOut+SPACEDIM,std::bind2nd(std::multiplies<double>(),0.5));
+    std::transform(polygOut+SPACEDIM,polygOut+2*SPACEDIM,polygOut+SPACEDIM,std::bind(std::multiplies<double>(), std::placeholders::_1,0.5));
     double tmp[SPACEDIM];
     //
     for(mcIdType i=0;i<nPtsPolygonIn-2;i++)
       {
         std::transform(polygIn,polygIn+SPACEDIM,polygIn+(i+2)*SPACEDIM,tmp,std::plus<double>());
-        std::transform(tmp,tmp+SPACEDIM,polygOut+(2*i+3)*SPACEDIM,std::bind2nd(std::multiplies<double>(),0.5));
+        std::transform(tmp,tmp+SPACEDIM,polygOut+(2*i+3)*SPACEDIM,std::bind(std::multiplies<double>(), std::placeholders::_1,0.5));
         std::transform(polygIn+(i+1)*SPACEDIM,polygIn+(i+2)*SPACEDIM,tmp,tmp,std::plus<double>());
-        std::transform(tmp,tmp+SPACEDIM,polygOut+(2*i+2)*SPACEDIM,std::bind2nd(std::multiplies<double>(),1./3.));
+        std::transform(tmp,tmp+SPACEDIM,polygOut+(2*i+2)*SPACEDIM,std::bind(std::multiplies<double>(), std::placeholders::_1,1./3.));
       }
   }
 
@@ -371,7 +371,7 @@ namespace INTERP_KERNEL
             while (n<(int)SZ);
           }
         s=B[np];//s is the Pivot
-        std::transform(B+k*nr,B+(k+1)*nr,B+k*nr,std::bind2nd(std::divides<double>(),s));
+        std::transform(B+k*nr,B+(k+1)*nr,B+k*nr,std::bind(std::divides<double>(), std::placeholders::_1,s));
         for(j=0;j<SZ;j++)
           {
             if(j!=k)
@@ -1042,7 +1042,7 @@ namespace INTERP_KERNEL
   {
     std::vector<bool> sw(3,false);
     double inpVect2[3];
-    std::transform(inpVect,inpVect+3,inpVect2,std::ptr_fun<double,double>(fabs));
+    std::transform(inpVect,inpVect+3,inpVect2,[](double c) {return fabs(c);}); // std::ptr_fun<double,double>(fabs)
     std::size_t posMin(std::distance(inpVect2,std::min_element(inpVect2,inpVect2+3)));
     sw[posMin]=true;
     std::size_t posMax(std::distance(inpVect2,std::max_element(inpVect2,inpVect2+3)));
index 1e2dcaa35f88e77a7c5d23de391df6b30a5766b9..f578d744a375dd7ea6a4368d8e2b7c6685784a29 100644 (file)
@@ -220,7 +220,7 @@ namespace INTERP_KERNEL
     double baryOfNodes[3]={0.,0.,0.};
     for(std::size_t i=0;i<nbOfEdges;i++)
       { baryOfNodes[0]+=coords[3*connOfPolygonBg[i]]; baryOfNodes[1]+=coords[3*connOfPolygonBg[i]+1]; baryOfNodes[2]+=coords[3*connOfPolygonBg[i]+2]; }
-    std::transform(baryOfNodes,baryOfNodes+3,baryOfNodes,std::bind2nd(std::multiplies<double>(),1./((double)nbOfEdges)));
+    std::transform(baryOfNodes,baryOfNodes+3,baryOfNodes,std::bind(std::multiplies<double>(),std::placeholders::_1,1./((double)nbOfEdges)));
     double matrix[12];
     if(!ComputeRotTranslationMatrixToPut3PointsOnOXY(coords+3*connOfPolygonBg[0],coords+3*connOfPolygonBg[1],baryOfNodes,matrix))
       return std::numeric_limits<double>::max();
index c84a381f2018091c25d7c816ce81fc810bd3ea46..8900e52403ddf20e3517299c556435bdf917e86e 100644 (file)
@@ -244,7 +244,7 @@ namespace INTERP_KERNEL
           std::copy(coords+SPACEDIM*OTT<ConnType,numPol>::coo2C(connec[0]),
                     coords+SPACEDIM*OTT<ConnType,numPol>::coo2C(connec[0]+1),res);
           std::transform(res,res+SPACEDIM,coords+SPACEDIM*OTT<ConnType,numPol>::coo2C(connec[1]),res,std::plus<double>());
-          std::transform(res,res+SPACEDIM,res,std::bind2nd(std::multiplies<double>(),0.5));
+          std::transform(res,res+SPACEDIM,res,std::bind(std::multiplies<double>(),std::placeholders::_1,0.5));
           break;
         }
       case NORM_SEG3:
@@ -264,7 +264,7 @@ namespace INTERP_KERNEL
               std::copy(coords+SPACEDIM*OTT<ConnType,numPol>::coo2C(connec[0]),
                         coords+SPACEDIM*OTT<ConnType,numPol>::coo2C(connec[0]+1),res);
               std::transform(res,res+SPACEDIM,coords+SPACEDIM*OTT<ConnType,numPol>::coo2C(connec[1]),res,std::plus<double>());
-              std::transform(res,res+SPACEDIM,res,std::bind2nd(std::multiplies<double>(),0.5));
+              std::transform(res,res+SPACEDIM,res,std::bind(std::multiplies<double>(),std::placeholders::_1,0.5));
             }
           else
             throw INTERP_KERNEL::Exception("computeBarycenter for SEG3 only SPACEDIM 1,2 or 3 supported !");
@@ -277,7 +277,7 @@ namespace INTERP_KERNEL
                     coords+SPACEDIM*OTT<ConnType,numPol>::coo2C(connec[0]+1),res);
           std::transform(res,res+SPACEDIM,coords+SPACEDIM*OTT<ConnType,numPol>::coo2C(connec[1]),res,std::plus<double>());
           std::transform(res,res+SPACEDIM,coords+SPACEDIM*OTT<ConnType,numPol>::coo2C(connec[2]),res,std::plus<double>());
-          std::transform(res,res+SPACEDIM,res,std::bind2nd(std::multiplies<double>(),1./3.));
+          std::transform(res,res+SPACEDIM,res,std::bind(std::multiplies<double>(),std::placeholders::_1,1./3.));
           break;
         }
       case NORM_TRI6:
index 2ff53aaa155a01c5ad0a27802a47ae1c39b2a01e..345c903fa3a622389b610cdecbe3849d9c102f23 100644 (file)
@@ -883,7 +883,7 @@ DataArrayDouble *MEDCoupling1SGTUMesh::computeIsoBarycenterOfNodesPerCell() cons
             std::ostringstream oss; oss << "MEDCoupling1SGTUMesh::computeIsoBarycenterOfNodesPerCell : on cell #" << i << " presence of nodeId #" << *nodal << " should be in [0," <<   nbOfNodes << ") !";
             throw INTERP_KERNEL::Exception(oss.str().c_str());
           }
-      std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind2nd(std::multiplies<double>(),coeff));
+      std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind(std::multiplies<double>(),std::placeholders::_1,coeff));
     }
   return ret.retn();
 }
@@ -1232,7 +1232,7 @@ MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::Merge1SGTUMeshesLL(std::vector<const
     {
       mcIdType curConnLgth=(*it)->getNodalConnectivityLength();
       const mcIdType *curC=(*it)->_conn->begin();
-      cPtr=std::transform(curC,curC+curConnLgth,cPtr,std::bind2nd(std::plus<mcIdType>(),offset));
+      cPtr=std::transform(curC,curC+curConnLgth,cPtr,std::bind(std::plus<mcIdType>(),std::placeholders::_1,offset));
       offset+=(*it)->getNumberOfNodes();
     }
   //
@@ -1611,7 +1611,7 @@ void MEDCoupling1SGTUMesh::getReverseNodalConnectivity(DataArrayIdType *revNodal
     {
       for(int j=0;j<nbOfNodesPerCell;j++,conn++)
         {
-          *std::find_if(revNodalPtr+revNodalIndxPtr[*conn],revNodalPtr+revNodalIndxPtr[*conn+1],std::bind2nd(std::equal_to<mcIdType>(),-1))=eltId;
+          *std::find_if(revNodalPtr+revNodalIndxPtr[*conn],revNodalPtr+revNodalIndxPtr[*conn+1],std::bind(std::equal_to<mcIdType>(),std::placeholders::_1,-1))=eltId;
         }
     }
 }
@@ -2664,7 +2664,7 @@ DataArrayDouble *MEDCoupling1DGTUMesh::computeIsoBarycenterOfNodesPerCell() cons
                       std::ostringstream oss; oss << "MEDCoupling1DGTUMesh::computeIsoBarycenterOfNodesPerCell : on cell #" << i << " presence of nodeId #" << *nodal << " should be in [0," <<   nbOfNodes << ") !";
                       throw INTERP_KERNEL::Exception(oss.str().c_str());
                     }
-                  std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind2nd(std::multiplies<double>(),1./double(nodali[1]-nodali[0])));
+                  std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind(std::multiplies<double>(),std::placeholders::_1,1./double(nodali[1]-nodali[0])));
                 }
             }
           else
@@ -2697,7 +2697,7 @@ DataArrayDouble *MEDCoupling1DGTUMesh::computeIsoBarycenterOfNodesPerCell() cons
                     }
                 }
               if(nbOfNod!=0)
-                std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind2nd(std::multiplies<double>(),1./nbOfNod));
+                std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind(std::multiplies<double>(),std::placeholders::_1,1./nbOfNod));
               else
                 {
                   std::ostringstream oss; oss << "MEDCoupling1DGTUMesh::computeIsoBarycenterOfNodesPerCell (polyhedron) : no nodes in cell #" << i << " !";
@@ -2941,7 +2941,7 @@ void MEDCoupling1DGTUMesh::getReverseNodalConnectivity(DataArrayIdType *revNodal
         {
           mcIdType nodeId=conn[conni[eltId]+j];
           if(nodeId!=-1)
-            *std::find_if(revNodalPtr+revNodalIndxPtr[nodeId],revNodalPtr+revNodalIndxPtr[nodeId+1],std::bind2nd(std::equal_to<mcIdType>(),-1))=eltId;
+            *std::find_if(revNodalPtr+revNodalIndxPtr[nodeId],revNodalPtr+revNodalIndxPtr[nodeId+1],std::bind(std::equal_to<mcIdType>(),std::placeholders::_1,-1))=eltId;
         }
     }
 }
index 1804203362878502145c3eb1b23bd337ae66eebe..98858cb06446a0120851c9d9d6a8483a33d12cb3 100755 (executable)
@@ -486,7 +486,7 @@ void MEDCouplingGridCollection::copyOverlappedZoneFrom(mcIdType ghostLev, const
       std::vector<mcIdType> deltaThis,deltaOther;
       std::vector< std::pair<mcIdType,mcIdType> > rgThis((*it).first->positionRelativeToGodFather(deltaThis));
       std::vector<mcIdType> thisSt((*it).first->getImageMesh()->getCellGridStructure());
-      std::transform(thisSt.begin(),thisSt.end(),thisSt.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostLev));
+      std::transform(thisSt.begin(),thisSt.end(),thisSt.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostLev));
       for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it2=other._map_of_dadc.begin();it2!=other._map_of_dadc.end();it2++)
         {
           std::vector< std::pair<mcIdType,mcIdType> > rgOther((*it2).first->positionRelativeToGodFather(deltaOther));
@@ -499,7 +499,7 @@ void MEDCouplingGridCollection::copyOverlappedZoneFrom(mcIdType ghostLev, const
               std::vector<mcIdType> otherSt((*it2).first->getImageMesh()->getCellGridStructure());
               MEDCouplingStructuredMesh::ApplyGhostOnCompactFrmt(pThis,ghostLev);
               MEDCouplingStructuredMesh::ApplyGhostOnCompactFrmt(pOther,ghostLev);
-              std::transform(otherSt.begin(),otherSt.end(),otherSt.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostLev));
+              std::transform(otherSt.begin(),otherSt.end(),otherSt.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostLev));
               mcIdType sz((*it2).second->size());
               for(mcIdType i=0;i<sz;i++)
                 {
index 2dcc0886f81d994a8bd323ca7a05bb42d5eeb972..8c2494e0a29b25d799f9604eac24b257a20c797f 100755 (executable)
@@ -613,7 +613,7 @@ mcIdType MEDCouplingCMesh::getCellContainingPoint(const double *pos, double eps)
       const double *d=getCoordsAt(i)->getConstPointer();
       mcIdType nbOfNodes=getCoordsAt(i)->getNbOfElems();
       double ref=pos[i];
-      const double *w=std::find_if(d,d+nbOfNodes,std::bind2nd(std::greater_equal<double>(),ref));
+      const double *w=std::find_if(d,d+nbOfNodes,std::bind(std::greater_equal<double>(),std::placeholders::_1,ref));
       mcIdType w2=ToIdType(std::distance(d,w));
       if(w2<nbOfNodes)
         {
@@ -654,13 +654,13 @@ void MEDCouplingCMesh::translate(const double *vector)
 {
   if(_x_array)
     std::transform(_x_array->getConstPointer(),_x_array->getConstPointer()+_x_array->getNbOfElems(),
-                   _x_array->getPointer(),std::bind2nd(std::plus<double>(),vector[0]));
+                   _x_array->getPointer(),std::bind(std::plus<double>(),std::placeholders::_1,vector[0]));
   if(_y_array)
     std::transform(_y_array->getConstPointer(),_y_array->getConstPointer()+_y_array->getNbOfElems(),
-                   _y_array->getPointer(),std::bind2nd(std::plus<double>(),vector[1]));
+                   _y_array->getPointer(),std::bind(std::plus<double>(),std::placeholders::_1,vector[1]));
   if(_z_array)
     std::transform(_z_array->getConstPointer(),_z_array->getConstPointer()+_z_array->getNbOfElems(),
-                   _z_array->getPointer(),std::bind2nd(std::plus<double>(),vector[2]));
+                   _z_array->getPointer(),std::bind(std::plus<double>(),std::placeholders::_1,vector[2]));
 }
 
 /*!
@@ -678,9 +678,9 @@ void MEDCouplingCMesh::scale(const double *point, double factor)
         {
           double *coords=c->getPointer();
           mcIdType lgth=ToIdType(c->getNbOfElems());
-          std::transform(coords,coords+lgth,coords,std::bind2nd(std::minus<double>(),point[i]));
-          std::transform(coords,coords+lgth,coords,std::bind2nd(std::multiplies<double>(),factor));
-          std::transform(coords,coords+lgth,coords,std::bind2nd(std::plus<double>(),point[i]));
+          std::transform(coords,coords+lgth,coords,std::bind(std::minus<double>(),std::placeholders::_1,point[i]));
+          std::transform(coords,coords+lgth,coords,std::bind(std::multiplies<double>(),std::placeholders::_1,factor));
+          std::transform(coords,coords+lgth,coords,std::bind(std::plus<double>(),std::placeholders::_1,point[i]));
           c->declareAsNew();
         }
     }
@@ -752,7 +752,7 @@ DataArrayDouble *MEDCouplingCMesh::computeCellCenterOfMass() const
       const double *srcPtr=tabs[j]->getConstPointer();
       tabsPtr[j].insert(tabsPtr[j].end(),srcPtr,srcPtr+sz);
       std::transform(tabsPtr[j].begin(),tabsPtr[j].end(),srcPtr+1,tabsPtr[j].begin(),std::plus<double>());
-      std::transform(tabsPtr[j].begin(),tabsPtr[j].end(),tabsPtr[j].begin(),std::bind2nd(std::multiplies<double>(),0.5));
+      std::transform(tabsPtr[j].begin(),tabsPtr[j].end(),tabsPtr[j].begin(),std::bind(std::multiplies<double>(),std::placeholders::_1,0.5));
     }
   mcIdType tmp2[3];
   for(int i=0;i<nbCells;i++)
index 1847da64ec805ef6b613e0980ec1b2311c31c989..79c65c390af004c5a3d1c468635b89356946f907 100755 (executable)
@@ -371,13 +371,13 @@ void MEDCouplingCartesianAMRPatch::UpdateNeighborsOfOneWithTwoMixedLev(mcIdType
   std::transform(dimsP2NotRefined.begin(),dimsP2NotRefined.end(),factors.begin(),dimsP2Refined.begin(),std::multiplies<mcIdType>());
   std::vector< std::pair<mcIdType,mcIdType> > p2RefinedAbs(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dimsP2NotRefined));
   std::vector<mcIdType> dimsP2RefinedGhost(dimsP2Refined.size());
-  std::transform(dimsP2Refined.begin(),dimsP2Refined.end(),dimsP2RefinedGhost.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostLev));
+  std::transform(dimsP2Refined.begin(),dimsP2Refined.end(),dimsP2RefinedGhost.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostLev));
   MCAuto<DataArrayDouble> fineP2(DataArrayDouble::New()); fineP2->alloc(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(dimsP2RefinedGhost),dataOnP2->getNumberOfComponents());
   MEDCouplingIMesh::SpreadCoarseToFineGhost(dataOnP2,dimsP2NotRefined,fineP2,p2RefinedAbs,factors,ghostLev);
   if(isConservative)
     {
       mcIdType fact(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(factors));
-      std::transform(fineP2->begin(),fineP2->end(),fineP2->getPointer(),std::bind2nd(std::multiplies<double>(),1./((double)fact)));
+      std::transform(fineP2->begin(),fineP2->end(),fineP2->getPointer(),std::bind(std::multiplies<double>(),std::placeholders::_1,1./((double)fact)));
     }
   //
   UpdateNeighborsOfOneWithTwoInternal(ghostLev,p1->getMesh()->getFather()->getFactors(),p1pp,p2pp,dataOnP1,fineP2);
@@ -509,7 +509,7 @@ void MEDCouplingCartesianAMRPatch::UpdateNeighborsOfOneWithTwoInternal(mcIdType
   mcIdType dim(ToIdType(factors.size()));
   std::vector<mcIdType> dimsCoarse(MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(p1));//[3,2]
   std::transform(dimsCoarse.begin(),dimsCoarse.end(),factors.begin(),dimsCoarse.begin(),std::multiplies<mcIdType>());//[12,8]
-  std::transform(dimsCoarse.begin(),dimsCoarse.end(),dimsCoarse.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostLev));//[14,10]
+  std::transform(dimsCoarse.begin(),dimsCoarse.end(),dimsCoarse.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostLev));//[14,10]
   std::vector< std::pair<mcIdType,mcIdType> > rangeCoarse(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dimsCoarse));//[(0,14),(0,10)]
   std::vector<mcIdType> fakeFactors(dim,1);
   //
@@ -1215,7 +1215,7 @@ void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatch(mcIdType patchId, cons
   if(isConservative)
     {
       mcIdType fact(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(getFactors()));
-      std::transform(cellFieldOnPatch->begin(),cellFieldOnPatch->end(),cellFieldOnPatch->getPointer(),std::bind2nd(std::multiplies<double>(),1./((double)fact)));
+      std::transform(cellFieldOnPatch->begin(),cellFieldOnPatch->end(),cellFieldOnPatch->getPointer(),std::bind(std::multiplies<double>(),std::placeholders::_1,1./((double)fact)));
     }
 }
 
@@ -1239,7 +1239,7 @@ void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchGhost(mcIdType patchId,
   if(isConservative)
     {
       mcIdType fact(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(getFactors()));
-      std::transform(cellFieldOnPatch->begin(),cellFieldOnPatch->end(),cellFieldOnPatch->getPointer(),std::bind2nd(std::multiplies<double>(),1./((double)fact)));
+      std::transform(cellFieldOnPatch->begin(),cellFieldOnPatch->end(),cellFieldOnPatch->getPointer(),std::bind(std::multiplies<double>(),std::placeholders::_1,1./((double)fact)));
     }
 }
 
@@ -1494,7 +1494,7 @@ DataArrayDouble *MEDCouplingCartesianAMRMeshGen::extractGhostFrom(mcIdType ghost
 {
   std::vector<mcIdType> st(_mesh->getCellGridStructure());
   std::vector< std::pair<mcIdType,mcIdType> > p(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(st));
-  std::transform(st.begin(),st.end(),st.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostSz));
+  std::transform(st.begin(),st.end(),st.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostSz));
   MEDCouplingStructuredMesh::ApplyGhostOnCompactFrmt(p,ghostSz);
   MCAuto<DataArrayDouble> ret(MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,arr,p));
   return ret.retn();
index d3391455127b76b5621c39ef11f83ac38f8ab8a8..f2ef17b8be7de6a21632b5c88bd512a2b36007f8 100755 (executable)
@@ -686,7 +686,7 @@ void MEDCouplingCurveLinearMesh::scale(const double *point, double factor)
   for(mcIdType i=0;i<nbNodes;i++)
     {
       std::transform(coords+i*dim,coords+(i+1)*dim,point,coords+i*dim,std::minus<double>());
-      std::transform(coords+i*dim,coords+(i+1)*dim,coords+i*dim,std::bind2nd(std::multiplies<double>(),factor));
+      std::transform(coords+i*dim,coords+(i+1)*dim,coords+i*dim,std::bind(std::multiplies<double>(),std::placeholders::_1,factor));
       std::transform(coords+i*dim,coords+(i+1)*dim,point,coords+i*dim,std::plus<double>());
     }
   _coords->declareAsNew();
@@ -790,7 +790,7 @@ void MEDCouplingCurveLinearMesh::getBarycenterAndOwnerMeshDim1(DataArrayDouble *
 {
   int spaceDim=getSpaceDimension();
   std::transform(_coords->begin()+spaceDim,_coords->end(),_coords->begin(),bary->getPointer(),std::plus<double>());
-  std::transform(bary->begin(),bary->end(),bary->getPointer(),std::bind2nd(std::multiplies<double>(),0.5));
+  std::transform(bary->begin(),bary->end(),bary->getPointer(),std::bind(std::multiplies<double>(),std::placeholders::_1,0.5));
 }
 
 void MEDCouplingCurveLinearMesh::renumberCells(const mcIdType * /*old2NewBg*/, bool /*check*/)
index b858903c6f8a8dabf56bf62d470f5621574d983f..5bdd8d1bedaabe5e4fabd1d3755fc995d0e0a249 100755 (executable)
@@ -251,7 +251,7 @@ void MEDCouplingFieldDiscretization::normL1(const MEDCouplingMesh *mesh, const D
         res[j]+=fabs(arrPtr[i*nbOfCompo+j])*v;
       deno+=v;
     }
-  std::transform(res,res+nbOfCompo,res,std::bind2nd(std::multiplies<double>(),1./deno));
+  std::transform(res,res+nbOfCompo,res,std::bind(std::multiplies<double>(),std::placeholders::_1,1./deno));
 }
 
 /*!
@@ -275,8 +275,8 @@ void MEDCouplingFieldDiscretization::normL2(const MEDCouplingMesh *mesh, const D
         res[j]+=arrPtr[i*nbOfCompo+j]*arrPtr[i*nbOfCompo+j]*v;
       deno+=v;
     }
-  std::transform(res,res+nbOfCompo,res,std::bind2nd(std::multiplies<double>(),1./deno));
-  std::transform(res,res+nbOfCompo,res,std::ptr_fun<double,double>(std::sqrt));
+  std::transform(res,res+nbOfCompo,res,std::bind(std::multiplies<double>(),std::placeholders::_1,1./deno));
+  std::transform(res,res+nbOfCompo,res, [](double c) {return sqrt(c); });//std::ptr_fun<double,double>(std::sqrt)
 }
 
 /*!
@@ -304,7 +304,7 @@ void MEDCouplingFieldDiscretization::integral(const MEDCouplingMesh *mesh, const
   INTERP_KERNEL::AutoPtr<double> tmp=new double[nbOfCompo];
   for(mcIdType i=0;i<nbOfElems;i++)
     {
-      std::transform(arrPtr+i*nbOfCompo,arrPtr+(i+1)*nbOfCompo,(double *)tmp,std::bind2nd(std::multiplies<double>(),volPtr[i]));
+      std::transform(arrPtr+i*nbOfCompo,arrPtr+(i+1)*nbOfCompo,(double *)tmp,std::bind(std::multiplies<double>(),std::placeholders::_1,volPtr[i]));
       std::transform((double *)tmp,(double *)tmp+nbOfCompo,res,res,std::plus<double>());
     }
 }
@@ -446,13 +446,13 @@ void MEDCouplingFieldDiscretization::RenumberEntitiesFromO2NArr(double eps, cons
       mcIdType newNb=old2NewPtr[i];
       if(newNb>=0)//if newNb<0 the node is considered as out.
         {
-          if(std::find_if(ptToFill+newNb*nbOfComp,ptToFill+(newNb+1)*nbOfComp,std::bind2nd(std::not_equal_to<double>(),std::numeric_limits<double>::max()))
+          if(std::find_if(ptToFill+newNb*nbOfComp,ptToFill+(newNb+1)*nbOfComp,std::bind(std::not_equal_to<double>(),std::placeholders::_1,std::numeric_limits<double>::max()))
           ==ptToFill+(newNb+1)*nbOfComp)
             std::copy(ptSrc+i*nbOfComp,ptSrc+(i+1)*nbOfComp,ptToFill+newNb*nbOfComp);
           else
             {
               std::transform(ptSrc+i*nbOfComp,ptSrc+(i+1)*nbOfComp,ptToFill+newNb*nbOfComp,(double *)tmp,std::minus<double>());
-              std::transform((double *)tmp,((double *)tmp)+nbOfComp,(double *)tmp,std::ptr_fun<double,double>(fabs));
+              std::transform((double *)tmp,((double *)tmp)+nbOfComp,(double *)tmp, [](double c) {return fabs(c); }); //std::ptr_fun<double,double>(fabs)
               //if(!std::equal(ptSrc+i*nbOfComp,ptSrc+(i+1)*nbOfComp,ptToFill+newNb*nbOfComp))
               if(*std::max_element((double *)tmp,((double *)tmp)+nbOfComp)>eps)
                 {
@@ -1071,7 +1071,7 @@ void MEDCouplingFieldDiscretizationP1::getValueInCell(const MEDCouplingMesh *mes
   for(std::size_t i=0;i<nbOfNodes;i++)
     {
       arr->getTuple(conn[i],(double *)tmp2);
-      std::transform((double *)tmp2,((double *)tmp2)+sz,(double *)tmp2,std::bind2nd(std::multiplies<double>(),tmp[i]));
+      std::transform((double *)tmp2,((double *)tmp2)+sz,(double *)tmp2,std::bind(std::multiplies<double>(),std::placeholders::_1,tmp[i]));
       std::transform(res,res+sz,(double *)tmp2,res,std::plus<double>());
     }
 }
@@ -1755,7 +1755,7 @@ MEDCouplingFieldDouble *MEDCouplingFieldDiscretizationGauss::getMeasureField(con
           mcIdType nbOfGaussPt=loc.getNumberOfGaussPt();
           INTERP_KERNEL::AutoPtr<double> weights=new double[nbOfGaussPt];
           double sum=std::accumulate(loc.getWeights().begin(),loc.getWeights().end(),0.);
-          std::transform(loc.getWeights().begin(),loc.getWeights().end(),(double *)weights,std::bind2nd(std::multiplies<double>(),1./sum));
+          std::transform(loc.getWeights().begin(),loc.getWeights().end(),(double *)weights,std::bind(std::multiplies<double>(),std::placeholders::_1,1./sum));
           for(const mcIdType *cellId=curIds->begin();cellId!=curIds->end();cellId++)
             for(mcIdType j=0;j<nbOfGaussPt;j++)
               arrPtr[offsetPtr[*cellId]+j]=weights[j]*volPtr[*cellId];
@@ -2375,7 +2375,7 @@ void MEDCouplingFieldDiscretizationGaussNE::integral(const MEDCouplingMesh *mesh
       const double *wArr=GetWeightArrayFromGeometricType(*it,wArrSz);
       INTERP_KERNEL::AutoPtr<double> wArr2=new double[wArrSz];
       double sum=std::accumulate(wArr,wArr+wArrSz,0.);
-      std::transform(wArr,wArr+wArrSz,(double *)wArr2,std::bind2nd(std::multiplies<double>(),1./sum));      
+      std::transform(wArr,wArr+wArrSz,(double *)wArr2,std::bind(std::multiplies<double>(),std::placeholders::_1,1./sum));      
       MCAuto<DataArrayIdType> ids=mesh->giveCellsWithType(*it);
       MCAuto<DataArrayIdType> ids2=ids->buildExplicitArrByRanges(nbOfNodesPerCell);
       const mcIdType *ptIds2=ids2->begin(),*ptIds=ids->begin();
@@ -2704,7 +2704,7 @@ MEDCouplingFieldDouble *MEDCouplingFieldDiscretizationGaussNE::getMeasureField(c
       const double *wArr=GetWeightArrayFromGeometricType(*it,wArrSz);
       INTERP_KERNEL::AutoPtr<double> wArr2=new double[wArrSz];
       double sum=std::accumulate(wArr,wArr+wArrSz,0.);
-      std::transform(wArr,wArr+wArrSz,(double *)wArr2,std::bind2nd(std::multiplies<double>(),1./sum));      
+      std::transform(wArr,wArr+wArrSz,(double *)wArr2,std::bind(std::multiplies<double>(),std::placeholders::_1,1./sum));      
       MCAuto<DataArrayIdType> ids=mesh->giveCellsWithType(*it);
       MCAuto<DataArrayIdType> ids2=ids->buildExplicitArrByRanges(nbOfNodesPerCell);
       const mcIdType *ptIds2=ids2->begin(),*ptIds=ids->begin();
index 260b101d208badb9bb44f9b911b08281d537c655..76a632d2a80d1203c3091f2e1f96dc0ea9bfe649 100755 (executable)
@@ -233,7 +233,7 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::nodeToCellDiscretization() const
           for(std::size_t k=0;k<nbNodesInCell;k++)
             std::transform(srcPt+nodeIds[k]*nbCompo,srcPt+(nodeIds[k]+1)*nbCompo,pt,pt,std::plus<double>());
           if(nbNodesInCell!=0)
-            std::transform(pt,pt+nbCompo,pt,std::bind2nd(std::multiplies<double>(),1./((double)nbNodesInCell)));
+            std::transform(pt,pt+nbCompo,pt,std::bind(std::multiplies<double>(), std::placeholders::_1, 1./((double)nbNodesInCell)));
           else
             {
               std::ostringstream oss; oss << "MEDCouplingFieldDouble::nodeToCellDiscretization : Cell id #" << i << " has been detected to have no nodes !";
@@ -706,7 +706,7 @@ void MEDCouplingFieldDouble::getWeightedAverageValue(double *res, bool isWAbs) c
   arr->multiplyEqual(w->getArray());
   arr->accumulate(res);
   std::size_t nCompo = getArray()->getNumberOfComponents();
-  std::transform(res,res+nCompo,res,std::bind2nd(std::multiplies<double>(),1./deno));
+  std::transform(res, res + nCompo, res, std::bind(std::multiplies<double>(), std::placeholders::_1, 1. / deno));
 }
 
 /*!
index 145e35cf1564d78e51f73fe650392c1f9f9f8376..da473994db16a3b0d5eac0ba3548062d4a047728 100644 (file)
@@ -324,6 +324,6 @@ bool MEDCouplingGaussLocalization::AreAlmostEqual(const std::vector<double>& v1,
     return false;
   std::vector<double> tmp(sz);
   std::transform(v1.begin(),v1.end(),v2.begin(),tmp.begin(),std::minus<double>());
-  std::transform(tmp.begin(),tmp.end(),tmp.begin(),std::ptr_fun<double,double>(fabs));
+  std::transform(tmp.begin(),tmp.end(),tmp.begin(), [](double c) {return fabs(c); }); //std::ptr_fun<double,double>(fabs)
   return *std::max_element(tmp.begin(),tmp.end())<eps;
 }
index 19468e9b80e1807eb396ceb89089b5b50392ee1f..68c7a777fd26631f449723c267aebe0b7fcc94c5 100755 (executable)
@@ -417,7 +417,7 @@ void MEDCouplingIMesh::CondenseFineToCoarseGhost(const std::vector<mcIdType>& co
     throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarseGhost : All input vectors (dimension) must have the same size !");
   if(!coarseDA || !coarseDA->isAllocated() || !fineDA || !fineDA->isAllocated())
     throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarseGhost : the parameters 1 or 3 are NULL or not allocated !");
-  std::vector<mcIdType> coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostSize));
+  std::vector<mcIdType> coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostSize));
   std::size_t meshDim(coarseSt.size());
   mcIdType nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseStG));
   std::size_t nbCompo(fineDA->getNumberOfComponents());
@@ -433,7 +433,7 @@ void MEDCouplingIMesh::CondenseFineToCoarseGhost(const std::vector<mcIdType>& co
   //
   std::vector<mcIdType> fineStG(MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(fineLocInCoarse));
   std::transform(fineStG.begin(),fineStG.end(),facts.begin(),fineStG.begin(),std::multiplies<mcIdType>());
-  std::transform(fineStG.begin(),fineStG.end(),fineStG.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostSize));
+  std::transform(fineStG.begin(),fineStG.end(),fineStG.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostSize));
   mcIdType nbTuplesFine(fineDA->getNumberOfTuples()),nbTuplesFineExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(fineStG));
   if(fineDA->getNumberOfTuples()!=nbTuplesFineExp)
     {
@@ -654,7 +654,7 @@ void MEDCouplingIMesh::SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA,
     throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhost : All input vectors (dimension) must have the same size !");
   if(!coarseDA || !coarseDA->isAllocated() || !fineDA || !fineDA->isAllocated())
     throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhost : the parameters 1 or 3 are NULL or not allocated !");
-  std::vector<mcIdType> coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostSize));
+  std::vector<mcIdType> coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostSize));
   std::size_t meshDim(coarseSt.size());
   mcIdType nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseStG));
   std::size_t nbCompo=fineDA->getNumberOfComponents();
@@ -670,7 +670,7 @@ void MEDCouplingIMesh::SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA,
   //
   std::vector<mcIdType> fineStG(MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(fineLocInCoarse));
   std::transform(fineStG.begin(),fineStG.end(),facts.begin(),fineStG.begin(),std::multiplies<mcIdType>());
-  std::transform(fineStG.begin(),fineStG.end(),fineStG.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostSize));
+  std::transform(fineStG.begin(),fineStG.end(),fineStG.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostSize));
   mcIdType nbTuplesFine(fineDA->getNumberOfTuples()),nbTuplesFineExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(fineStG));
   if(fineDA->getNumberOfTuples()!=nbTuplesFineExp)
     {
@@ -747,7 +747,7 @@ void MEDCouplingIMesh::SpreadCoarseToFineGhostZone(const DataArrayDouble *coarse
     throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhostZone : All input vectors (dimension) must have the same size !");
   if(!coarseDA || !coarseDA->isAllocated() || !fineDA || !fineDA->isAllocated())
     throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhostZone : the parameters 1 or 3 are NULL or not allocated !");
-  std::vector<mcIdType> coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostSize));
+  std::vector<mcIdType> coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostSize));
   std::size_t meshDim(coarseSt.size());
   mcIdType nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseStG));
   std::size_t nbCompo=fineDA->getNumberOfComponents();
@@ -763,7 +763,7 @@ void MEDCouplingIMesh::SpreadCoarseToFineGhostZone(const DataArrayDouble *coarse
   //
   std::vector<mcIdType> fineStG(MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(fineLocInCoarse));
   std::transform(fineStG.begin(),fineStG.end(),facts.begin(),fineStG.begin(),std::multiplies<mcIdType>());
-  std::transform(fineStG.begin(),fineStG.end(),fineStG.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostSize));
+  std::transform(fineStG.begin(),fineStG.end(),fineStG.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostSize));
   mcIdType nbTuplesFine(fineDA->getNumberOfTuples()),nbTuplesFineExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(fineStG));
   if(fineDA->getNumberOfTuples()!=nbTuplesFineExp)
     {
@@ -1164,8 +1164,8 @@ void MEDCouplingIMesh::scale(const double *point, double factor)
   checkSpaceDimension();
   int dim(getSpaceDimension());
   std::transform(_origin,_origin+dim,point,_origin,std::minus<double>());
-  std::transform(_origin,_origin+dim,_origin,std::bind2nd(std::multiplies<double>(),factor));
-  std::transform(_dxyz,_dxyz+dim,_dxyz,std::bind2nd(std::multiplies<double>(),factor));
+  std::transform(_origin,_origin+dim,_origin,std::bind(std::multiplies<double>(),std::placeholders::_1,factor));
+  std::transform(_dxyz,_dxyz+dim,_dxyz,std::bind(std::multiplies<double>(),std::placeholders::_1,factor));
   std::transform(_origin,_origin+dim,point,_origin,std::plus<double>());
   declareAsNew();
 }
@@ -1219,7 +1219,7 @@ DataArrayDouble *MEDCouplingIMesh::computeCellCenterOfMass() const
   mcIdType nbCells(ToIdType(getNumberOfCells())),tmp[3],tmp2[3];
   ret->alloc(nbCells,spaceDim);
   double *pt(ret->getPointer()),shiftOrigin[3];
-  std::transform(_dxyz,_dxyz+spaceDim,shiftOrigin,std::bind2nd(std::multiplies<double>(),0.5));
+  std::transform(_dxyz,_dxyz+spaceDim,shiftOrigin,std::bind(std::multiplies<double>(),std::placeholders::_1,0.5));
   std::transform(_origin,_origin+spaceDim,shiftOrigin,shiftOrigin,std::plus<double>());
   getSplitCellValues(tmp);
   ret->setInfoOnComponents(buildInfoOnComponents());
index 69bafba04e0386265a34781710f8d20556556b08..44be0a2324cda868ebb7055765643de624f24df4 100644 (file)
@@ -285,7 +285,7 @@ DataArrayIdType *MEDCouplingMappedExtrudedMesh::giveCellsWithType(INTERP_KERNEL:
   ret->alloc(nbOfLevs*nbOfTuples,1);
   mcIdType *pt(ret->getPointer());
   for(int i=0;i<nbOfLevs;i++,pt+=nbOfTuples)
-    std::transform(tmp->begin(),tmp->end(),pt,std::bind2nd(std::plus<mcIdType>(),i*nbOfCells2D));
+    std::transform(tmp->begin(),tmp->end(),pt,std::bind(std::plus<mcIdType>(),std::placeholders::_1,i*nbOfCells2D));
   MCAuto<DataArrayIdType> ret2(ret->renumberR(_mesh3D_ids->begin()));
   ret2->sort();
   return ret2.retn();
@@ -344,8 +344,8 @@ void MEDCouplingMappedExtrudedMesh::getNodeIdsOfCell(mcIdType cellId, std::vecto
   std::vector<mcIdType> tmp,tmp2;
   _mesh2D->getNodeIdsOfCell(locId,tmp);
   tmp2=tmp;
-  std::transform(tmp.begin(),tmp.end(),tmp.begin(),std::bind2nd(std::plus<mcIdType>(),nbOfNodes2D*lev));
-  std::transform(tmp2.begin(),tmp2.end(),tmp2.begin(),std::bind2nd(std::plus<mcIdType>(),nbOfNodes2D*(lev+1)));
+  std::transform(tmp.begin(),tmp.end(),tmp.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,nbOfNodes2D*lev));
+  std::transform(tmp2.begin(),tmp2.end(),tmp2.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,nbOfNodes2D*(lev+1)));
   conn.insert(conn.end(),tmp.begin(),tmp.end());
   conn.insert(conn.end(),tmp2.begin(),tmp2.end());
 }
@@ -624,7 +624,7 @@ void MEDCouplingMappedExtrudedMesh::computeBaryCenterOfFace(const std::vector<mc
   const double *coords(_mesh2D->getCoords()->begin());
   for(std::vector<mcIdType>::const_iterator iter=nodalConnec.begin();iter!=nodalConnec.end();iter++)
     std::transform(zoneToUpdate,zoneToUpdate+3,coords+3*(*iter),zoneToUpdate,std::plus<double>());
-  std::transform(zoneToUpdate,zoneToUpdate+3,zoneToUpdate,std::bind2nd(std::multiplies<double>(),(1./(double)nodalConnec.size())));
+  std::transform(zoneToUpdate,zoneToUpdate+3,zoneToUpdate,std::bind(std::multiplies<double>(),std::placeholders::_1,(1./(double)nodalConnec.size())));
 }
 
 mcIdType MEDCouplingMappedExtrudedMesh::FindCorrespCellByNodalConn(const std::vector<mcIdType>& nodalConnec, const mcIdType *revNodalPtr, const mcIdType *revNodalIndxPtr)
@@ -677,7 +677,7 @@ void MEDCouplingMappedExtrudedMesh::Project1DMeshes(const MEDCouplingUMesh *m1,
   m1->getCoordinatesOfNode(c[1],ref2);
   std::transform(ref2.begin(),ref2.end(),ref.begin(),v,std::minus<double>());
   double n=INTERP_KERNEL::norm<3>(v);
-  std::transform(v,v+3,v,std::bind2nd(std::multiplies<double>(),1/n));
+  std::transform(v,v+3,v,std::bind(std::multiplies<double>(),std::placeholders::_1,1/n));
   m1->project1D(&ref[0],v,eps,m1r->getCoords()->getPointer());
   m2->project1D(&ref[0],v,eps,m2r->getCoords()->getPointer());
 }
index 4b7fd907d237ef7046481fb4d76188b30b9f73ce..eb4b152c43185972e7159c58e91ff67ddad9ee99 100755 (executable)
@@ -2011,13 +2011,13 @@ DataArrayDouble *DataArrayDouble::fromCartToCylGiven(const DataArrayDouble *coor
     throw INTERP_KERNEL::Exception("DataArrayDouble::fromCartToCylGiven : magnitude of vect is too low !");
   double Ur[3],Uteta[3],Uz[3],*retPtr(ret->getPointer());
   const double *coo(coords->begin()),*vectField(begin());
-  std::transform(vect,vect+3,Uz,std::bind2nd(std::multiplies<double>(),1./magOfVect));
+  std::transform(vect,vect+3,Uz,std::bind(std::multiplies<double>(),std::placeholders::_1,1./magOfVect));
   for(mcIdType i=0;i<nbTuples;i++,vectField+=3,retPtr+=3,coo+=3)
     {
       std::transform(coo,coo+3,center,Ur,std::minus<double>());
       Uteta[0]=Uz[1]*Ur[2]-Uz[2]*Ur[1]; Uteta[1]=Uz[2]*Ur[0]-Uz[0]*Ur[2]; Uteta[2]=Uz[0]*Ur[1]-Uz[1]*Ur[0];
       double magOfTeta(sqrt(Uteta[0]*Uteta[0]+Uteta[1]*Uteta[1]+Uteta[2]*Uteta[2]));
-      std::transform(Uteta,Uteta+3,Uteta,std::bind2nd(std::multiplies<double>(),1./magOfTeta));
+      std::transform(Uteta,Uteta+3,Uteta,std::bind(std::multiplies<double>(),std::placeholders::_1,1./magOfTeta));
       Ur[0]=Uteta[1]*Uz[2]-Uteta[2]*Uz[1]; Ur[1]=Uteta[2]*Uz[0]-Uteta[0]*Uz[2]; Ur[2]=Uteta[0]*Uz[1]-Uteta[1]*Uz[0];
       retPtr[0]=Ur[0]*vectField[0]+Ur[1]*vectField[1]+Ur[2]*vectField[2];
       retPtr[1]=Uteta[0]*vectField[0]+Uteta[1]*vectField[1]+Uteta[2]*vectField[2];
@@ -3464,18 +3464,18 @@ void DataArrayDouble::Rotate3DAlg(const double *center, const double *vect, doub
   double norm(sqrt(vect[0]*vect[0]+vect[1]*vect[1]+vect[2]*vect[2]));
   if(norm<std::numeric_limits<double>::min())
     throw INTERP_KERNEL::Exception("DataArrayDouble::Rotate3DAlg : magnitude of input vector is too close of 0. !");
-  std::transform(vect,vect+3,vectorNorm,std::bind2nd(std::multiplies<double>(),1/norm));
+  std::transform(vect,vect+3,vectorNorm,std::bind(std::multiplies<double>(),std::placeholders::_1,1/norm));
   //rotation matrix computation
   matrix[0]=cosa; matrix[1]=0.; matrix[2]=0.; matrix[3]=0.; matrix[4]=cosa; matrix[5]=0.; matrix[6]=0.; matrix[7]=0.; matrix[8]=cosa;
   matrixTmp[0]=vectorNorm[0]*vectorNorm[0]; matrixTmp[1]=vectorNorm[0]*vectorNorm[1]; matrixTmp[2]=vectorNorm[0]*vectorNorm[2];
   matrixTmp[3]=vectorNorm[1]*vectorNorm[0]; matrixTmp[4]=vectorNorm[1]*vectorNorm[1]; matrixTmp[5]=vectorNorm[1]*vectorNorm[2];
   matrixTmp[6]=vectorNorm[2]*vectorNorm[0]; matrixTmp[7]=vectorNorm[2]*vectorNorm[1]; matrixTmp[8]=vectorNorm[2]*vectorNorm[2];
-  std::transform(matrixTmp,matrixTmp+9,matrixTmp,std::bind2nd(std::multiplies<double>(),1-cosa));
+  std::transform(matrixTmp,matrixTmp+9,matrixTmp,std::bind(std::multiplies<double>(),std::placeholders::_1,1-cosa));
   std::transform(matrix,matrix+9,matrixTmp,matrix,std::plus<double>());
   matrixTmp[0]=0.; matrixTmp[1]=-vectorNorm[2]; matrixTmp[2]=vectorNorm[1];
   matrixTmp[3]=vectorNorm[2]; matrixTmp[4]=0.; matrixTmp[5]=-vectorNorm[0];
   matrixTmp[6]=-vectorNorm[1]; matrixTmp[7]=vectorNorm[0]; matrixTmp[8]=0.;
-  std::transform(matrixTmp,matrixTmp+9,matrixTmp,std::bind2nd(std::multiplies<double>(),sina));
+  std::transform(matrixTmp,matrixTmp+9,matrixTmp,std::bind(std::multiplies<double>(),std::placeholders::_1,sina));
   std::transform(matrix,matrix+9,matrixTmp,matrix,std::plus<double>());
   //rotation matrix computed.
   double tmp[3];
index dbccfc92aec5c4e5869c534e1e654f857af01a33..b9bb8cc6a1f079f6588d2a5d2e975538bd0045f5 100755 (executable)
@@ -2713,7 +2713,7 @@ namespace MEDCoupling
             T *ptr(this->getPointer());
             const T *ptrc(other->begin());
             for(mcIdType i=0;i<nbOfTuple;i++)
-              std::transform(ptr+i*nbOfComp,ptr+(i+1)*nbOfComp,ptr+i*nbOfComp,std::bind2nd(FCT(),*ptrc++));
+              std::transform(ptr+i*nbOfComp,ptr+(i+1)*nbOfComp,ptr+i*nbOfComp,std::bind(FCT(),std::placeholders::_1,*ptrc++));
           }
         else
           throw INTERP_KERNEL::Exception(msg);
@@ -2854,7 +2854,7 @@ namespace MEDCoupling
             const T *a2Ptr(a2->begin()),*a1Ptr(a1->begin());
             T *res(ret->getPointer());
             for(mcIdType i=0;i<nbOfTuple1;i++)
-              res=std::transform(a1Ptr+i*nbOfComp1,a1Ptr+(i+1)*nbOfComp1,res,std::bind2nd(FCT(),a2Ptr[i]));
+              res=std::transform(a1Ptr+i*nbOfComp1,a1Ptr+(i+1)*nbOfComp1,res,std::bind(FCT(),std::placeholders::_1,a2Ptr[i]));
             ret->copyStringInfoFrom(*a1);
             return ret.retn();
           }
@@ -2987,7 +2987,7 @@ namespace MEDCoupling
                 const T *aMaxPtr(aMax->begin());
                 T *res=ret->getPointer();
                 for(mcIdType i=0;i<nbOfTuple;i++)
-                  res=std::transform(aMaxPtr+i*nbOfCompMax,aMaxPtr+(i+1)*nbOfCompMax,res,std::bind2nd(FCT(),aMinPtr[i]));
+                  res=std::transform(aMaxPtr+i*nbOfCompMax,aMaxPtr+(i+1)*nbOfCompMax,res,std::bind(FCT(),std::placeholders::_1,aMinPtr[i]));
                 ret->copyStringInfoFrom(*aMax);
               }
             else
@@ -3403,7 +3403,7 @@ struct NotInRange
     this->checkAllocated();
     T *ptr(this->getPointer());
     std::size_t nbOfElems(this->getNbOfElems());
-    std::transform(ptr,ptr+nbOfElems,ptr,std::ptr_fun<T,T>(std::abs));
+    std::transform(ptr,ptr+nbOfElems,ptr, [](T c) {return std::abs(c);}); //std::ptr_fun<T,T>(std::abs)
     this->declareAsNew();
   }
 
@@ -3426,7 +3426,7 @@ struct NotInRange
     mcIdType nbOfTuples(this->getNumberOfTuples());
     std::size_t nbOfComp(this->getNumberOfComponents());
     newArr->alloc(nbOfTuples,nbOfComp);
-    std::transform(this->begin(),this->end(),newArr->getPointer(),std::ptr_fun<T,T>(std::abs));
+    std::transform(this->begin(),this->end(),newArr->getPointer(),[](T c) {return std::abs(c);}); //std::ptr_fun<T,T>(std::abs)
     newArr->copyStringInfoFrom(*this);
     return newArr.retn();
   }
@@ -4342,7 +4342,7 @@ struct NotInRange
     std::set<T> castsDetected;
     for(mcIdType i=0;i<nbOfTuples;i++)
       {
-        rintstart res=std::find_if(bg,end2,std::bind2nd(std::less_equal<T>(), work[i]));
+        rintstart res=std::find_if(bg,end2,std::bind(std::less_equal<T>(),std::placeholders::_1, work[i]));
         std::size_t pos=std::distance(bg,res);
         std::size_t pos2=nbOfCast-pos;
         if(pos2<nbOfCast)
@@ -5397,7 +5397,7 @@ struct NotInRange
     this->checkAllocated();
     T *ptr=this->getPointer();
     std::size_t nbOfElems=this->getNbOfElems();
-    std::transform(ptr,ptr+nbOfElems,ptr,std::bind2nd(std::divides<T>(),val));
+    std::transform(ptr,ptr+nbOfElems,ptr,std::bind(std::divides<T>(),std::placeholders::_1,val));
     this->declareAsNew();
   }
 
@@ -5416,7 +5416,7 @@ struct NotInRange
     this->checkAllocated();
     T *ptr=this->getPointer();
     std::size_t nbOfElems=this->getNbOfElems();
-    std::transform(ptr,ptr+nbOfElems,ptr,std::bind2nd(std::modulus<T>(),val));
+    std::transform(ptr,ptr+nbOfElems,ptr,std::bind(std::modulus<T>(),std::placeholders::_1,val));
     this->declareAsNew();
   }
 
@@ -6465,7 +6465,7 @@ struct NotInRange
                 T *ptr=this->getPointer();
                 const T *ptrc=other->getConstPointer();
                 for(mcIdType i=0;i<nbOfTuple;i++)
-                  std::transform(ptr+i*nbOfComp,ptr+(i+1)*nbOfComp,ptr+i*nbOfComp,std::bind2nd(std::modulus<T>(),*ptrc++));
+                  std::transform(ptr+i*nbOfComp,ptr+(i+1)*nbOfComp,ptr+i*nbOfComp,std::bind(std::modulus<T>(),std::placeholders::_1,*ptrc++));
               }
             else
               throw INTERP_KERNEL::Exception(msg);
@@ -6706,7 +6706,7 @@ struct NotInRange
             const T *a1Ptr=a1->getConstPointer();
             T *res=ret->getPointer();
             for(mcIdType i=0;i<nbOfTuple1;i++)
-              res=std::transform(a1Ptr+i*nbOfComp1,a1Ptr+(i+1)*nbOfComp1,res,std::bind2nd(std::modulus<T>(),a2Ptr[i]));
+              res=std::transform(a1Ptr+i*nbOfComp1,a1Ptr+(i+1)*nbOfComp1,res,std::bind(std::modulus<T>(),std::placeholders::_1,a2Ptr[i]));
             ret->copyStringInfoFrom(*a1);
             return ret.retn();
           }
@@ -7020,7 +7020,7 @@ struct NotInRange
     ret->alloc(retSz,1);
     T *pt=ret->getPointer(); *pt++=0;
     for(typename std::vector<const DataArrayType *>::const_iterator it=arrs.begin();it!=arrs.end();it++)
-      pt=std::transform((*it)->begin()+1,(*it)->end(),pt,std::bind2nd(std::plus<T>(),pt[-1]));
+      pt=std::transform((*it)->begin()+1,(*it)->end(),pt,std::bind(std::plus<T>(),std::placeholders::_1,pt[-1]));
     ret->copyStringInfoFrom(*(arrs[0]));
     return ret.retn();
   }
index fa930464236a604b392881bb23130abf939ee5b1..d91822e5aaf3839650db221eb911f8ec222f83af 100644 (file)
@@ -151,7 +151,7 @@ PartDefinition *DataArrayPartDefinition::composeWith(const PartDefinition *other
         {
           MCAuto<DataArrayIdType> arr(DataArrayIdType::New());
           arr->alloc(_arr->getNumberOfTuples(),1);
-          std::transform(_arr->begin(),_arr->end(),arr->getPointer(),std::bind2nd(std::plus<mcIdType>(),a));
+          std::transform(_arr->begin(),_arr->end(),arr->getPointer(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,a));
           return DataArrayPartDefinition::New(arr);
         }
     }
index a80603925e032330df7d942b21b9ab2a679a3cfd..1d7455ba42c10b97315b0a22c3c96e71900b221c 100755 (executable)
@@ -444,7 +444,7 @@ void MEDCouplingPointSet::renumberNodesCenter(const mcIdType *newNodeNumbers, mc
       div[newNodeNumbers[i]]++;
     }
   for(mcIdType i=0;i<newNbOfNodes;i++)
-    ptToFill=std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind2nd(std::multiplies<double>(),1./(double)div[i]));
+    ptToFill=std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind(std::multiplies<double>(),std::placeholders::_1,1./(double)div[i]));
   setCoords(newCoords);
   newCoords->decrRef();
   renumberNodesInConn(newNodeNumbers);
@@ -608,7 +608,7 @@ void MEDCouplingPointSet::scale(const double *point, double factor)
   for(mcIdType i=0;i<nbNodes;i++)
     {
       std::transform(coords+i*dim,coords+(i+1)*dim,point,coords+i*dim,std::minus<double>());
-      std::transform(coords+i*dim,coords+(i+1)*dim,coords+i*dim,std::bind2nd(std::multiplies<double>(),factor));
+      std::transform(coords+i*dim,coords+(i+1)*dim,coords+i*dim,std::bind(std::multiplies<double>(),std::placeholders::_1,factor));
       std::transform(coords+i*dim,coords+(i+1)*dim,point,coords+i*dim,std::plus<double>());
     }
   _coords->declareAsNew();
@@ -1220,7 +1220,7 @@ bool MEDCouplingPointSet::areCellsFrom2MeshEqual(const MEDCouplingPointSet *othe
       getCoordinatesOfNode(c1[0],n1);
       other->getCoordinatesOfNode(c2[0],n2);
       std::transform(n1.begin(),n1.end(),n2.begin(),n1.begin(),std::minus<double>());
-      std::transform(n1.begin(),n1.end(),n1.begin(),std::ptr_fun<double,double>(fabs));
+      std::transform(n1.begin(),n1.end(),n1.begin(), [](double c) {return fabs(c); }); //std::ptr_fun<double,double>(fabs
       if(*std::max_element(n1.begin(),n1.end())>prec)
         return false;
     }
@@ -1263,7 +1263,7 @@ void MEDCouplingPointSet::tryToShareSameCoordsPermute(const MEDCouplingPointSet&
       throw INTERP_KERNEL::Exception("MEDCouplingPointSet::tryToShareSameCoordsPermute fails : no nodes are mergeable with specified given epsilon !");
     }
   mcIdType maxId=*std::max_element(da->getConstPointer(),da->getConstPointer()+otherNbOfNodes);
-  const mcIdType *pt=std::find_if(da->getConstPointer()+otherNbOfNodes,da->getConstPointer()+da->getNbOfElems(),std::bind2nd(std::greater<mcIdType>(),maxId));
+  const mcIdType *pt=std::find_if(da->getConstPointer()+otherNbOfNodes,da->getConstPointer()+da->getNbOfElems(),std::bind(std::greater<mcIdType>(),std::placeholders::_1,maxId));
   if(pt!=da->getConstPointer()+da->getNbOfElems())
     {
       setCoords(oldCoords);
@@ -1425,7 +1425,7 @@ void MEDCouplingPointSet::checkDeepEquivalWith(const MEDCouplingMesh *other, int
   //mergeNodes
   if(!areNodesMerged && oldNbOfNodes != 0)
     throw INTERP_KERNEL::Exception("checkDeepEquivalWith : Nodes are incompatible ! ");
-  const mcIdType *pt=std::find_if(da->getConstPointer()+oldNbOfNodes,da->getConstPointer()+da->getNbOfElems(),std::bind2nd(std::greater<mcIdType>(),oldNbOfNodes-1));
+  const mcIdType *pt=std::find_if(da->getConstPointer()+oldNbOfNodes,da->getConstPointer()+da->getNbOfElems(),std::bind(std::greater<mcIdType>(),std::placeholders::_1,oldNbOfNodes-1));
   if(pt!=da->getConstPointer()+da->getNbOfElems())
     throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some nodes in other are not in this !");
   m->renumberNodes(da->getConstPointer(),newNbOfNodes);
@@ -1488,7 +1488,7 @@ void MEDCouplingPointSet::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh
   MCAuto<MEDCouplingPointSet> m=mergeMyselfWithOnSameCoords(otherC);
   MCAuto<DataArrayIdType> da=m->zipConnectivityTraducer(cellCompPol);
   mcIdType maxId=*std::max_element(da->getConstPointer(),da->getConstPointer()+getNumberOfCells());
-  const mcIdType *pt=std::find_if(da->getConstPointer()+getNumberOfCells(),da->getConstPointer()+da->getNbOfElems(),std::bind2nd(std::greater<mcIdType>(),maxId));
+  const mcIdType *pt=std::find_if(da->getConstPointer()+getNumberOfCells(),da->getConstPointer()+da->getNbOfElems(),std::bind(std::greater<mcIdType>(),std::placeholders::_1,maxId));
   if(pt!=da->getConstPointer()+da->getNbOfElems())
     {
       throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : some cells in other are not in this !");
index f0fd8df5197f04dd325278b4ce9dbaccb045a939..e1f801acf8aed1f4fe759e0158adc7d760a186e4 100755 (executable)
@@ -1233,7 +1233,7 @@ void MEDCouplingRemapper::computeProduct(const double *inputPointer, int inputNb
       std::map<mcIdType,double>::const_iterator iter3=_deno_multiply[idx].begin();
       for(std::map<mcIdType,double>::const_iterator iter2=(*iter1).begin();iter2!=(*iter1).end();iter2++,iter3++)
         {
-          std::transform(inputPointer+(*iter2).first*inputNbOfCompo,inputPointer+((*iter2).first+1)*inputNbOfCompo,tmp,std::bind2nd(std::multiplies<double>(),(*iter2).second/(*iter3).second));
+          std::transform(inputPointer+(*iter2).first*inputNbOfCompo,inputPointer+((*iter2).first+1)*inputNbOfCompo,tmp,std::bind(std::multiplies<double>(),std::placeholders::_1,(*iter2).second/(*iter3).second));
           std::transform(tmp,tmp+inputNbOfCompo,resPointer+idx*inputNbOfCompo,resPointer+idx*inputNbOfCompo,std::plus<double>());
         }
     }
@@ -1251,7 +1251,7 @@ void MEDCouplingRemapper::computeReverseProduct(const double *inputPointer, int
       for(std::map<mcIdType,double>::const_iterator iter2=(*iter1).begin();iter2!=(*iter1).end();iter2++)
         {
           isReached[(*iter2).first]=true;
-          std::transform(inputPointer+idx*inputNbOfCompo,inputPointer+(idx+1)*inputNbOfCompo,tmp,std::bind2nd(std::multiplies<double>(),(*iter2).second/_deno_reverse_multiply[(*iter2).first][idx]));
+          std::transform(inputPointer+idx*inputNbOfCompo,inputPointer+(idx+1)*inputNbOfCompo,tmp,std::bind(std::multiplies<double>(),std::placeholders::_1,(*iter2).second/_deno_reverse_multiply[(*iter2).first][idx]));
           std::transform(tmp,tmp+inputNbOfCompo,resPointer+((*iter2).first)*inputNbOfCompo,resPointer+((*iter2).first)*inputNbOfCompo,std::plus<double>());
         }
     }
index 4a81b7376b0d189ff38ec2c9d1701a0bdb2abd83..5a6fc6f9b98f1e0a24db0daf87626416ab7b3b68 100755 (executable)
@@ -1331,7 +1331,7 @@ void MEDCouplingStructuredMesh::GetPosFromId(mcIdType eltId, int meshDim, const
 std::vector<mcIdType> MEDCouplingStructuredMesh::getCellGridStructure() const
 {
   std::vector<mcIdType> ret(getNodeGridStructure());
-  std::transform(ret.begin(),ret.end(),ret.begin(),std::bind2nd(std::plus<mcIdType>(),-1));
+  std::transform(ret.begin(),ret.end(),ret.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,-1));
   return ret;
 }
 
@@ -1999,7 +1999,7 @@ void MEDCouplingStructuredMesh::MultiplyPartOf(const std::vector<mcIdType>& st,
                 for(mcIdType k=0;k<dims[0];k++)
                   {
                     mcIdType offset(part[0].first+k+b+a);
-                    std::transform(pt+nbCompo*offset,pt+nbCompo*(offset+1),pt+nbCompo*offset,std::bind2nd(std::multiplies<double>(),factor));
+                    std::transform(pt+nbCompo*offset,pt+nbCompo*(offset+1),pt+nbCompo*offset,std::bind(std::multiplies<double>(),std::placeholders::_1,factor));
                   }
               }
           }
@@ -2013,7 +2013,7 @@ void MEDCouplingStructuredMesh::MultiplyPartOf(const std::vector<mcIdType>& st,
             for(mcIdType k=0;k<dims[0];k++)
               {
                 mcIdType offset(part[0].first+k+b);
-                std::transform(pt+nbCompo*offset,pt+nbCompo*(offset+1),pt+nbCompo*offset,std::bind2nd(std::multiplies<double>(),factor));
+                std::transform(pt+nbCompo*offset,pt+nbCompo*(offset+1),pt+nbCompo*offset,std::bind(std::multiplies<double>(),std::placeholders::_1,factor));
               }
           }
         break;
@@ -2023,7 +2023,7 @@ void MEDCouplingStructuredMesh::MultiplyPartOf(const std::vector<mcIdType>& st,
         for(mcIdType k=0;k<dims[0];k++)
           {
             mcIdType offset(part[0].first+k);
-            std::transform(pt+nbCompo*offset,pt+nbCompo*(offset+1),pt+nbCompo*offset,std::bind2nd(std::multiplies<double>(),factor));
+            std::transform(pt+nbCompo*offset,pt+nbCompo*(offset+1),pt+nbCompo*offset,std::bind(std::multiplies<double>(),std::placeholders::_1,factor));
           }
         break;
       }
@@ -2073,7 +2073,7 @@ void MEDCouplingStructuredMesh::PutInGhostFormat(mcIdType ghostSize, const std::
     if(part[i].first<0 || part[i].first>part[i].second || part[i].second>st[i])
       throw INTERP_KERNEL::Exception("MEDCouplingStructuredMesh::PutInGhostFormat : the specified part is invalid ! The begin must be >= 0 and <= end ! The end must be <= to the size at considered dimension !");
   stWithGhost.resize(st.size());
-  std::transform(st.begin(),st.end(),stWithGhost.begin(),std::bind2nd(std::plus<mcIdType>(),2*ghostSize));
+  std::transform(st.begin(),st.end(),stWithGhost.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,2*ghostSize));
   partWithGhost=part;
   ApplyGhostOnCompactFrmt(partWithGhost,ghostSize);
 }
index 5dc6547ab08d27f974de7646ba52c63f6604e7d8..67dce78d9ffbfe72678a98f05c775f53171458d6 100644 (file)
@@ -2481,9 +2481,9 @@ void MEDCouplingLinearTime::getValueForTime(double time, const std::vector<doubl
 {
   double alpha=(_end.getTimeValue()-time)/(_end.getTimeValue()-_start.getTimeValue());
   std::size_t nbComp=vals.size()/2;
-  std::transform(vals.begin(),vals.begin()+nbComp,res,std::bind2nd(std::multiplies<double>(),alpha));
+  std::transform(vals.begin(),vals.begin()+nbComp,res,std::bind(std::multiplies<double>(),std::placeholders::_1,alpha));
   std::vector<double> tmp(nbComp);
-  std::transform(vals.begin()+nbComp,vals.end(),tmp.begin(),std::bind2nd(std::multiplies<double>(),1-alpha));
+  std::transform(vals.begin()+nbComp,vals.end(),tmp.begin(),std::bind(std::multiplies<double>(),std::placeholders::_1,1-alpha));
   std::transform(tmp.begin(),tmp.end(),res,res,std::plus<double>());
 }
 
@@ -2495,13 +2495,13 @@ void MEDCouplingLinearTime::getValueOnTime(mcIdType eltId, double time, double *
   else
     throw INTERP_KERNEL::Exception("No start array existing.");
   std::size_t nbComp=_array->getNumberOfComponents();
-  std::transform(value,value+nbComp,value,std::bind2nd(std::multiplies<double>(),alpha));
+  std::transform(value,value+nbComp,value,std::bind(std::multiplies<double>(),std::placeholders::_1,alpha));
   std::vector<double> tmp(nbComp);
   if(_end_array)
     _end_array->getTuple(eltId,&tmp[0]);
   else
     throw INTERP_KERNEL::Exception("No end array existing.");
-  std::transform(tmp.begin(),tmp.end(),tmp.begin(),std::bind2nd(std::multiplies<double>(),1-alpha));
+  std::transform(tmp.begin(),tmp.end(),tmp.begin(),std::bind(std::multiplies<double>(),std::placeholders::_1,1-alpha));
   std::transform(tmp.begin(),tmp.end(),value,value,std::plus<double>());
 }
 
index 3e0f0f0abb755b2afcf7048b05d5293f6282abd8..3207dd8377867c3695ab129c78930882c53ea0a0 100755 (executable)
@@ -618,7 +618,7 @@ void MEDCouplingUMesh::getReverseNodalConnectivity(DataArrayIdType *revNodal, Da
       const mcIdType *endNdlConnOfCurCell=conn+connIndex[eltId+1];
       for(const mcIdType *iter=strtNdlConnOfCurCell;iter!=endNdlConnOfCurCell;iter++)
         if(*iter>=0)//for polyhedrons
-          *std::find_if(revNodalPtr+revNodalIndxPtr[*iter],revNodalPtr+revNodalIndxPtr[*iter+1],std::bind2nd(std::equal_to<mcIdType>(),-1))=eltId;
+          *std::find_if(revNodalPtr+revNodalIndxPtr[*iter],revNodalPtr+revNodalIndxPtr[*iter+1],std::bind(std::equal_to<mcIdType>(),std::placeholders::_1,-1))=eltId;
     }
 }
 
@@ -1735,7 +1735,7 @@ void MEDCouplingUMesh::FindCommonCellsAlg(int compType, mcIdType startCellId, co
         {
           if(!isFetched[i])
             {
-              const mcIdType *connOfNode=std::find_if(connPtr+connIPtr[i]+1,connPtr+connIPtr[i+1],std::bind2nd(std::not_equal_to<mcIdType>(),-1));
+              const mcIdType *connOfNode=std::find_if(connPtr+connIPtr[i]+1,connPtr+connIPtr[i+1],std::bind(std::not_equal_to<mcIdType>(),std::placeholders::_1,-1));
               std::vector<mcIdType> v,v2;
               if(connOfNode!=connPtr+connIPtr[i+1])
                 {
@@ -1770,7 +1770,7 @@ void MEDCouplingUMesh::FindCommonCellsAlg(int compType, mcIdType startCellId, co
         {
           if(!isFetched[i])
             {
-              const mcIdType *connOfNode=std::find_if(connPtr+connIPtr[i]+1,connPtr+connIPtr[i+1],std::bind2nd(std::not_equal_to<mcIdType>(),-1));
+              const mcIdType *connOfNode=std::find_if(connPtr+connIPtr[i]+1,connPtr+connIPtr[i+1],std::bind(std::not_equal_to<mcIdType>(),std::placeholders::_1,-1));
               // v2 contains the result of successive intersections using rev nodal on on each node of cell #i
               std::vector<mcIdType> v,v2;
               if(connOfNode!=connPtr+connIPtr[i+1])
@@ -3016,7 +3016,7 @@ mcIdType MEDCouplingUMesh::getNumberOfNodesInCell(mcIdType cellId) const
   if(pt[ptI[cellId]]!=INTERP_KERNEL::NORM_POLYHED)
     return ptI[cellId+1]-ptI[cellId]-1;
   else
-    return ToIdType(std::count_if(pt+ptI[cellId]+1,pt+ptI[cellId+1],std::bind2nd(std::not_equal_to<mcIdType>(),-1)));
+    return ToIdType(std::count_if(pt+ptI[cellId]+1,pt+ptI[cellId+1],std::bind(std::not_equal_to<mcIdType>(),std::placeholders::_1,-1)));
 }
 
 /*!
@@ -3253,7 +3253,7 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getMeasureField(bool isAbs) const
           area_vol[iel]=INTERP_KERNEL::computeVolSurfOfCell2<mcIdType,INTERP_KERNEL::ALL_C_MODE>(type,connec+ipt+1,connec_index[iel+1]-ipt-1,coords,dim_space);
         }
       if(isAbs)
-        std::transform(area_vol,area_vol+nbelem,area_vol,std::ptr_fun<double,double>(fabs));
+                 std::transform(area_vol, area_vol + nbelem, area_vol, [](double c) {return fabs(c); }); //std::ptr_fun<double,double>(fabs)
     }
   else
     {
@@ -3306,7 +3306,7 @@ DataArrayDouble *MEDCouplingUMesh::getPartMeasureField(bool isAbs, const mcIdTyp
           *area_vol++=INTERP_KERNEL::computeVolSurfOfCell2<mcIdType,INTERP_KERNEL::ALL_C_MODE>(type,connec+ipt+1,connec_index[*iel+1]-ipt-1,coords,dim_space);
         }
       if(isAbs)
-        std::transform(array->getPointer(),area_vol,array->getPointer(),std::ptr_fun<double,double>(fabs));
+        std::transform(array->getPointer(),area_vol,array->getPointer(), [](double c) {return fabs(c); });
     }
   else
     {
@@ -3403,7 +3403,7 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::buildOrthogonalField() const
               mcIdType offset=connI[i];
               INTERP_KERNEL::crossprod<3>(locPtr+3*i,coords+3*conn[offset+1],coords+3*conn[offset+2],vals);
               double n=INTERP_KERNEL::norm<3>(vals);
-              std::transform(vals,vals+3,vals,std::bind2nd(std::multiplies<double>(),1./n));
+              std::transform(vals,vals+3,vals,std::bind(std::multiplies<double>(),std::placeholders::_1,1./n));
             }
         }
       else
@@ -3422,7 +3422,7 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::buildOrthogonalField() const
           mcIdType offset=connI[i];
           std::transform(coords+2*conn[offset+2],coords+2*conn[offset+2]+2,coords+2*conn[offset+1],tmp,std::minus<double>());
           double n=INTERP_KERNEL::norm<2>(tmp);
-          std::transform(tmp,tmp+2,tmp,std::bind2nd(std::multiplies<double>(),1./n));
+          std::transform(tmp,tmp+2,tmp,std::bind(std::multiplies<double>(),std::placeholders::_1,1./n));
           *vals++=-tmp[1];
           *vals++=tmp[0];
         }
@@ -3482,7 +3482,7 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::buildPartOrthogonalField(const mcIdTyp
               mcIdType offset=connI[*i];
               INTERP_KERNEL::crossprod<3>(locPtr,coords+3*conn[offset+1],coords+3*conn[offset+2],vals);
               double n=INTERP_KERNEL::norm<3>(vals);
-              std::transform(vals,vals+3,vals,std::bind2nd(std::multiplies<double>(),1./n));
+              std::transform(vals,vals+3,vals,std::bind(std::multiplies<double>(),std::placeholders::_1,1./n));
             }
         }
       else
@@ -3499,7 +3499,7 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::buildPartOrthogonalField(const mcIdTyp
           mcIdType offset=connI[*i];
           std::transform(coords+2*conn[offset+2],coords+2*conn[offset+2]+2,coords+2*conn[offset+1],tmp,std::minus<double>());
           double n=INTERP_KERNEL::norm<2>(tmp);
-          std::transform(tmp,tmp+2,tmp,std::bind2nd(std::multiplies<double>(),1./n));
+          std::transform(tmp,tmp+2,tmp,std::bind(std::multiplies<double>(),std::placeholders::_1,1./n));
           *vals++=-tmp[1];
           *vals++=tmp[0];
         }
@@ -6414,7 +6414,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::keepSpecifiedCells(INTERP_KERNEL::Normalized
         for(mcIdType j=0;j<code[3*i+1];j++)
           *idsPtr++=offset+j;
       else
-        idsPtr=std::transform(idsPerGeoTypeBg,idsPerGeoTypeEnd,idsPtr,std::bind2nd(std::plus<mcIdType>(),offset));
+        idsPtr=std::transform(idsPerGeoTypeBg,idsPerGeoTypeEnd,idsPtr,std::bind(std::plus<mcIdType>(),std::placeholders::_1,offset));
       offset+=code[3*i+1];
     }
   MCAuto<MEDCouplingUMesh> ret=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(idsTokeep->begin(),idsTokeep->end(),true));
@@ -6549,7 +6549,7 @@ DataArrayDouble *MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell() const
             }
           mcIdType nbOfNodesInCell=nodalI[i+1]-nodalI[i]-1;
           if(nbOfNodesInCell>0)
-            std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind2nd(std::multiplies<double>(),1./(double)nbOfNodesInCell));
+            std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind(std::multiplies<double>(),std::placeholders::_1,1./(double)nbOfNodesInCell));
           else
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell : on cell #" << i << " presence of cell with no nodes !";
@@ -6571,7 +6571,7 @@ DataArrayDouble *MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell() const
                 }
             }
           if(!s.empty())
-            std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind2nd(std::multiplies<double>(),1./(double)s.size()));
+            std::transform(ptToFill,ptToFill+spaceDim,ptToFill,std::bind(std::multiplies<double>(),std::placeholders::_1,1./(double)s.size()));
           else
             {
               std::ostringstream oss; oss << "MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell : on polyhedron cell #" << i << " there are no nodes !";
@@ -6686,7 +6686,7 @@ DataArrayDouble *MEDCouplingUMesh::computePlaneEquationOf3DFaces() const
               for(mcIdType offset=nodalI[0]+1;offset<nodalI[1];offset++)
                 std::transform(coor+3*nodal[offset],coor+3*(nodal[offset]+1),dd,dd,std::plus<double>());
               mcIdType nbOfNodesInCell(nodalI[1]-nodalI[0]-1);
-              std::transform(dd,dd+3,dd,std::bind2nd(std::multiplies<double>(),1./(double)nbOfNodesInCell));
+              std::transform(dd,dd+3,dd,std::bind(std::multiplies<double>(),std::placeholders::_1,1./(double)nbOfNodesInCell));
               std::copy(dd,dd+3,matrix+4*2);
               INTERP_KERNEL::inverseMatrix(matrix,4,matrix2);
               retPtr[0]=matrix2[3]; retPtr[1]=matrix2[7]; retPtr[2]=matrix2[11]; retPtr[3]=matrix2[15];
@@ -6895,7 +6895,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesOnSameCoords(const std::vector<c
       mcIdType meshLgth2=(*iter)->getNodalConnectivityArrayLen();
       nodalPtr=std::copy(nod,nod+meshLgth2,nodalPtr);
       if(iter!=meshes.begin())
-        nodalIndexPtr=std::transform(index+1,index+nbOfCells+1,nodalIndexPtr,std::bind2nd(std::plus<mcIdType>(),offset));
+        nodalIndexPtr=std::transform(index+1,index+nbOfCells+1,nodalIndexPtr,std::bind(std::plus<mcIdType>(),std::placeholders::_1,offset));
       else
         nodalIndexPtr=std::copy(index,index+nbOfCells+1,nodalIndexPtr);
       offset+=meshLgth2;
index 3cdd52bfe90c8f3ff7eb2f6c394c0c552ee9c4d9..af6598ed51e370a12a5ed9a7c087e71c3a18c3dd 100755 (executable)
@@ -801,7 +801,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildExtrudedMeshFromThisLowLev(mcIdType nbO
   for(mcIdType iz=0;iz<nbOf1DCells;iz++)
     {
       if(iz!=0)
-        std::transform(newConnIPtr+1,newConnIPtr+1+nbOf2DCells,newConnIPtr+1+iz*nbOf2DCells,std::bind2nd(std::plus<mcIdType>(),newConnIPtr[iz*nbOf2DCells]));
+        std::transform(newConnIPtr+1,newConnIPtr+1+nbOf2DCells,newConnIPtr+1+iz*nbOf2DCells,std::bind(std::plus<mcIdType>(), std::placeholders::_1, newConnIPtr[iz*nbOf2DCells]));
       const mcIdType *posOfTypeOfCell(newConnIPtr);
       for(std::vector<mcIdType>::const_iterator iter=newc.begin();iter!=newc.end();iter++,newConnPtr++)
         {
@@ -1342,7 +1342,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesLL(const std::vector<const MEDCo
       mcIdType curNbOfCell=ToIdType((*it)->getNumberOfCells());
       const mcIdType *curCI=(*it)->_nodal_connec_index->begin();
       const mcIdType *curC=(*it)->_nodal_connec->begin();
-      cIPtr=std::transform(curCI+1,curCI+curNbOfCell+1,cIPtr,std::bind2nd(std::plus<mcIdType>(),offset));
+      cIPtr=std::transform(curCI+1,curCI+curNbOfCell+1,cIPtr,std::bind(std::plus<mcIdType>(), std::placeholders::_1, offset));
       for(mcIdType j=0;j<curNbOfCell;j++)
         {
           const mcIdType *src=curC+curCI[j];
@@ -1567,7 +1567,7 @@ void MEDCouplingUMesh::AppendExtrudedCell(const mcIdType *connBg, const mcIdType
         *ii++=-1;
         std::reverse_iterator<const mcIdType *> rConnBg(connEnd);
         std::reverse_iterator<const mcIdType *> rConnEnd(connBg+1);
-        std::transform(rConnBg,rConnEnd,ii,std::bind2nd(std::plus<mcIdType>(),deltaz));
+        std::transform(rConnBg,rConnEnd,ii,std::bind(std::plus<mcIdType>(),std::placeholders::_1,deltaz));
         std::size_t nbOfRadFaces=std::distance(connBg+1,connEnd);
         for(std::size_t i=0;i<nbOfRadFaces;i++)
           {
index 45a642e3ef72cd7f5aa3b58556cda5f925847d6d..be22f881f02640a712de641d965f46b7e1c617b9 100644 (file)
@@ -218,7 +218,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildDescendingConnectivityGen(DataArrayIdTy
       const mcIdType *endNdlConnOfCurCell=connM1+connIndexM1[eltId+1];
       for(const mcIdType *iter=strtNdlConnOfCurCell;iter!=endNdlConnOfCurCell;iter++)
         if(*iter>=0)//for polyhedrons
-          *std::find_if(revNodalPtr+revNodalIndxPtr[*iter],revNodalPtr+revNodalIndxPtr[*iter+1],std::bind2nd(std::equal_to<mcIdType>(),-1))=eltId;
+          *std::find_if(revNodalPtr+revNodalIndxPtr[*iter],revNodalPtr+revNodalIndxPtr[*iter+1],std::bind(std::equal_to<mcIdType>(), std::placeholders::_1,-1))=eltId;
     }
   //
   DataArrayIdType *commonCells=0,*commonCellsI=0;
index 92a6e8d40cb139eb1abea06eeb5e7913115475af..fe2e763bdd0d23d2c1a08b04a531aab1ee27f525 100644 (file)
@@ -1477,8 +1477,8 @@ void InsertNodeInConnIfNecessary(mcIdType nodeIdToInsert, std::vector<mcIdType>&
       mcIdType pt0(conn[i]),pt1(conn[(i+1)%sz]);
       double v1[3]={coords[3*pt1+0]-coords[3*pt0+0],coords[3*pt1+1]-coords[3*pt0+1],coords[3*pt1+2]-coords[3*pt0+2]},v2[3]={coords[3*nodeIdToInsert+0]-coords[3*pt0+0],coords[3*nodeIdToInsert+1]-coords[3*pt0+1],coords[3*nodeIdToInsert+2]-coords[3*pt0+2]};
       double normm(sqrt(v1[0]*v1[0]+v1[1]*v1[1]+v1[2]*v1[2]));
-      std::transform(v1,v1+3,v1,std::bind2nd(std::multiplies<double>(),1./normm));
-      std::transform(v2,v2+3,v2,std::bind2nd(std::multiplies<double>(),1./normm));
+      std::transform(v1,v1+3,v1,std::bind(std::multiplies<double>(),std::placeholders::_1,1./normm));
+      std::transform(v2,v2+3,v2,std::bind(std::multiplies<double>(),std::placeholders::_1,1./normm));
       double v3[3];
       v3[0]=v1[1]*v2[2]-v1[2]*v2[1]; v3[1]=v1[2]*v2[0]-v1[0]*v2[2]; v3[2]=v1[0]*v2[1]-v1[1]*v2[0];
       double normm2(sqrt(v3[0]*v3[0]+v3[1]*v3[1]+v3[2]*v3[2])),dotTest(v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]);
index 64c7b133ac030ca0b421c689a158d5067f7cd938..adb635365120c1cf32ca0b38579182e0a633f66a 100644 (file)
@@ -1385,7 +1385,7 @@ void MEDCouplingBasicsTest1::testMergeField1()
   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); }); //std::ptr_fun<double,double>(fabs)
   double max=*std::max_element(values,values+7);
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
   m4->decrRef();
@@ -1439,7 +1439,7 @@ void MEDCouplingBasicsTest1::testFillFromAnalytic()
   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); }); //std::ptr_fun<double,double>(fabs)
   double max=*std::max_element(values1,values1+5);
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
   f1->decrRef();
@@ -1453,7 +1453,7 @@ void MEDCouplingBasicsTest1::testFillFromAnalytic()
   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); }); //std::ptr_fun<double,double>(fabs)
   max=*std::max_element(values2,values2+9);
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
   f1->decrRef();
@@ -1467,7 +1467,7 @@ void MEDCouplingBasicsTest1::testFillFromAnalytic()
   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); }); //std::ptr_fun<double,double>(fabs)
   max=*std::max_element(values3,values3+18);
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
   double values4[2];
@@ -1497,7 +1497,7 @@ void MEDCouplingBasicsTest1::testFillFromAnalytic2()
   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();
@@ -1511,7 +1511,7 @@ void MEDCouplingBasicsTest1::testFillFromAnalytic2()
   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();
@@ -1524,7 +1524,7 @@ void MEDCouplingBasicsTest1::testFillFromAnalytic2()
   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();
@@ -1538,7 +1538,7 @@ void MEDCouplingBasicsTest1::testFillFromAnalytic2()
   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];
@@ -1572,7 +1572,7 @@ void MEDCouplingBasicsTest1::testApplyFunc()
   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();
@@ -1605,7 +1605,7 @@ void MEDCouplingBasicsTest1::testApplyFunc2()
                       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();
@@ -1618,7 +1618,7 @@ void MEDCouplingBasicsTest1::testApplyFunc2()
   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();
@@ -1639,7 +1639,7 @@ void MEDCouplingBasicsTest1::testOperationsOnFields()
   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();
@@ -1651,7 +1651,7 @@ void MEDCouplingBasicsTest1::testOperationsOnFields()
   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();
@@ -1664,7 +1664,7 @@ void MEDCouplingBasicsTest1::testOperationsOnFields()
   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();
@@ -1695,7 +1695,7 @@ void MEDCouplingBasicsTest1::testOperationsOnFields()
   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();
@@ -1717,7 +1717,7 @@ void MEDCouplingBasicsTest1::testOperationsOnFields()
   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();
index 138bfe200fc3402a6c6c9ca31e48be9985d2e2e8..e91f09fba4d47979532b0eed034920572da50bc3 100644 (file)
@@ -2077,7 +2077,7 @@ void MEDCouplingBasicsTest2::testFillFromAnalytic3()
   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); }); //std::ptr_fun<double,double>(fabs)
   double max=*std::max_element(values1,values1+5);
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
   f1->decrRef();
@@ -2094,7 +2094,7 @@ void MEDCouplingBasicsTest2::testFillFromAnalytic3()
   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();
@@ -2111,12 +2111,12 @@ void MEDCouplingBasicsTest2::testFillFromAnalytic3()
   double values2Bis[9]={-0.9,0.1,1.1,-0.4,0.6,1.6,0.1,1.1,2.1};
   double values2BisBis[9];
   std::transform(tmp,tmp+9,values2Bis,values2BisBis,std::minus<double>());
-  std::transform(values2,values2+9,values2BisBis,std::ptr_fun<double,double>(fabs));
+  std::transform(values2,values2+9,values2BisBis, [](double c) {return fabs(c); });
   max=*std::max_element(values2BisBis,values2BisBis+9);
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
   tmp=f1->getEndArray()->getConstPointer();
   std::transform(tmp,tmp+9,values2Bis,values2BisBis,std::minus<double>());
-  std::transform(values2,values2+9,values2BisBis,std::ptr_fun<double,double>(fabs));
+  std::transform(values2,values2+9,values2BisBis, [](double c) {return fabs(c); });
   max=*std::max_element(values2BisBis,values2BisBis+9);
   CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
   f1->decrRef();
@@ -2132,7 +2132,7 @@ void MEDCouplingBasicsTest2::testFillFromAnalytic3()
   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];
@@ -2240,9 +2240,9 @@ void MEDCouplingBasicsTest2::testAreaBary3D2()
   mcIdType tmpConn[8]={0,1,2,3,4,5,6,7};
   mesh->allocateCells(3);
   mesh->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,tmpConn);
-  std::transform(tmpConn,tmpConn+8,tmpConn,std::bind2nd(std::plus<int>(),8));
+  std::transform(tmpConn,tmpConn+8,tmpConn,std::bind(std::plus<int>(), std::placeholders::_1,8));
   mesh->insertNextCell(INTERP_KERNEL::NORM_PENTA6,6,tmpConn);
-  std::transform(tmpConn,tmpConn+8,tmpConn,std::bind2nd(std::plus<int>(),6));
+  std::transform(tmpConn,tmpConn+8,tmpConn,std::bind(std::plus<int>(),std::placeholders::_1,6));
   mesh->insertNextCell(INTERP_KERNEL::NORM_PYRA5,5,tmpConn);
   mesh->finishInsertingCells();
   mesh->checkConsistencyLight();
index 104575a7b9ae692de90db77060b225a6280e2e36..88594e77ecaa889ebe60fd8a806425a5b4d61595 100644 (file)
@@ -439,7 +439,7 @@ int MEDFileAnyTypeField1TSWithoutSDA::getNonEmptyLevels(const std::string& /*mna
     }
   int ret=*std::max_element(ret1.begin(),ret1.end());
   std::copy(ret1.rbegin(),ret1.rend(),std::back_insert_iterator<std::vector<int> >(levs));
-  std::transform(levs.begin(),levs.end(),levs.begin(),std::bind2nd(std::plus<int>(),-ret));
+  std::transform(levs.begin(),levs.end(),levs.begin(),std::bind(std::plus<int>(),std::placeholders::_1,-ret));
   return ret;
 }
 
index a856382c7c10e1f5feee94ef53587d2354569f28..3ad0ebe193dbbb11d070264b1dd55f5995d580ab 100644 (file)
@@ -1400,7 +1400,7 @@ MEDMeshMultiLev *MEDCMeshMultiLev::prepare() const
   MCAuto<DataArrayIdType> nnr;
   std::vector<mcIdType> cgs,ngs(getNodeGridStructure());
   cgs.resize(ngs.size());
-  std::transform(ngs.begin(),ngs.end(),cgs.begin(),std::bind2nd(std::plus<mcIdType>(),-1));
+  std::transform(ngs.begin(),ngs.end(),cgs.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,-1));
   if(pfl)
     {
       std::vector< std::pair<mcIdType,mcIdType> > cellParts;
@@ -1536,7 +1536,7 @@ MEDMeshMultiLev *MEDCurveLinearMeshMultiLev::prepare() const
   MCAuto<DataArrayIdType> nnr;
   std::vector<mcIdType> cgs,ngs(getNodeGridStructure());
   cgs.resize(ngs.size());
-  std::transform(ngs.begin(),ngs.end(),cgs.begin(),std::bind2nd(std::plus<mcIdType>(),-1));
+  std::transform(ngs.begin(),ngs.end(),cgs.begin(),std::bind(std::plus<mcIdType>(),std::placeholders::_1,-1));
   if(pfl)
     {
       std::vector< std::pair<mcIdType,mcIdType> > cellParts,nodeParts;
index 8a0aa54609f22937f0074f26d34daafe5db3ca66..973c9da0a9bc94b6b8143982544709c2143532cc 100644 (file)
@@ -2241,7 +2241,7 @@ void MEDFileMesh::TranslateFamilyIds(mcIdType offset, DataArrayIdType *famArr, s
     {
       if(offset<0)
         std::transform((*it1).begin(),(*it1).end(),(*it1).begin(),std::negate<mcIdType>());
-      std::transform((*it1).begin(),(*it1).end(),(*it1).begin(),std::bind2nd(std::plus<mcIdType>(),offset));
+      std::transform((*it1).begin(),(*it1).end(),(*it1).begin(),std::bind(std::plus<mcIdType>(), std::placeholders::_1,offset));
     }
 }
 
index 1bcca119178da4ff4796c92a44de86af68c210a1..e366fced3d7f3354fc23433bac7c8dedae7f78da 100644 (file)
@@ -203,7 +203,7 @@ void MEDFileUMeshPerType::loadFromStaticType(med_idt fid, const char *mName, int
   mcIdType nbOfNodesPerCell(mc->getNumberOfNodesPerCell());
   conn->alloc(nbOfNodesPerCell*curNbOfElem,1);
   MEDFILESAFECALLERRD0(MEDmeshElementConnectivityRd,(fid,mName,dt,it,entity,geoElt,MED_NODAL,MED_FULL_INTERLACE,conn->getPointer()));
-  std::transform(conn->begin(),conn->end(),conn->getPointer(),std::bind2nd(std::plus<med_int>(),-1));
+  std::transform(conn->begin(),conn->end(),conn->getPointer(),std::bind(std::plus<med_int>(), std::placeholders::_1,-1));
   mc->setNodalConnectivity(FromMedIntArray<mcIdType>(conn));
   loadCommonPart(fid,mName,dt,it,curNbOfElem,geoElt,entity,mrs);
 }
@@ -228,7 +228,7 @@ void MEDFileUMeshPerType::loadPartStaticType(med_idt fid, const char *mName, int
                            /*lastblocksize=useless because count=1*/0,&filter);
   MEDFILESAFECALLERRD0(MEDmeshElementConnectivityAdvancedRd,(fid,mName,dt,it,entity,geoElt,MED_NODAL,&filter,conn->getPointer()));
   MEDfilterClose(&filter);
-  std::transform(conn->begin(),conn->end(),conn->getPointer(),std::bind2nd(std::plus<med_int>(),-1));
+  std::transform(conn->begin(),conn->end(),conn->getPointer(),std::bind(std::plus<med_int>(),std::placeholders::_1,-1));
   mc->setNodalConnectivity(FromMedIntArray<mcIdType>(conn));
   loadPartOfCellCommonPart(fid,mName,strt,end,step,dt,it,mdim,curNbOfElem,geoElt,entity,mrs);
 }
@@ -304,8 +304,8 @@ void MEDFileUMeshPerType::loadPolyg(med_idt fid, const char *mName, int dt, int
   MCAuto<DataArrayMedInt> conn(DataArrayMedInt::New()),connI(DataArrayMedInt::New());
   conn->alloc(arraySize,1); connI->alloc(curNbOfElem+1,1);
   MEDFILESAFECALLERRD0(MEDmeshPolygon2Rd,(fid,mName,dt,it,MED_CELL,geoElt,MED_NODAL,connI->getPointer(),conn->getPointer()));
-  std::transform(conn->begin(),conn->end(),conn->getPointer(),std::bind2nd(std::plus<med_int>(),-1));
-  std::transform(connI->begin(),connI->end(),connI->getPointer(),std::bind2nd(std::plus<med_int>(),-1));
+  std::transform(conn->begin(),conn->end(),conn->getPointer(),std::bind(std::plus<med_int>(),std::placeholders::_1,-1));
+  std::transform(connI->begin(),connI->end(),connI->getPointer(),std::bind(std::plus<med_int>(),std::placeholders::_1,-1));
   mc->setNodalConnectivity(FromMedIntArray<mcIdType>(conn),FromMedIntArray<mcIdType>(connI));
   loadCommonPart(fid,mName,dt,it,curNbOfElem,geoElt,entity,mrs);
 }
@@ -335,11 +335,11 @@ void MEDFileUMeshPerType::loadPolyh(med_idt fid, const char *mName, int dt, int
   for(mcIdType i=0;i<curNbOfElem;i++)
     {
       finalIndex[i+1]=finalIndex[i]+index[i+1]-index[i]-1+indexFace[index[i+1]-1]-indexFace[index[i]-1];
-      wFinalConn=std::transform(locConn+indexFace[index[i]-1]-1,locConn+indexFace[index[i]]-1,wFinalConn,std::bind2nd(std::plus<mcIdType>(),-1));
+      wFinalConn=std::transform(locConn+indexFace[index[i]-1]-1,locConn+indexFace[index[i]]-1,wFinalConn,std::bind(std::plus<mcIdType>(),std::placeholders::_1,-1));
       for(mcIdType j=index[i];j<index[i+1]-1;j++)
         {
           *wFinalConn++=-1;
-          wFinalConn=std::transform(locConn+indexFace[j]-1,locConn+indexFace[j+1]-1,wFinalConn,std::bind2nd(std::plus<mcIdType>(),-1));
+          wFinalConn=std::transform(locConn+indexFace[j]-1,locConn+indexFace[j+1]-1,wFinalConn,std::bind(std::plus<mcIdType>(),std::placeholders::_1,-1));
         }
     }
   mc->setNodalConnectivity(conn,connI);
@@ -362,7 +362,7 @@ void MEDFileUMeshPerType::Write(med_idt fid, const std::string& mname, int /*mdi
       if(!m0)
         throw INTERP_KERNEL::Exception("MEDFileUMeshPerType::Write : internal error #1 !");
       MCAuto<DataArrayMedInt> arr(DataArrayMedInt::Copy(m0->getNodalConnectivity()));
-      std::transform(arr->begin(),arr->end(),arr->getPointer(),std::bind2nd(std::plus<med_int>(),1));
+      std::transform(arr->begin(),arr->end(),arr->getPointer(),std::bind(std::plus<med_int>(),std::placeholders::_1,1));
       MEDFILESAFECALLERWR0(MEDmeshElementConnectivityWr,(fid,mname.c_str(),dt,it,timm,MED_CELL,curMedType,MED_NODAL,MED_FULL_INTERLACE,ToMedInt(nbOfCells),arr->begin()));
     }
   else
@@ -373,8 +373,8 @@ void MEDFileUMeshPerType::Write(med_idt fid, const std::string& mname, int /*mdi
       if(ikt==INTERP_KERNEL::NORM_POLYGON || ikt==INTERP_KERNEL::NORM_QPOLYG)
         {
           MCAuto<DataArrayMedInt> arr(DataArrayMedInt::Copy(m0->getNodalConnectivity())),arrI(DataArrayMedInt::Copy(m0->getNodalConnectivityIndex()));
-          std::transform(arr->begin(),arr->end(),arr->getPointer(),std::bind2nd(std::plus<med_int>(),1));
-          std::transform(arrI->begin(),arrI->end(),arrI->getPointer(),std::bind2nd(std::plus<med_int>(),1));
+          std::transform(arr->begin(),arr->end(),arr->getPointer(),std::bind(std::plus<med_int>(),std::placeholders::_1,1));
+          std::transform(arrI->begin(),arrI->end(),arrI->getPointer(),std::bind(std::plus<med_int>(),std::placeholders::_1,1));
           MEDFILESAFECALLERWR0(MEDmeshPolygon2Wr,(fid,mname.c_str(),dt,it,timm,MED_CELL,ikt==INTERP_KERNEL::NORM_POLYGON?MED_POLYGON:MED_POLYGON2,MED_NODAL,ToMedInt(nbOfCells+1),arrI->begin(),arr->begin()));
         }
       else
@@ -394,7 +394,7 @@ void MEDFileUMeshPerType::Write(med_idt fid, const std::string& mname, int /*mdi
               for(const mcIdType *w=conn+connI[i];w!=conn+connI[i+1];w2++)
                 {
                   const mcIdType *wend=std::find(w,conn+connI[i+1],-1);
-                  bt=std::transform(w,wend,bt,std::bind2nd(std::plus<mcIdType>(),1));
+                  bt=std::transform(w,wend,bt,std::bind(std::plus<mcIdType>(),std::placeholders::_1,1));
                   std::size_t nbOfNode=std::distance(w,wend);
                   w2[1]=w2[0]+(med_int)nbOfNode;
                   if(wend!=conn+connI[i+1])