mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-10 09:30:48 +08:00
Foundation Classes, math_FunctionRoot - Constructor exception (#1121)
- Guarded `Sol.NbIterations()` calls with `if (Done)` in both `math_FunctionRoot` constructors. - Prevents `StdFail_NotDone` from being raised during construction when the root is not found.
This commit is contained in:
committed by
GitHub
parent
180906866e
commit
64592d9fcf
@@ -81,10 +81,10 @@ math_FunctionRoot::math_FunctionRoot(math_FunctionWithDerivative& F,
|
||||
Tol(1) = Tolerance;
|
||||
math_FunctionSetRoot Sol(Ff, Tol, NbIterations);
|
||||
Sol.Perform(Ff, V);
|
||||
Done = Sol.IsDone();
|
||||
NbIter = Sol.NbIterations();
|
||||
Done = Sol.IsDone();
|
||||
if (Done)
|
||||
{
|
||||
NbIter = Sol.NbIterations();
|
||||
F.GetStateNumber();
|
||||
TheRoot = Sol.Root()(1);
|
||||
TheDerivative = Sol.Derivative()(1, 1);
|
||||
@@ -107,10 +107,10 @@ math_FunctionRoot::math_FunctionRoot(math_FunctionWithDerivative& F,
|
||||
Bb(1) = B;
|
||||
math_FunctionSetRoot Sol(Ff, Tol, NbIterations);
|
||||
Sol.Perform(Ff, V, Aa, Bb);
|
||||
Done = Sol.IsDone();
|
||||
NbIter = Sol.NbIterations();
|
||||
Done = Sol.IsDone();
|
||||
if (Done)
|
||||
{
|
||||
NbIter = Sol.NbIterations();
|
||||
F.GetStateNumber();
|
||||
TheRoot = Sol.Root()(1);
|
||||
TheDerivative = Sol.Derivative()(1, 1);
|
||||
|
||||
Reference in New Issue
Block a user