fix a div/0 condition

This commit is contained in:
Bart Slinger
2018-09-12 20:49:48 +02:00
committed by Beat Küng
parent 983a3f0212
commit 3f2d3cf58d
+2 -1
View File
@@ -51,7 +51,7 @@ public:
// prevent divide by zero // prevent divide by zero
// also covers u1. normx is never negative // also covers u1. normx is never negative
if (normx < 1e-8f) { if (normx < 1e-8f) {
return; break;
} }
float w[M] = {}; float w[M] = {};
w[0] = 1.0f; w[0] = 1.0f;
@@ -128,6 +128,7 @@ public:
for (size_t z = 0; z < N; z++) { for (size_t z = 0; z < N; z++) {
x(z) = 0.0f; x(z) = 0.0f;
} }
break;
} }
x(i) = x(i) / _A(i,i); x(i) = x(i) / _A(i,i);
} }