Skip to content

Commit 52448ab

Browse files
committed
Update tolerance check in pos() function to use a scaled target tolerance
1 parent 2a0e490 commit 52448ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/VPMR.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,12 @@ mat lyap(const vec& A, mat&& C) {
254254
}
255255

256256
long pos(const vec& A) {
257+
const auto target_tolerance = .1 * config.tolerance;
257258
auto sum = mpreal(0, config.precision_bits);
258259
long P = 0;
259260
for(auto I = A.size() - 1; I >= 0; --I) {
260261
sum += A(I);
261-
if(sum > config.tolerance) {
262+
if(sum > target_tolerance) {
262263
P = I;
263264
break;
264265
}

0 commit comments

Comments
 (0)