Mercurial > octave-libtiff
diff liboctave/array/fCMatrix.cc @ 24196:2b769c242188
Use std::max to simplify calculating pinv tolerance.
* CMatrix.cc, dMatrix.cc, fCMatrix.cc, fMatrix.cc (pseudo_inverse):
Replace if/else decision based on rows with std::max (nr, nc).
author | Rik <rik@octave.org> |
---|---|
date | Fri, 03 Nov 2017 13:53:45 -0700 |
parents | d3dc76efb38b |
children | 599fe61a5619 |
line wrap: on
line diff
--- a/liboctave/array/fCMatrix.cc Fri Nov 03 10:03:36 2017 -0700 +++ b/liboctave/array/fCMatrix.cc Fri Nov 03 13:53:45 2017 -0700 @@ -971,10 +971,8 @@ if (tol <= 0.0) { - if (nr > nc) - tol = nr * sigma.elem (0) * std::numeric_limits<float>::epsilon (); - else - tol = nc * sigma.elem (0) * std::numeric_limits<float>::epsilon (); + tol = std::max (nr, nc) * sigma.elem (0) + * std::numeric_limits<float>::epsilon (); if (tol == 0) tol = std::numeric_limits<float>::min ();