-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2024 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
return ret;
}
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::keepSelectedComponents(const std::vector<int>& compoIds) const
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::keepSelectedComponents(const std::vector<std::size_t>& compoIds) const
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
return ret;
}
-void MEDCouplingTimeDiscretization::setSelectedComponents(const MEDCouplingTimeDiscretization *other, const std::vector<int>& compoIds)
+void MEDCouplingTimeDiscretization::setSelectedComponents(const MEDCouplingTimeDiscretization *other, const std::vector<std::size_t>& compoIds)
{
std::vector<DataArrayDouble *> arrays1,arrays2;
getArrays(arrays1);
if(arrays1[i]!=0 && arrays2[i]!=0)
arrays1[i]->setSelectedComponents(arrays2[i],compoIds);
else if(arrays1[i]!=0 || arrays2[i]!=0)
- throw INTERP_KERNEL::Exception("TimeDiscretization::setSelectedComponents : some time array in correspondance are not defined symetrically !");
+ throw INTERP_KERNEL::Exception("TimeDiscretization::setSelectedComponents : some time array in correspondence are not defined symmetrically !");
}
}
-void MEDCouplingTimeDiscretization::changeNbOfComponents(int newNbOfComp, double dftValue)
+void MEDCouplingTimeDiscretization::changeNbOfComponents(std::size_t newNbOfComp, double dftValue)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
}
}
-void MEDCouplingTimeDiscretization::setUniformValue(int nbOfTuple, int nbOfCompo, double value)
+void MEDCouplingTimeDiscretization::setUniformValue(mcIdType nbOfTuple, int nbOfCompo, double value)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::setOrCreateUniformValueOnAllComponents(int nbOfTuple, double value)
+void MEDCouplingTimeDiscretization::setOrCreateUniformValueOnAllComponents(mcIdType nbOfTuple, double value)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
////////////////////////
-MEDCouplingTimeDiscretizationInt::MEDCouplingTimeDiscretizationInt(const MEDCouplingTimeDiscretizationInt& other, bool deepCopy):MEDCouplingTimeDiscretizationSimple<int>(other,deepCopy)
+MEDCouplingTimeDiscretizationInt32::MEDCouplingTimeDiscretizationInt32(const MEDCouplingTimeDiscretizationInt32& other, bool deepCopy):MEDCouplingTimeDiscretizationSimple<Int32>(other,deepCopy)
{
}
-MEDCouplingTimeDiscretizationInt *MEDCouplingTimeDiscretizationInt::performCopyOrIncrRef(bool deepCopy) const
+MEDCouplingTimeDiscretizationInt32 *MEDCouplingTimeDiscretizationInt32::performCopyOrIncrRef(bool deepCopy) const
{
- return new MEDCouplingTimeDiscretizationInt(*this,deepCopy);
+ return new MEDCouplingTimeDiscretizationInt32(*this,deepCopy);
}
-MEDCouplingTimeDiscretizationInt *MEDCouplingTimeDiscretizationInt::New(TypeOfTimeDiscretization type)
+MEDCouplingTimeDiscretizationInt32 *MEDCouplingTimeDiscretizationInt32::New(TypeOfTimeDiscretization type)
{
switch(type)
{
- case MEDCouplingTimeDiscretizationInt::DISCRETIZATION:
- return new MEDCouplingTimeDiscretizationInt;
+ case MEDCouplingTimeDiscretizationInt32::DISCRETIZATION:
+ return new MEDCouplingTimeDiscretizationInt32;
default:
- throw INTERP_KERNEL::Exception("Time discretization not implemented yet for intergers !");
+ throw INTERP_KERNEL::Exception("Time discretization not implemented yet for integers !");
}
}
-bool MEDCouplingTimeDiscretizationInt::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate<int> *other, int prec, std::string& reason) const
+bool MEDCouplingTimeDiscretizationInt32::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate<Int32> *other, Int32 prec, std::string& reason) const
{
if(prec!=0)
throw INTERP_KERNEL::Exception("isEqualIfNotWhy : only precision equal to 0 supported for int !");
reason="Time discretization is NULL.";
return false;
}
- const MEDCouplingTimeDiscretizationInt *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt *>(other));
+ const MEDCouplingTimeDiscretizationInt32 *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt32 *>(other));
if(!otherC)
- throw INTERP_KERNEL::Exception("isEqualIfNotWhy : other is not a MEDCouplingTimeDiscretizationInt !");
- if(!MEDCouplingTimeDiscretizationTemplate<int>::areStrictlyCompatible(other,reason))
+ throw INTERP_KERNEL::Exception("isEqualIfNotWhy : other is not a MEDCouplingTimeDiscretizationInt32 !");
+ if(!MEDCouplingTimeDiscretizationTemplate<Int32>::areStrictlyCompatible(other,reason))
return false;
if(!_tk.isEqualIfNotWhy(otherC->_tk,_time_tolerance,reason))
return false;
return _array->isEqualIfNotWhy(*other->getArray(),reason);
}
-bool MEDCouplingTimeDiscretizationInt::isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate<int> *other, int prec) const
+bool MEDCouplingTimeDiscretizationInt32::isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate<Int32> *other, Int32 prec) const
{
if(prec!=0)
- throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretizationInt::isEqualWithoutConsideringStr : only precision 0 is supported !");
- const MEDCouplingTimeDiscretizationInt *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt *>(other));
+ throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretizationInt32::isEqualWithoutConsideringStr : only precision 0 is supported !");
+ const MEDCouplingTimeDiscretizationInt32 *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt32 *>(other));
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("isEqualWithoutConsideringStr : other is not a MEDCouplingTimeDiscretizationInt !");
+ std::string tmp;
+ if(!areStrictlyCompatible(other,tmp))
+ return false;
+ std::string reason;
+ if(!_tk.isEqualIfNotWhy(otherC->_tk,_time_tolerance,reason))
+ return false;
+ if(_array==other->getArray())
+ return true;
+ return _array->isEqualWithoutConsideringStr(*(other->getArray()));
+}
+
+////////////////////////
+
+MEDCouplingTimeDiscretizationInt64::MEDCouplingTimeDiscretizationInt64(const MEDCouplingTimeDiscretizationInt64& other, bool deepCopy):MEDCouplingTimeDiscretizationSimple<Int64>(other,deepCopy)
+{
+}
+
+MEDCouplingTimeDiscretizationInt64 *MEDCouplingTimeDiscretizationInt64::performCopyOrIncrRef(bool deepCopy) const
+{
+ return new MEDCouplingTimeDiscretizationInt64(*this,deepCopy);
+}
+
+MEDCouplingTimeDiscretizationInt64 *MEDCouplingTimeDiscretizationInt64::New(TypeOfTimeDiscretization type)
+{
+ switch(type)
+ {
+ case MEDCouplingTimeDiscretizationInt64::DISCRETIZATION:
+ return new MEDCouplingTimeDiscretizationInt64;
+ default:
+ throw INTERP_KERNEL::Exception("Time discretization not implemented yet for integers !");
+ }
+}
+
+bool MEDCouplingTimeDiscretizationInt64::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate<Int64> *other, Int64 prec, std::string& reason) const
+{
+ if(prec!=0)
+ throw INTERP_KERNEL::Exception("isEqualIfNotWhy : only precision equal to 0 supported for int !");
+ if(!other)
+ {
+ reason="Time discretization is NULL.";
+ return false;
+ }
+ const MEDCouplingTimeDiscretizationInt64 *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt64 *>(other));
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("isEqualIfNotWhy : other is not a MEDCouplingTimeDiscretizationInt64 !");
+ if(!MEDCouplingTimeDiscretizationTemplate<Int64>::areStrictlyCompatible(other,reason))
+ return false;
+ if(!_tk.isEqualIfNotWhy(otherC->_tk,_time_tolerance,reason))
+ return false;
+ if(_array==other->getArray())
+ return true;
+ return _array->isEqualIfNotWhy(*other->getArray(),reason);
+}
+
+bool MEDCouplingTimeDiscretizationInt64::isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate<Int64> *other, Int64 prec) const
+{
+ if(prec!=0)
+ throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretizationInt64::isEqualWithoutConsideringStr : only precision 0 is supported !");
+ const MEDCouplingTimeDiscretizationInt64 *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt64 *>(other));
if(!otherC)
throw INTERP_KERNEL::Exception("isEqualWithoutConsideringStr : other is not a MEDCouplingTimeDiscretizationInt !");
std::string tmp;
case MEDCouplingTimeDiscretizationFloat::DISCRETIZATION:
return new MEDCouplingTimeDiscretizationFloat;
default:
- throw INTERP_KERNEL::Exception("Time discretization not implemented yet for intergers !");
+ throw INTERP_KERNEL::Exception("Time discretization not implemented yet for integers !");
}
}
bool MEDCouplingTimeDiscretizationFloat::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate<float> *other, float prec, std::string& reason) const
{
- if(prec!=0)
- throw INTERP_KERNEL::Exception("isEqualIfNotWhy : only precision equal to 0 supported for int !");
if(!other)
{
reason="Time discretization is NULL.";
throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
}
-void MEDCouplingNoTimeLabel::getValueOnTime(int eltId, double time, double *value) const
+void MEDCouplingNoTimeLabel::getValueOnTime(mcIdType eltId, double time, double *value) const
{
throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
}
-void MEDCouplingNoTimeLabel::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const
+void MEDCouplingNoTimeLabel::getValueOnDiscTime(mcIdType eltId, int iteration, int order, double *value) const
{
throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
}
/*!
* idem getTinySerializationIntInformation except that it is for multi field fetch
*/
-void MEDCouplingNoTimeLabel::getTinySerializationIntInformation2(std::vector<int>& tinyInfo) const
+void MEDCouplingNoTimeLabel::getTinySerializationIntInformation2(std::vector<mcIdType>& tinyInfo) const
{
tinyInfo.clear();
}
/*!
* idem finishUnserialization except that it is for multi field fetch
*/
-void MEDCouplingNoTimeLabel::finishUnserialization2(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD)
+void MEDCouplingNoTimeLabel::finishUnserialization2(const std::vector<mcIdType>& tinyInfoI, const std::vector<double>& tinyInfoD)
{
_time_tolerance=tinyInfoD[0];
}
setTimeUnit(tUnit);
}
-void MEDCouplingWithTimeStep::getTinySerializationIntInformation(std::vector<int>& tinyInfo) const
+void MEDCouplingWithTimeStep::getTinySerializationIntInformation(std::vector<mcIdType>& tinyInfo) const
{
MEDCouplingTimeDiscretization::getTinySerializationIntInformation(tinyInfo);
tinyInfo.push_back(_tk.getIteration());
tinyInfo.push_back(_tk.getTimeValue());
}
-void MEDCouplingWithTimeStep::finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD, const std::vector<std::string>& tinyInfoS)
+void MEDCouplingWithTimeStep::finishUnserialization(const std::vector<mcIdType>& tinyInfoI, const std::vector<double>& tinyInfoD, const std::vector<std::string>& tinyInfoS)
{
MEDCouplingTimeDiscretization::finishUnserialization(tinyInfoI,tinyInfoD,tinyInfoS);
_tk.setTimeValue(tinyInfoD[1]);
- _tk.setIteration(tinyInfoI[2]);
- _tk.setOrder(tinyInfoI[3]);
+ _tk.setIteration(FromIdType<int>(tinyInfoI[2]));
+ _tk.setOrder(FromIdType<int>(tinyInfoI[3]));
}
/*!
* idem getTinySerializationIntInformation except that it is for multi field fetch
*/
-void MEDCouplingWithTimeStep::getTinySerializationIntInformation2(std::vector<int>& tinyInfo) const
+void MEDCouplingWithTimeStep::getTinySerializationIntInformation2(std::vector<mcIdType>& tinyInfo) const
{
tinyInfo.resize(2);
tinyInfo[0]=_tk.getIteration();
/*!
* idem finishUnserialization except that it is for multi field fetch
*/
-void MEDCouplingWithTimeStep::finishUnserialization2(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD)
+void MEDCouplingWithTimeStep::finishUnserialization2(const std::vector<mcIdType>& tinyInfoI, const std::vector<double>& tinyInfoD)
{
- _tk.setIteration(tinyInfoI[0]);
- _tk.setOrder(tinyInfoI[1]);
+ _tk.setIteration(FromIdType<int>(tinyInfoI[0]));
+ _tk.setOrder(FromIdType<int>(tinyInfoI[1]));
_time_tolerance=tinyInfoD[0];
_tk.setTimeValue(tinyInfoD[1]);
}
std::copy(vals.begin(),vals.end(),res);
}
-void MEDCouplingWithTimeStep::getValueOnTime(int eltId, double time, double *value) const
+void MEDCouplingWithTimeStep::getValueOnTime(mcIdType eltId, double time, double *value) const
{
if(std::fabs(time-_tk.getTimeValue())<=_time_tolerance)
if(_array)
throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
}
-void MEDCouplingWithTimeStep::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const
+void MEDCouplingWithTimeStep::getValueOnDiscTime(mcIdType eltId, int iteration, int order, double *value) const
{
if(_tk.getIteration()==iteration && _tk.getOrder()==order)
if(_array)
_end.copyFrom(otherC->_end);
}
-void MEDCouplingConstOnTimeInterval::getTinySerializationIntInformation(std::vector<int>& tinyInfo) const
+void MEDCouplingConstOnTimeInterval::getTinySerializationIntInformation(std::vector<mcIdType>& tinyInfo) const
{
MEDCouplingTimeDiscretization::getTinySerializationIntInformation(tinyInfo);
tinyInfo.push_back(_start.getIteration());
tinyInfo.push_back(_end.getTimeValue());
}
-void MEDCouplingConstOnTimeInterval::finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD, const std::vector<std::string>& tinyInfoS)
+void MEDCouplingConstOnTimeInterval::finishUnserialization(const std::vector<mcIdType>& tinyInfoI, const std::vector<double>& tinyInfoD, const std::vector<std::string>& tinyInfoS)
{
MEDCouplingTimeDiscretization::finishUnserialization(tinyInfoI,tinyInfoD,tinyInfoS);
_start.setTimeValue(tinyInfoD[1]);
_end.setTimeValue(tinyInfoD[2]);
- _start.setIteration(tinyInfoI[2]);
- _start.setOrder(tinyInfoI[3]);
- _end.setIteration(tinyInfoI[4]);
- _end.setOrder(tinyInfoI[5]);
+ _start.setIteration(FromIdType<int>(tinyInfoI[2]));
+ _start.setOrder(FromIdType<int>(tinyInfoI[3]));
+ _end.setIteration(FromIdType<int>(tinyInfoI[4]));
+ _end.setOrder(FromIdType<int>(tinyInfoI[5]));
}
/*!
* idem getTinySerializationIntInformation except that it is for multi field fetch
*/
-void MEDCouplingConstOnTimeInterval::getTinySerializationIntInformation2(std::vector<int>& tinyInfo) const
+void MEDCouplingConstOnTimeInterval::getTinySerializationIntInformation2(std::vector<mcIdType>& tinyInfo) const
{
tinyInfo.resize(4);
tinyInfo[0]=_start.getIteration();
/*!
* idem finishUnserialization except that it is for multi field fetch
*/
-void MEDCouplingConstOnTimeInterval::finishUnserialization2(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD)
+void MEDCouplingConstOnTimeInterval::finishUnserialization2(const std::vector<mcIdType>& tinyInfoI, const std::vector<double>& tinyInfoD)
{
- _start.setIteration(tinyInfoI[0]);
- _start.setOrder(tinyInfoI[1]);
- _end.setIteration(tinyInfoI[2]);
- _end.setOrder(tinyInfoI[3]);
+ _start.setIteration(FromIdType<int>(tinyInfoI[0]));
+ _start.setOrder(FromIdType<int>(tinyInfoI[1]));
+ _end.setIteration(FromIdType<int>(tinyInfoI[2]));
+ _end.setOrder(FromIdType<int>(tinyInfoI[3]));
_time_tolerance=tinyInfoD[0];
_start.setTimeValue(tinyInfoD[1]);
_end.setTimeValue(tinyInfoD[2]);
return MEDCouplingTimeDiscretization::isEqualWithoutConsideringStr(other,prec);
}
-void MEDCouplingConstOnTimeInterval::getValueOnTime(int eltId, double time, double *value) const
+void MEDCouplingConstOnTimeInterval::getValueOnTime(mcIdType eltId, double time, double *value) const
{
if(time>_start.getTimeValue()-_time_tolerance && time<_end.getTimeValue()+_time_tolerance)
if(_array)
throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
}
-void MEDCouplingConstOnTimeInterval::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const
+void MEDCouplingConstOnTimeInterval::getValueOnDiscTime(mcIdType eltId, int iteration, int order, double *value) const
{
if(iteration>=_start.getIteration() && iteration<=_end.getIteration())
if(_array)
}
}
-void MEDCouplingTwoTimeSteps::getTinySerializationIntInformation(std::vector<int>& tinyInfo) const
+void MEDCouplingTwoTimeSteps::getTinySerializationIntInformation(std::vector<mcIdType>& tinyInfo) const
{
MEDCouplingTimeDiscretization::getTinySerializationIntInformation(tinyInfo);
tinyInfo.push_back(_start.getIteration());
if(_end_array)
{
tinyInfo.push_back(_end_array->getNumberOfTuples());
- tinyInfo.push_back(_end_array->getNumberOfComponents());
+ tinyInfo.push_back(ToIdType(_end_array->getNumberOfComponents()));
}
else
{
void MEDCouplingTwoTimeSteps::getTinySerializationStrInformation(std::vector<std::string>& tinyInfo) const
{
- int nbOfCompo=_array->getNumberOfComponents();
- for(int i=0;i<nbOfCompo;i++)
+ std::size_t nbOfCompo=_array->getNumberOfComponents();
+ for(std::size_t i=0;i<nbOfCompo;i++)
tinyInfo.push_back(_array->getInfoOnComponent(i));
- for(int i=0;i<nbOfCompo;i++)
+ for(std::size_t i=0;i<nbOfCompo;i++)
tinyInfo.push_back(_end_array->getInfoOnComponent(i));
}
-void MEDCouplingTwoTimeSteps::resizeForUnserialization(const std::vector<int>& tinyInfoI, std::vector<DataArrayDouble *>& arrays)
+void MEDCouplingTwoTimeSteps::resizeForUnserialization(const std::vector<mcIdType>& tinyInfoI, std::vector<DataArrayDouble *>& arrays)
{
arrays.resize(2);
if(_array!=0)
arrays[1]=arr;
}
-void MEDCouplingTwoTimeSteps::checkForUnserialization(const std::vector<int>& tinyInfoI, const std::vector<DataArrayDouble *>& arrays)
+void MEDCouplingTwoTimeSteps::checkForUnserialization(const std::vector<mcIdType>& tinyInfoI, const std::vector<DataArrayDouble *>& arrays)
{
static const char MSG[]="MEDCouplingTimeDiscretization::checkForUnserialization : arrays in input is expected to have size two !";
if(arrays.size()!=2)
}
}
-void MEDCouplingTwoTimeSteps::finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD, const std::vector<std::string>& tinyInfoS)
+void MEDCouplingTwoTimeSteps::finishUnserialization(const std::vector<mcIdType>& tinyInfoI, const std::vector<double>& tinyInfoD, const std::vector<std::string>& tinyInfoS)
{
MEDCouplingTimeDiscretization::finishUnserialization(tinyInfoI,tinyInfoD,tinyInfoS);
_start.setTimeValue(tinyInfoD[1]);
_end.setTimeValue(tinyInfoD[2]);
- _start.setIteration(tinyInfoI[2]);
- _start.setOrder(tinyInfoI[3]);
- _end.setIteration(tinyInfoI[4]);
- _end.setOrder(tinyInfoI[5]);
+ _start.setIteration(FromIdType<int>(tinyInfoI[2]));
+ _start.setOrder(FromIdType<int>(tinyInfoI[3]));
+ _end.setIteration(FromIdType<int>(tinyInfoI[4]));
+ _end.setOrder(FromIdType<int>(tinyInfoI[5]));
}
/*!
* idem getTinySerializationIntInformation except that it is for multi field fetch
*/
-void MEDCouplingTwoTimeSteps::getTinySerializationIntInformation2(std::vector<int>& tinyInfo) const
+void MEDCouplingTwoTimeSteps::getTinySerializationIntInformation2(std::vector<mcIdType>& tinyInfo) const
{
tinyInfo.resize(4);
tinyInfo[0]=_start.getIteration();
/*!
* idem finishUnserialization except that it is for multi field fetch
*/
-void MEDCouplingTwoTimeSteps::finishUnserialization2(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD)
+void MEDCouplingTwoTimeSteps::finishUnserialization2(const std::vector<mcIdType>& tinyInfoI, const std::vector<double>& tinyInfoD)
{
- _start.setIteration(tinyInfoI[0]);
- _start.setOrder(tinyInfoI[1]);
- _end.setIteration(tinyInfoI[2]);
- _end.setOrder(tinyInfoI[3]);
+ _start.setIteration(FromIdType<int>(tinyInfoI[0]));
+ _start.setOrder(FromIdType<int>(tinyInfoI[1]));
+ _end.setIteration(FromIdType<int>(tinyInfoI[2]));
+ _end.setOrder(FromIdType<int>(tinyInfoI[3]));
_time_tolerance=tinyInfoD[0];
_start.setTimeValue(tinyInfoD[1]);
_end.setTimeValue(tinyInfoD[2]);
return true;
if(_end_array==0 || otherC->_end_array==0)
return false;
- int nbC1=_end_array->getNumberOfComponents();
- int nbC2=otherC->_end_array->getNumberOfComponents();
+ std::size_t nbC1=_end_array->getNumberOfComponents();
+ std::size_t nbC2=otherC->_end_array->getNumberOfComponents();
if(nbC1!=nbC2 && nbC2!=1)
return false;
return true;
{
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>());
}
-void MEDCouplingLinearTime::getValueOnTime(int eltId, double time, double *value) const
+void MEDCouplingLinearTime::getValueOnTime(mcIdType eltId, double time, double *value) const
{
double alpha=(_end.getTimeValue()-time)/(_end.getTimeValue()-_start.getTimeValue());
- int nbComp;
if(_array)
_array->getTuple(eltId,value);
else
throw INTERP_KERNEL::Exception("No start array existing.");
- nbComp=_array->getNumberOfComponents();
- std::transform(value,value+nbComp,value,std::bind2nd(std::multiplies<double>(),alpha));
+ std::size_t nbComp=_array->getNumberOfComponents();
+ 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>());
}
-void MEDCouplingLinearTime::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const
+void MEDCouplingLinearTime::getValueOnDiscTime(mcIdType eltId, int iteration, int order, double *value) const
{
if(iteration==_start.getIteration() && order==_start.getOrder())
{