// Created on: 1999-12-16 // Created by: Atelier CAS2000 // Copyright (c) 1999-1999 Matra Datavision // Copyright (c) 1999-2012 OPEN CASCADE SAS // // The content of this file is subject to the Open CASCADE Technology Public // License Version 6.5 (the "License"). You may not use the content of this file // except in compliance with the License. Please obtain a copy of the License // at http://www.opencascade.org and read it completely before using this file. // // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. // // The Original Code and all software distributed under the License is // distributed on an "AS IS" basis, without warranty of any kind, and the // Initial Developer hereby disclaims all such warranties, including without // limitation, any warranties of merchantability, fitness for a particular // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. // Redefinition de math_BFGS: // ========================== AppParCurves_BSpGradient_BFGS::AppParCurves_BSpGradient_BFGS(math_MultipleVarFunctionWithGradient& F, const math_Vector& StartingPoint, const Standard_Real Tolerance3d, const Standard_Real Tolerance2d, const Standard_Real Eps, const Standard_Integer NbIterations): math_BFGS(F, Eps, NbIterations, Eps), myTol3d(Tolerance3d), myTol2d(Tolerance2d) { Perform(F, StartingPoint); } Standard_Boolean AppParCurves_BSpGradient_BFGS::IsSolutionReached(math_MultipleVarFunctionWithGradient& F) const { Standard_Boolean Result, Result2; AppParCurves_BSpParFunction *F1 = (AppParCurves_BSpParFunction*) &F; Result = (2.0 * fabs(TheMinimum - PreviousMinimum) <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum))+1.e-12) ; Standard_Real MErr3d = F1->MaxError3d(); Standard_Real MErr2d = F1->MaxError2d(); Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); return (Result || Result2); }