Skip to content

Commit d0c7f30

Browse files
committed
Update bisect to return a single root with closely spaced roots.
This is the current practice in the non-sturm chain based solvers and expected by at least some primitive objects. Root returned is the middle of the tiny range at which we stop bisection.
1 parent 3187a40 commit d0c7f30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/core/math/polynomialsolver.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,8 @@ static int sbisect(int np, const polynomial *sseq, DBL min_value, DBL max_value,
563563
{
564564
if ((max_value - min_value) < SBISECT_MULT_ROOT_THRESHOLD)
565565
{
566-
return(0);
566+
roots[0] = mid;
567+
return(1);
567568
}
568569

569570
n1 = sbisect(np, sseq, min_value, mid, atmin, atmid, roots);

0 commit comments

Comments
 (0)