namespace STLEXT
{
template<typename _Pair>
- struct Select1st : public std::unary_function<_Pair, typename _Pair::first_type>
+ struct Select1st
{
typename _Pair::first_type& operator()(_Pair& __x) const { return __x.first; }
const typename _Pair::first_type&operator()(const _Pair& __x) const { return __x.first; }
#include <cmath>
#include <limits>
#include <algorithm>
+#include <functional>
#ifdef WIN32
-#include <functional>
+#pragma warning(disable: 4100)
#endif
using namespace INTERP_KERNEL;
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);});
}
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);});
}
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
{
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));
return ret;
}
{
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);});
return ret;
}
{
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);});
return ret;
}
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;
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++)
*/
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);
*/
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;
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));
}
/*!
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.));
}
}
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)
{
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::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)));
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();
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:
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 !");
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:
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();
}
{
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();
}
//
{
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;
}
}
}
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
}
}
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 << " !";
{
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;
}
}
}
#include <sstream>
#include <fstream>
-
-#ifdef WIN32
#include <functional>
-#endif
using namespace MEDCoupling;
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));
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++)
{
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)
{
{
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]));
}
/*!
{
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();
}
}
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++)
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);
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);
//
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)));
}
}
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)));
}
}
{
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();
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();
{
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)
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));
}
/*!
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);});
}
/*!
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>());
}
}
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);});
//if(!std::equal(ptSrc+i*nbOfComp,ptSrc+(i+1)*nbOfComp,ptToFill+newNb*nbOfComp))
if(*std::max_element((double *)tmp,((double *)tmp)+nbOfComp)>eps)
{
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>());
}
}
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];
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();
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();
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 !";
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));
}
/*!
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);});
return *std::max_element(tmp.begin(),tmp.end())<eps;
}
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());
//
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)
{
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();
//
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)
{
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();
//
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)
{
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();
}
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());
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();
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());
}
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)
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());
}
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];
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];
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);
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();
}
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
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);});
this->declareAsNew();
}
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);});
newArr->copyStringInfoFrom(*this);
return newArr.retn();
}
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)
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();
}
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();
}
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);
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();
}
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();
}
{
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);
}
}
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);
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();
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);});
if(*std::max_element(n1.begin(),n1.end())>prec)
return false;
}
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);
//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);
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 !");
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>());
}
}
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>());
}
}
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;
}
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));
}
}
}
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;
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;
}
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);
}
{
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>());
}
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>());
}
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;
}
}
{
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])
{
{
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])
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)));
}
/*!
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);});
}
else
{
*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
{
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
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];
}
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
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];
}
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));
}
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 !";
}
}
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 !";
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];
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;
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++)
{
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];
*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++)
{
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;
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]);
double values[7]={0.25,0.125,0.125,0.25,0.25,0.5,0.5};
const double *tmp=f3->getArray()->getConstPointer();
std::transform(tmp,tmp+7,values,values,std::minus<double>());
- std::transform(values,values+7,values,std::ptr_fun<double,double>(fabs));
+ std::transform(values,values+7,values,[](double c){return fabs(c);});
double max=*std::max_element(values,values+7);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
m4->decrRef();
double values1[5]={-0.1,0.23333333333333336,0.56666666666666665,0.4,0.9};
const double *tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+5,values1,values1,std::minus<double>());
- std::transform(values1,values1+5,values1,std::ptr_fun<double,double>(fabs));
+ std::transform(values1,values1+5,values1,[](double c){return fabs(c);});
double max=*std::max_element(values1,values1+5);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
double values2[9]={-0.6,-0.1,0.4,-0.1,0.4,0.9,0.4,0.9,1.4};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values2,values2,std::minus<double>());
- std::transform(values2,values2+9,values2,std::ptr_fun<double,double>(fabs));
+ std::transform(values2,values2+9,values2,[](double c){return fabs(c);});
max=*std::max_element(values2,values2+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
double values3[18]={-0.6,-1.2,-0.1,-0.2,0.4,0.8,-0.1,-0.2,0.4,0.8,0.9,1.8,0.4,0.8,0.9,1.8,1.4,2.8};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+18,values3,values3,std::minus<double>());
- std::transform(values3,values3+18,values3,std::ptr_fun<double,double>(fabs));
+ std::transform(values3,values3+18,values3,[](double c){return fabs(c);});
max=*std::max_element(values3,values3+18);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
double values4[2];
double values1[5]={-0.1,0.23333333333333336,0.56666666666666665,0.4,0.9};
const double *tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+5,values1,values1,std::minus<double>());
- std::transform(values1,values1+5,values1,std::ptr_fun<double,double>(fabs));
+ std::transform(values1,values1+5,values1,[](double c){return fabs(c);});
double max=*std::max_element(values1,values1+5);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
double values2[9]={-0.9,0.1,1.1,-0.4,0.6,1.6,0.1,1.1,2.1};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values2,values2,std::minus<double>());
- std::transform(values2,values2+9,values2,std::ptr_fun<double,double>(fabs));
+ std::transform(values2,values2+9,values2,[](double c){return fabs(c);});
max=*std::max_element(values2,values2+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
tmp=f1->getArray()->getConstPointer();
double values2Bis[9]={-0.9,0.1,1.1,-0.4,0.6,1.6,0.1,1.1,2.1};
std::transform(tmp,tmp+9,values2Bis,values2Bis,std::minus<double>());
- std::transform(values2,values2+9,values2Bis,std::ptr_fun<double,double>(fabs));
+ std::transform(values2,values2+9,values2Bis,[](double c){return fabs(c);});
max=*std::max_element(values2Bis,values2Bis+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
double values3[18]={-0.6,-1.2,-0.1,-0.2,0.4,0.8,-0.1,-0.2,0.4,0.8,0.9,1.8,0.4,0.8,0.9,1.8,1.4,2.8};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+18,values3,values3,std::minus<double>());
- std::transform(values3,values3+18,values3,std::ptr_fun<double,double>(fabs));
+ std::transform(values3,values3+18,values3,[](double c){return fabs(c);});
max=*std::max_element(values3,values3+18);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
double values4[2];
double values1[9]={-1.8,-0.3,1.2,-0.3,1.2,2.7,1.2,2.7,4.2};
const double *tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values1,values1,std::minus<double>());
- std::transform(values1,values1+9,values1,std::ptr_fun<double,double>(fabs));
+ std::transform(values1,values1+9,values1,[](double c){return fabs(c);});
double max=*std::max_element(values1,values1+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
5.0423700574830965, 17.435300118916864};
const double *tmp=f2->getArray()->getConstPointer();
std::transform(tmp,tmp+18,values2,values2,std::minus<double>());
- std::transform(values2,values2+18,values2,std::ptr_fun<double,double>(fabs));
+ std::transform(values2,values2+18,values2,[](double c){return fabs(c);});
double max=*std::max_element(values2,values2+18);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f2->decrRef();
double values1[9]={-1.8,-0.3,1.2,-0.3,1.2,2.7,1.2,2.7,4.2};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values1,values1,std::minus<double>());
- std::transform(values1,values1+9,values1,std::ptr_fun<double,double>(fabs));
+ std::transform(values1,values1+9,values1,[](double c){return fabs(c);});
max=*std::max_element(values1,values1+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
double values1[9]={-1.2,-0.2,0.8,-0.2,0.8,1.8,0.8,1.8,2.8};
const double *tmp=f3->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values1,values1,std::minus<double>());
- std::transform(values1,values1+9,values1,std::ptr_fun<double,double>(fabs));
+ std::transform(values1,values1+9,values1,[](double c){return fabs(c);});
double max=*std::max_element(values1,values1+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f3->decrRef();
double values2[9]={0.36,0.01,0.16,0.01,0.16,0.81,0.16,0.81,1.96};
tmp=f3->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values2,values2,std::minus<double>());
- std::transform(values2,values2+9,values2,std::ptr_fun<double,double>(fabs));
+ std::transform(values2,values2+9,values2,[](double c){return fabs(c);});
max=*std::max_element(values2,values2+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f3->decrRef();
double values3[9]={0.6,0.1,-0.4,0.1,-0.4,-0.9,-0.4,-0.9,-1.4};
tmp=f4->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values3,values3,std::minus<double>());
- std::transform(values3,values3+9,values3,std::ptr_fun<double,double>(fabs));
+ std::transform(values3,values3+9,values3,[](double c){return fabs(c);});
max=*std::max_element(values3,values3+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f3->decrRef();
tmp=f3->getArray()->getConstPointer();
double values4[9]={-1.2,-0.2,0.8,-0.2,0.8,1.8,0.8,1.8,2.8};
std::transform(tmp,tmp+9,values4,values4,std::minus<double>());
- std::transform(values4,values4+9,values4,std::ptr_fun<double,double>(fabs));
+ std::transform(values4,values4+9,values4,[](double c){return fabs(c);});
max=*std::max_element(values4,values4+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f5->decrRef();
tmp=f3->getArray()->getConstPointer();
double values5[9]={-1.2,-0.2,0.8,-0.2,0.8,1.8,0.8,1.8,2.8};
std::transform(tmp,tmp+9,values5,values5,std::minus<double>());
- std::transform(values5,values5+9,values5,std::ptr_fun<double,double>(fabs));
+ std::transform(values5,values5+9,values5,[](double c){return fabs(c);});
max=*std::max_element(values5,values5+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f5->decrRef();
double values1[5]={-0.1,0.23333333333333336,0.56666666666666665,0.4,0.9};
const double *tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+5,values1,values1,std::minus<double>());
- std::transform(values1,values1+5,values1,std::ptr_fun<double,double>(fabs));
+ std::transform(values1,values1+5,values1,[](double c){return fabs(c);});
double max=*std::max_element(values1,values1+5);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
double values2[9]={-0.9,0.1,1.1,-0.4,0.6,1.6,0.1,1.1,2.1};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values2,values2,std::minus<double>());
- std::transform(values2,values2+9,values2,std::ptr_fun<double,double>(fabs));
+ std::transform(values2,values2+9,values2,[](double c){return fabs(c);});
max=*std::max_element(values2,values2+9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
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();
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];
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();
}
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;
}
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;
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;
{
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));
}
}
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);
}
/*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);
}
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);
}
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);
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
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
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])