mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-09-07 13:18:19 +08:00
Coding - Rework of Math global functions to stl (#833)
Majority of functions now simply call same functions from std namespace. Functions that duplicate std namespace functionality are declared deprecated. Calls of deprecated functions are replaced with std functions calls.
This commit is contained in:
@@ -205,13 +205,13 @@ void AdvApp2Var_ApproxAFunc2Var::Init()
|
||||
default:
|
||||
throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : VContinuity Error");
|
||||
}
|
||||
ndu = Max(myMaxDegInU + 1, 2 * iu + 2);
|
||||
ndv = Max(myMaxDegInV + 1, 2 * iv + 2);
|
||||
ndu = std::max(myMaxDegInU + 1, 2 * iu + 2);
|
||||
ndv = std::max(myMaxDegInV + 1, 2 * iv + 2);
|
||||
if (ndu < 2 * iu + 2)
|
||||
throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : UMaxDegree Error");
|
||||
if (ndv < 2 * iv + 2)
|
||||
throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : VMaxDegree Error");
|
||||
myPrecisionCode = Max(0, Min(myPrecisionCode, 3));
|
||||
myPrecisionCode = std::max(0, std::min(myPrecisionCode, 3));
|
||||
AdvApp2Var_Context Conditions(ifav,
|
||||
iu,
|
||||
iv,
|
||||
@@ -825,16 +825,16 @@ void AdvApp2Var_ApproxAFunc2Var::Compute3DErrors()
|
||||
F4Tol = my3DTolOnFront->Value(iesp, 4);
|
||||
for (ipat = 1; ipat <= myResult.NbPatch(); ipat++)
|
||||
{
|
||||
error_max = Max((myResult(ipat).MaxErrors())->Value(iesp), error_max);
|
||||
error_U0 = Max((myResult(ipat).IsoErrors())->Value(iesp, 3), error_U0);
|
||||
error_U1 = Max((myResult(ipat).IsoErrors())->Value(iesp, 4), error_U1);
|
||||
error_V0 = Max((myResult(ipat).IsoErrors())->Value(iesp, 1), error_V0);
|
||||
error_V1 = Max((myResult(ipat).IsoErrors())->Value(iesp, 2), error_V1);
|
||||
error_max = std::max((myResult(ipat).MaxErrors())->Value(iesp), error_max);
|
||||
error_U0 = std::max((myResult(ipat).IsoErrors())->Value(iesp, 3), error_U0);
|
||||
error_U1 = std::max((myResult(ipat).IsoErrors())->Value(iesp, 4), error_U1);
|
||||
error_V0 = std::max((myResult(ipat).IsoErrors())->Value(iesp, 1), error_V0);
|
||||
error_V1 = std::max((myResult(ipat).IsoErrors())->Value(iesp, 2), error_V1);
|
||||
error_moy += (myResult(ipat).AverageErrors())->Value(iesp);
|
||||
}
|
||||
my3DMaxError->SetValue(iesp, error_max);
|
||||
my3DUFrontError->SetValue(iesp, Max(error_U0, error_U1));
|
||||
my3DVFrontError->SetValue(iesp, Max(error_V0, error_V1));
|
||||
my3DUFrontError->SetValue(iesp, std::max(error_U0, error_U1));
|
||||
my3DVFrontError->SetValue(iesp, std::max(error_V0, error_V1));
|
||||
error_moy /= (Standard_Real)myResult.NbPatch();
|
||||
my3DAverageError->SetValue(iesp, error_moy);
|
||||
if (error_max > Tol || error_U0 > F3Tol || error_U1 > F4Tol || error_V0 > F1Tol
|
||||
@@ -863,7 +863,7 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeCritError()
|
||||
crit_max = 0.;
|
||||
for (ipat = 1; ipat <= myResult.NbPatch(); ipat++)
|
||||
{
|
||||
crit_max = Max((myResult(ipat).CritValue()), crit_max);
|
||||
crit_max = std::max((myResult(ipat).CritValue()), crit_max);
|
||||
}
|
||||
myCriterionError = crit_max;
|
||||
}
|
||||
|
||||
@@ -152,8 +152,8 @@ void AdvApp2Var_Network::SameDegree(const Standard_Integer iu,
|
||||
for (AdvApp2Var_SequenceOfPatch::Iterator aPatIter(myNet); aPatIter.More(); aPatIter.Next())
|
||||
{
|
||||
const Handle(AdvApp2Var_Patch)& aPat = aPatIter.Value();
|
||||
ncfu = Max(ncfu, aPat->NbCoeffInU());
|
||||
ncfv = Max(ncfv, aPat->NbCoeffInV());
|
||||
ncfu = std::max(ncfu, aPat->NbCoeffInU());
|
||||
ncfv = std::max(ncfv, aPat->NbCoeffInV());
|
||||
}
|
||||
|
||||
// augmentation des nombres de coeff.
|
||||
|
||||
@@ -34,8 +34,8 @@ AdvApp2Var_Node::AdvApp2Var_Node()
|
||||
//=================================================================================================
|
||||
|
||||
AdvApp2Var_Node::AdvApp2Var_Node(const Standard_Integer iu, const Standard_Integer iv)
|
||||
: myTruePoints(0, Max(0, iu), 0, Max(0, iv)),
|
||||
myErrors(0, Max(0, iu), 0, Max(0, iv)),
|
||||
: myTruePoints(0, std::max(0, iu), 0, std::max(0, iv)),
|
||||
myErrors(0, std::max(0, iu), 0, std::max(0, iv)),
|
||||
myOrdInU(iu),
|
||||
myOrdInV(iv)
|
||||
{
|
||||
|
||||
@@ -313,7 +313,7 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions
|
||||
VDBFN[0] = myV0;
|
||||
VDBFN[1] = myV1;
|
||||
|
||||
SIZE = Max(NBPNTU, NBPNTV);
|
||||
SIZE = std::max(NBPNTU, NBPNTV);
|
||||
Handle(TColStd_HArray1OfReal) HTABLE = new TColStd_HArray1OfReal(1, SIZE);
|
||||
Standard_Real* TAB = (Standard_Real*)&HTABLE->ChangeArray1()(HTABLE->Lower());
|
||||
|
||||
@@ -548,7 +548,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
|
||||
}
|
||||
|
||||
// tables required for FORTRAN
|
||||
Standard_Integer IORDMX = Max(IORDRU, IORDRV);
|
||||
Standard_Integer IORDMX = std::max(IORDRU, IORDRV);
|
||||
Handle(TColStd_HArray1OfReal) HEXTR = new TColStd_HArray1OfReal(1, 2 * IORDMX + 2);
|
||||
Standard_Real* EXTR = (Standard_Real*)&HEXTR->ChangeArray1()(HEXTR->Lower());
|
||||
Handle(TColStd_HArray1OfReal) HFACT = new TColStd_HArray1OfReal(1, IORDMX + 1);
|
||||
@@ -651,17 +651,17 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints)
|
||||
for (iv = 1; iv <= myOrdInV + 1; iv++)
|
||||
{
|
||||
error = ((Constraints.IsoV(myU0, myU1, myV0)).MaxErrors())->Value(iesp, iv);
|
||||
errU = Max(errU, error);
|
||||
errU = std::max(errU, error);
|
||||
error = ((Constraints.IsoV(myU0, myU1, myV1)).MaxErrors())->Value(iesp, iv);
|
||||
errU = Max(errU, error);
|
||||
errU = std::max(errU, error);
|
||||
}
|
||||
errV = 0.;
|
||||
for (iu = 1; iu <= myOrdInU + 1; iu++)
|
||||
{
|
||||
error = ((Constraints.IsoU(myU0, myV0, myV1)).MaxErrors())->Value(iesp, iu);
|
||||
errV = Max(errV, error);
|
||||
errV = std::max(errV, error);
|
||||
error = ((Constraints.IsoU(myU1, myV0, myV1)).MaxErrors())->Value(iesp, iu);
|
||||
errV = Max(errV, error);
|
||||
errV = std::max(errV, error);
|
||||
}
|
||||
myMaxErrors->ChangeValue(iesp) += errU * hmax[myOrdInV + 1] + errV * hmax[myOrdInU + 1];
|
||||
|
||||
@@ -670,23 +670,23 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints)
|
||||
for (iv = 1; iv <= myOrdInV + 1; iv++)
|
||||
{
|
||||
error = ((Constraints.IsoV(myU0, myU1, myV0)).MoyErrors())->Value(iesp, iv);
|
||||
errU = Max(errU, error);
|
||||
errU = std::max(errU, error);
|
||||
error = ((Constraints.IsoV(myU0, myU1, myV1)).MoyErrors())->Value(iesp, iv);
|
||||
errU = Max(errU, error);
|
||||
errU = std::max(errU, error);
|
||||
}
|
||||
errV = 0.;
|
||||
for (iu = 1; iu <= myOrdInU + 1; iu++)
|
||||
{
|
||||
error = ((Constraints.IsoU(myU0, myV0, myV1)).MoyErrors())->Value(iesp, iu);
|
||||
errV = Max(errV, error);
|
||||
errV = std::max(errV, error);
|
||||
error = ((Constraints.IsoU(myU1, myV0, myV1)).MoyErrors())->Value(iesp, iu);
|
||||
errV = Max(errV, error);
|
||||
errV = std::max(errV, error);
|
||||
}
|
||||
error = myMoyErrors->Value(iesp);
|
||||
error *= error;
|
||||
error += errU * hmax[myOrdInV + 1] * errU * hmax[myOrdInV + 1]
|
||||
+ errV * hmax[myOrdInU + 1] * errV * hmax[myOrdInU + 1];
|
||||
myMoyErrors->SetValue(iesp, Sqrt(error));
|
||||
myMoyErrors->SetValue(iesp, std::sqrt(error));
|
||||
|
||||
// max errors at iso-borders
|
||||
Handle(TColStd_HArray2OfReal) HERISO = new TColStd_HArray2OfReal(1, NBSESP, 1, 4);
|
||||
@@ -702,21 +702,21 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints)
|
||||
for (iv = 0; iv <= myOrdInV; iv++)
|
||||
{
|
||||
error = (Constraints.Node(myU0, myV0))->Error(iu, iv);
|
||||
emax1 = Max(emax1, error);
|
||||
emax1 = std::max(emax1, error);
|
||||
error = (Constraints.Node(myU1, myV0))->Error(iu, iv);
|
||||
emax2 = Max(emax2, error);
|
||||
emax2 = std::max(emax2, error);
|
||||
error = (Constraints.Node(myU0, myV1))->Error(iu, iv);
|
||||
emax3 = Max(emax3, error);
|
||||
emax3 = std::max(emax3, error);
|
||||
error = (Constraints.Node(myU1, myV1))->Error(iu, iv);
|
||||
emax4 = Max(emax4, error);
|
||||
emax4 = std::max(emax4, error);
|
||||
}
|
||||
}
|
||||
|
||||
// calculate max errors on borders
|
||||
err1 = Max(emax1, emax2);
|
||||
err2 = Max(emax3, emax4);
|
||||
err3 = Max(emax1, emax3);
|
||||
err4 = Max(emax2, emax4);
|
||||
err1 = std::max(emax1, emax2);
|
||||
err2 = std::max(emax3, emax4);
|
||||
err3 = std::max(emax1, emax3);
|
||||
err4 = std::max(emax2, emax4);
|
||||
|
||||
// calculate final errors on internal isos
|
||||
if ((Constraints.IsoV(myU0, myU1, myV0)).Position() == 0)
|
||||
@@ -772,17 +772,17 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
|
||||
Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV, NDMINU = 1, NDMINV = 1, NCOEFU, NCOEFV;
|
||||
// NDMINU and NDMINV depend on the nb of coeff of neighboring isos
|
||||
// and of the required order of continuity
|
||||
NDMINU = Max(1, 2 * IORDRU + 1);
|
||||
NDMINU = std::max(1, 2 * IORDRU + 1);
|
||||
NCOEFU = (Constraints.IsoV(myU0, myU1, myV0)).NbCoeff() - 1;
|
||||
NDMINU = Max(NDMINU, NCOEFU);
|
||||
NDMINU = std::max(NDMINU, NCOEFU);
|
||||
NCOEFU = (Constraints.IsoV(myU0, myU1, myV1)).NbCoeff() - 1;
|
||||
NDMINU = Max(NDMINU, NCOEFU);
|
||||
NDMINU = std::max(NDMINU, NCOEFU);
|
||||
|
||||
NDMINV = Max(1, 2 * IORDRV + 1);
|
||||
NDMINV = std::max(1, 2 * IORDRV + 1);
|
||||
NCOEFV = (Constraints.IsoU(myU0, myV0, myV1)).NbCoeff() - 1;
|
||||
NDMINV = Max(NDMINV, NCOEFV);
|
||||
NDMINV = std::max(NDMINV, NCOEFV);
|
||||
NCOEFV = (Constraints.IsoU(myU1, myV0, myV1)).NbCoeff() - 1;
|
||||
NDMINV = Max(NDMINV, NCOEFV);
|
||||
NDMINV = std::max(NDMINV, NCOEFV);
|
||||
|
||||
// tables of approximations
|
||||
Handle(TColStd_HArray1OfReal) HEPSAPR = new TColStd_HArray1OfReal(1, NBSESP);
|
||||
|
||||
Reference in New Issue
Block a user