changeset 20627:ec003232f7aa

chol: Fix chol(a, "lower") for single precision inputs * floatCHOL.cc (FloatCHOL::init): Fix off-by-one indexing error.
author Mike Miller <mtmiller@octave.org>
date Wed, 14 Oct 2015 22:33:09 -0400
parents 9fb8133288e8
children 48fedd8fbff7
files liboctave/numeric/floatCHOL.cc
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/numeric/floatCHOL.cc	Wed Oct 14 21:31:22 2015 -0400
+++ b/liboctave/numeric/floatCHOL.cc	Wed Oct 14 22:33:09 2015 -0400
@@ -118,9 +118,9 @@
     {
       for (octave_idx_type j = 0; j < n; j++)
         {
-          for (octave_idx_type i = 0; i <= j; i++)
+          for (octave_idx_type i = 0; i < j; i++)
             chol_mat.xelem (i, j) = 0.0f;
-          for (octave_idx_type i = j+1; i < n; i++)
+          for (octave_idx_type i = j; i < n; i++)
             chol_mat.xelem (i, j) = a(i, j);
         }
     }