1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-16 10:54:53 +03:00

0022851: No intersection curve between two surfaces

This commit is contained in:
JGV 2012-01-13 16:25:51 +00:00 committed by bugmaster
parent 9781f21539
commit 3e42bd70cf

View File

@ -49,7 +49,13 @@
// On change de direction // On change de direction
//============================================================================ //============================================================================
static Standard_Boolean mydebug = Standard_False; #define FSR_DEBUG(arg)
// Uncomment the following code to have debug output to cout
/* * /
static Standard_Boolean mydebug = Standard_False;
#undef FSR_DEBUG
#define FSR_DEBUG(arg) {if (mydebug) { cout << arg << endl; }}
/* */
class MyDirFunction : public math_Function class MyDirFunction : public math_Function
{ {
@ -202,7 +208,7 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P0,
F.Initialize(P1, Delta); F.Initialize(P1, Delta);
// (2) On minimise // (2) On minimise
if (mydebug)cout << " minimisation dans la direction" << endl; FSR_DEBUG (" minimisation dans la direction")
ax = -1; bx = 0; ax = -1; bx = 0;
cx = (P2-P1).Norm()*invnorme; cx = (P2-P1).Norm()*invnorme;
if (cx < 1.e-2) return Standard_False; if (cx < 1.e-2) return Standard_False;
@ -243,7 +249,7 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P,
// (1) On realise une premiere interpolation quadratique // (1) On realise une premiere interpolation quadratique
Standard_Real ax, bx, cx, df1, df2, Delta, tsol, fsol, tsolbis; Standard_Real ax, bx, cx, df1, df2, Delta, tsol, fsol, tsolbis;
if (mydebug) { cout << " essai d interpolation" << endl;} FSR_DEBUG(" essai d interpolation")
df1 = Gradient*Dir; df1 = Gradient*Dir;
df2 = DGradient*Dir; df2 = DGradient*Dir;
@ -285,7 +291,7 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P,
if (fsol<PValue) { if (fsol<PValue) {
good = Standard_True; good = Standard_True;
Result = fsol; Result = fsol;
if (mydebug) cout << "t= "<<tsol<<" F = " << fsol << " OldF = "<<PValue <<endl; FSR_DEBUG("t= "<<tsol<<" F = " << fsol << " OldF = "<<PValue)
} }
// (2) Si l'on a pas assez progresser on realise une recherche // (2) Si l'on a pas assez progresser on realise une recherche
@ -298,14 +304,13 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P,
else { else {
ax = 0.0; bx = tsol; cx = 1.0; ax = 0.0; bx = tsol; cx = 1.0;
} }
if (mydebug) cout << " minimisation dans la direction" << endl; FSR_DEBUG(" minimisation dans la direction")
math_BrentMinimum Sol(F, ax, bx, cx, tol1d, 100, tol1d); math_BrentMinimum Sol(F, ax, bx, cx, tol1d, 100, tol1d);
if(Sol.IsDone()) { if(Sol.IsDone()) {
if (Sol.Minimum() <= Result) { if (Sol.Minimum() <= Result) {
tsol = Sol.Location(); tsol = Sol.Location();
good = Standard_True; good = Standard_True;
if (mydebug) cout << "t= "<<tsol<<" F ="<< Sol.Minimum() FSR_DEBUG("t= "<<tsol<<" F ="<< Sol.Minimum() << " OldF = "<<Result)
<< " OldF = "<<Result <<endl;
} }
} }
} }
@ -336,11 +341,11 @@ static void SearchDirection(const math_Matrix& DF,
math_Gauss Solut(DF, 1.e-9); math_Gauss Solut(DF, 1.e-9);
if (Solut.IsDone()) Solut.Solve(Direction); if (Solut.IsDone()) Solut.Solve(Direction);
else { // we have to "forget" singular directions. else { // we have to "forget" singular directions.
if (mydebug) cout << " Matrice singuliere : On prend SVD" << endl; FSR_DEBUG(" Matrice singuliere : On prend SVD")
math_SVD SolvebySVD(DF); math_SVD SolvebySVD(DF);
if (SolvebySVD.IsDone()) SolvebySVD.Solve(-1*FF, Direction); if (SolvebySVD.IsDone()) SolvebySVD.Solve(-1*FF, Direction);
else ChangeDirection = Standard_True; else ChangeDirection = Standard_True;
} }
} }
else if (Ninc > Neq) { else if (Ninc > Neq) {
math_SVD Solut(DF); math_SVD Solut(DF);
@ -457,22 +462,28 @@ static void SearchDirection(const math_Matrix& DF,
//==================================================== //====================================================
Standard_Boolean Bounds(const math_Vector& InfBound, Standard_Boolean Bounds(const math_Vector& InfBound,
const math_Vector& SupBound, const math_Vector& SupBound,
const math_Vector& Tol, const math_Vector& Tol,
math_Vector& Sol, math_Vector& Sol,
const math_Vector& SolSave, const math_Vector& SolSave,
math_IntegerVector& Constraints, math_IntegerVector& Constraints,
math_Vector& Delta) math_Vector& Delta,
Standard_Boolean& theIsNewSol)
// //
// Purpose : Troncate un pas d'optimisation pour rester // Purpose: Trims an initial solution Sol to be within a domain defined by
// dans le domaine, Delta donne le pas final // InfBound and SupBound. Delta will contain a distance between final Sol and
// SolSave.
// IsNewSol returns False, if final Sol fully coincides with SolSave, i.e.
// if SolSave already lied on a boundary and initial Sol was fully beyond it
//====================================================== //======================================================
{ {
Standard_Boolean Out = Standard_False; Standard_Boolean Out = Standard_False;
Standard_Integer i, Ninc = Sol.Length(); Standard_Integer i, Ninc = Sol.Length();
Standard_Real monratio = 1; Standard_Real monratio = 1;
theIsNewSol = Standard_True;
// Calcul du ratio de recadrage // Calcul du ratio de recadrage
for (i = 1; i <= Ninc; i++) { for (i = 1; i <= Ninc; i++) {
Constraints(i) = 0; Constraints(i) = 0;
@ -484,28 +495,36 @@ Standard_Boolean Bounds(const math_Vector& InfBound,
else if(Sol(i) < InfBound(i)) { else if(Sol(i) < InfBound(i)) {
Constraints(i) = 1; Constraints(i) = 1;
Out = Standard_True; Out = Standard_True;
if (Abs(Delta(i)) > Tol(i)) // Afin d'eviter des ratio nulles pour rien // Delta(i) is negative
monratio = Min(monratio, Abs( (SolSave(i)-InfBound(i))/Delta(i)) ); if (-Delta(i) > Tol(i)) // Afin d'eviter des ratio nulles pour rien
monratio = Min(monratio, (InfBound(i) - SolSave(i))/Delta(i) );
} }
else if (Sol(i) > SupBound(i)) { else if (Sol(i) > SupBound(i)) {
Constraints(i) = 1; Constraints(i) = 1;
Out = Standard_True; Out = Standard_True;
if (Abs(Delta(i)) > Tol(i)) // Delta(i) is positive
monratio = Min(monratio, Abs( (SolSave(i)-SupBound(i))/Delta(i)) ); if (Delta(i) > Tol(i))
monratio = Min(monratio, (SupBound(i) - SolSave(i))/Delta(i) );
} }
} }
if (Out){ // Troncature et derniers recadrage pour blinder (pb numeriques) if (Out){ // Troncature et derniers recadrage pour blinder (pb numeriques)
Delta *= monratio; if (monratio == 0.0) {
Sol = SolSave+Delta; theIsNewSol = Standard_False;
for (i = 1; i <= Ninc; i++) { Sol = SolSave;
if(Sol(i) < InfBound(i)) { Delta.Init (0.0);
Sol(i) = InfBound(i); } else {
Delta(i) = Sol(i) - SolSave(i); Delta *= monratio;
} Sol = SolSave+Delta;
else if (Sol(i) > SupBound(i)) { for (i = 1; i <= Ninc; i++) {
Sol(i) = SupBound(i); if(Sol(i) < InfBound(i)) {
Delta(i) = Sol(i) - SolSave(i); Sol(i) = InfBound(i);
Delta(i) = Sol(i) - SolSave(i);
}
else if (Sol(i) > SupBound(i)) {
Sol(i) = SupBound(i);
Delta(i) = Sol(i) - SolSave(i);
}
} }
} }
} }
@ -667,7 +686,6 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
const math_Vector& InfBound, const math_Vector& InfBound,
const math_Vector& SupBound) const math_Vector& SupBound)
{ {
Standard_Integer Ninc = F.NbVariables(), Neq = F.NbEquations(); Standard_Integer Ninc = F.NbVariables(), Neq = F.NbEquations();
if ((Neq <= 0) || if ((Neq <= 0) ||
@ -676,10 +694,10 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
(SupBound.Length() != Ninc)) { Standard_DimensionError:: Raise(); } (SupBound.Length() != Ninc)) { Standard_DimensionError:: Raise(); }
Standard_Integer i; Standard_Integer i;
Standard_Boolean ChangeDirection = Standard_False, Sort = Standard_False; Standard_Boolean ChangeDirection = Standard_False, Sort = Standard_False, isNewSol = Standard_False;
Standard_Boolean Good, Verif; Standard_Boolean Good, Verif;
Standard_Boolean Stop; Standard_Boolean Stop;
Standard_Real Eps = 1.e-32, Progres = 0.005; const Standard_Real EpsSqrt = 1.e-16, Eps = 1.e-32, Eps2 = 1.e-64, Progres = 0.005;
Standard_Real F2, PreviousMinimum, Dy, OldF; Standard_Real F2, PreviousMinimum, Dy, OldF;
Standard_Real Ambda, Ambda2, Gnr1, Oldgr; Standard_Real Ambda, Ambda2, Gnr1, Oldgr;
math_Vector InvLengthMax(1, Ninc); // Pour bloquer les pas a 1/4 du domaine math_Vector InvLengthMax(1, Ninc); // Pour bloquer les pas a 1/4 du domaine
@ -714,14 +732,12 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
// Le rang 0 de Save ne doit servir q'au test accelarteur en fin de boucle // Le rang 0 de Save ne doit servir q'au test accelarteur en fin de boucle
// s'il on est dejas sur la solution, il faut leurer ce test pour eviter // s'il on est dejas sur la solution, il faut leurer ce test pour eviter
// de faire une seconde iteration... // de faire une seconde iteration...
Save(0) = Max (F2, Sqrt(Eps)); Save(0) = Max (F2, EpsSqrt);
if (mydebug) { FSR_DEBUG("=== Mode Debug de Function Set Root" << endl)
cout << "=== Mode Debug de Function Set Root"<<endl; FSR_DEBUG(" F2 Initial = " << F2)
cout << " F2 Initial = " << F2 << endl;
}
if ((F2 <= Eps) || (Sqrt(Gnr1) <= Eps)) { if ((F2 <= Eps) || (Gnr1 <= Eps2)) {
Done = Standard_True; Done = Standard_True;
State = F.GetStateNumber(); State = F.GetStateNumber();
return; return;
@ -736,11 +752,14 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
SearchDirection(DF, GH, FF, ChangeDirection, InvLengthMax, DH, Dy); SearchDirection(DF, GH, FF, ChangeDirection, InvLengthMax, DH, Dy);
if (Abs(Dy) <= Eps) { if (Abs(Dy) <= Eps) {
Done = Standard_True; Done = Standard_True;
////modified by jgv, 31.08.2011////
F.Value(Sol, FF); //update F before GetStateNumber
///////////////////////////////////
State = F.GetStateNumber(); State = F.GetStateNumber();
return; return;
} }
if (ChangeDirection) { if (ChangeDirection) {
Ambda = Ambda2/Sqrt(Abs(Dy)); Ambda = Ambda2 / Sqrt(Abs(Dy));
if (Ambda > 1.0) Ambda = 1.0; if (Ambda > 1.0) Ambda = 1.0;
} }
else { else {
@ -752,27 +771,28 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
Sol(i) = Sol(i) + Ambda * DH(i); Sol(i) = Sol(i) + Ambda * DH(i);
} }
Sort = Bounds(InfBound, SupBound, Tol, Sol, SolSave, Sort = Bounds(InfBound, SupBound, Tol, Sol, SolSave,
Constraints, Delta); Constraints, Delta, isNewSol);
DHSave = GH; DHSave = GH;
// F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1); if (isNewSol) {
if(!F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1)) { // F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1);
Done = Standard_False; if(!F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1)) {
State = F.GetStateNumber(); Done = Standard_False;
return; State = F.GetStateNumber();
return;
}
} }
FSR_DEBUG("Kount = " << Kount)
FSR_DEBUG("Le premier F2 = " << F2)
FSR_DEBUG("Direction = " << ChangeDirection)
#if DEB if ((F2 <= Eps) || (Gnr1 <= Eps2)) {
if (mydebug) {
cout << "Kount = " << Kount << endl;
cout << "Le premier F2 = " << F2 << endl;
cout << "Direction = " << ChangeDirection << endl;
}
#endif
if ((F2 <= Eps) || (Sqrt(Gnr1) <= Eps)) {
Done = Standard_True; Done = Standard_True;
////modified by jgv, 31.08.2011////
F.Value(Sol, FF); //update F before GetStateNumber
///////////////////////////////////
State = F.GetStateNumber(); State = F.GetStateNumber();
return; return;
} }
@ -792,16 +812,16 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
while((F2/PreviousMinimum > Progres) && !Stop) { while((F2/PreviousMinimum > Progres) && !Stop) {
if (F2 < OldF && (Dy < 0.0)) { if (F2 < OldF && (Dy < 0.0)) {
// On essaye de progresser dans cette direction. // On essaye de progresser dans cette direction.
if (mydebug) cout << " iteration de descente = " << DescenteIter<<endl; FSR_DEBUG(" iteration de descente = " << DescenteIter)
DescenteIter++; DescenteIter++;
SolSave = Sol; SolSave = Sol;
OldF = F2; OldF = F2;
for( i = Sol.Lower(); i <= Sol.Upper(); i++) { for( i = Sol.Lower(); i <= Sol.Upper(); i++) {
Sol(i) = Sol(i) + Ambda * DH(i); Sol(i) = Sol(i) + Ambda * DH(i);
} }
Stop = Bounds(InfBound, SupBound, Tol, Sol, SolSave, Stop = Bounds(InfBound, SupBound, Tol, Sol, SolSave,
Constraints, Delta); Constraints, Delta, isNewSol);
if (mydebug) { cout << " Augmentation de lambda" << endl;} FSR_DEBUG(" Augmentation de lambda")
Ambda *= 1.7; Ambda *= 1.7;
} }
else { else {
@ -826,36 +846,40 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
F2 = OldF; F2 = OldF;
} }
else { else {
Sol = SolSave+Delta; Sol = SolSave+Delta;
Sort = Bounds(InfBound, SupBound, Tol, Sol, SolSave,
Constraints, Delta, isNewSol);
} }
Sort = Bounds(InfBound, SupBound, Tol, Sol, SolSave,
Constraints, Delta);
Sort = Standard_False; // On a rejete le point sur la frontiere Sort = Standard_False; // On a rejete le point sur la frontiere
} }
Stop = Standard_True; // et on sort dans tous les cas... Stop = Standard_True; // et on sort dans tous les cas...
} }
DHSave = GH; DHSave = GH;
// F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1); if (isNewSol) {
if(!F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1)) { // F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1);
Done = Standard_False; if(!F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1)) {
State = F.GetStateNumber(); Done = Standard_False;
return; State = F.GetStateNumber();
} return;
}
}
Dy = GH*DH; Dy = GH*DH;
if (Abs(Dy) <= Eps) { if (Abs(Dy) <= Eps) {
State = F.GetStateNumber();
Done = Standard_True; Done = Standard_True;
if (F2 > OldF) Sol = SolSave; if (F2 > OldF)
Sol = SolSave;
////modified by jgv, 31.08.2011////
F.Value(Sol, FF); //update F before GetStateNumber
///////////////////////////////////
State = F.GetStateNumber();
return; return;
} }
if (DescenteIter >= 10) { if (DescenteIter >= 10) {
Stop = Standard_True; Stop = Standard_True;
} }
} }
if (mydebug) { FSR_DEBUG("--- Sortie du Traitement Standard")
cout << "--- Sortie du Traitement Standard"<<endl; FSR_DEBUG(" DescenteIter = "<<DescenteIter << " F2 = " << F2)
cout << " DescenteIter = "<<DescenteIter << " F2 = " << F2 << endl;
}
} }
// ------------------------------------ // ------------------------------------
// on passe au traitement des bords // on passe au traitement des bords
@ -872,12 +896,12 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
OldF = F2; OldF = F2;
SearchDirection(DF, GH, FF, Constraints, Sol, SearchDirection(DF, GH, FF, Constraints, Sol,
ChangeDirection, InvLengthMax, DH, Dy); ChangeDirection, InvLengthMax, DH, Dy);
if (mydebug) { cout << " Conditional Direction = " << ChangeDirection << endl;} FSR_DEBUG(" Conditional Direction = " << ChangeDirection)
if (Dy<-Eps) { //Pour eviter des calculs inutiles et des /0... if (Dy<-Eps) { //Pour eviter des calculs inutiles et des /0...
if (ChangeDirection) { if (ChangeDirection) {
// Ambda = Ambda2/Sqrt(Abs(Dy)); // Ambda = Ambda2 / Sqrt(Abs(Dy));
Ambda = Ambda2/Sqrt(-Dy); Ambda = Ambda2 / Sqrt(-Dy);
if (Ambda > 1.0) Ambda = 1.0; if (Ambda > 1.0) Ambda = 1.0;
} }
else { else {
@ -889,20 +913,20 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
Sol(i) = Sol(i) + Ambda * DH(i); Sol(i) = Sol(i) + Ambda * DH(i);
} }
Sortbis = Bounds(InfBound, SupBound, Tol, Sol, SolSave, Sortbis = Bounds(InfBound, SupBound, Tol, Sol, SolSave,
Constraints, Delta); Constraints, Delta, isNewSol);
DHSave = GH; DHSave = GH;
// F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1); if (isNewSol) {
if(!F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1)) { // F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1);
Done = Standard_False; if(!F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1)) {
State = F.GetStateNumber(); Done = Standard_False;
return; State = F.GetStateNumber();
} return;
}
}
Ambda2 = Gnr1; Ambda2 = Gnr1;
if (mydebug) { FSR_DEBUG("--- Iteration au bords : " << DescenteIter)
cout << "--- Iteration au bords : " << DescenteIter << endl; FSR_DEBUG("--- F2 = " << F2)
cout << "--- F2 = " << F2 << endl;
}
} }
else { else {
Stop = Standard_True; Stop = Standard_True;
@ -910,8 +934,7 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
while((F2/PreviousMinimum > Progres) && (F2<OldF) && (!Stop) ) { while((F2/PreviousMinimum > Progres) && (F2<OldF) && (!Stop) ) {
DescenteIter++; DescenteIter++;
if (mydebug) cout << "--- Iteration de descente conditionnel = " FSR_DEBUG("--- Iteration de descente conditionnel = " << DescenteIter)
<< DescenteIter<<endl;
if (F2 < OldF && Dy < 0.0) { if (F2 < OldF && Dy < 0.0) {
// On essaye de progresser dans cette direction. // On essaye de progresser dans cette direction.
SolSave = Sol; SolSave = Sol;
@ -920,15 +943,17 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
Sol(i) = Sol(i) + Ambda * DH(i); Sol(i) = Sol(i) + Ambda * DH(i);
} }
Sortbis = Bounds(InfBound, SupBound, Tol, Sol, SolSave, Sortbis = Bounds(InfBound, SupBound, Tol, Sol, SolSave,
Constraints, Delta ); Constraints, Delta, isNewSol);
} }
DHSave = GH; DHSave = GH;
// F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1); if (isNewSol) {
if(!F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1)) { // F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1);
Done = Standard_False; if(!F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1)) {
State = F.GetStateNumber(); Done = Standard_False;
return; State = F.GetStateNumber();
} return;
}
}
Ambda2 = Gnr1; Ambda2 = Gnr1;
Dy = GH*DH; Dy = GH*DH;
Stop = ((Dy >=0) || (DescenteIter >= 10) || Sortbis); Stop = ((Dy >=0) || (DescenteIter >= 10) || Sortbis);
@ -943,24 +968,25 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
DHSave, GH, Tol, F_Dir); DHSave, GH, Tol, F_Dir);
if (!Good) { if (!Good) {
Sol = SolSave; Sol = SolSave;
Sort = Standard_False;
} }
else { else {
Sol = SolSave + Delta; Sol = SolSave + Delta;
} Sort = Bounds(InfBound, SupBound, Tol, Sol, SolSave,
Sort = Bounds(InfBound, SupBound, Tol, Sol, SolSave, Constraints, Delta, isNewSol);
Constraints, Delta); if (isNewSol) {
// F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1); // F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1);
if(!F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1)) { if(!F_Dir.Value(Sol, FF, DF, GH, F2, Gnr1)) {
Done = Standard_False; Done = Standard_False;
State = F.GetStateNumber(); State = F.GetStateNumber();
return; return;
}
}
} }
Dy = GH*DH; Dy = GH*DH;
} }
if (mydebug) { FSR_DEBUG("--- Sortie du Traitement des Bords")
cout << "--- Sortie du Traitement des Bords"<<endl; FSR_DEBUG("--- DescenteIter = "<<DescenteIter << " F2 = " << F2)
cout << "--- DescenteIter = "<<DescenteIter << " F2 = " << F2 << endl;
}
} }
} }
@ -982,12 +1008,16 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
for(i = Delta.Lower(); i <= Delta.Upper(); i++) { for(i = Delta.Lower(); i <= Delta.Upper(); i++) {
Delta(i) = PreviousSolution(i) - Sol(i); Delta(i) = PreviousSolution(i) - Sol(i);
} }
if (IsSolutionReached(F)) { if (IsSolutionReached(F)) {
if (PreviousMinimum < F2) { if (PreviousMinimum < F2) {
Sol = SolSave; Sol = SolSave;
} }
State = F.GetStateNumber();
Done = Standard_True; Done = Standard_True;
////modified by jgv, 31.08.2011////
F.Value(Sol, FF); //update F before GetStateNumber
///////////////////////////////////
State = F.GetStateNumber();
return; return;
} }
} }
@ -1021,6 +1051,9 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F,
} }
if (IsSolutionReached(F)) { if (IsSolutionReached(F)) {
Done = Standard_True; Done = Standard_True;
////modified by jgv, 31.08.2011////
F.Value(Sol, FF); //update F before GetStateNumber
///////////////////////////////////
State = F.GetStateNumber(); State = F.GetStateNumber();
return; return;
} }
@ -1078,10 +1111,3 @@ void math_FunctionSetRoot::FunctionSetErrors(math_Vector& Err) const{
Standard_DimensionError_Raise_if(Err.Length() != Sol.Length(), " "); Standard_DimensionError_Raise_if(Err.Length() != Sol.Length(), " ");
Err = Delta; Err = Delta;
} }