diff liboctave/array/fMatrix.cc @ 15383:2137f5638521

maint: periodic merge of stable to default
author John W. Eaton <jwe@octave.org>
date Thu, 13 Sep 2012 15:20:16 -0400
parents liboctave/fMatrix.cc@197774b411ec liboctave/fMatrix.cc@648dabbb4c6b
children 0a0912a9ab6e
line wrap: on
line diff
--- a/liboctave/array/fMatrix.cc
+++ b/liboctave/array/fMatrix.cc
@@ -1454,15 +1454,17 @@
       else if (typ == MatrixType::Full || typ == MatrixType::Hermitian)
         {
           float anorm = -1.0;
-          FloatMatrix atmp = *this;
-          float *tmp_data = atmp.fortran_vec ();
 
           if (typ == MatrixType::Hermitian)
             {
               octave_idx_type info = 0;
               char job = 'L';
-              anorm = atmp.abs ().sum ().
-                row (static_cast<octave_idx_type>(0)).max ();
+
+              FloatMatrix atmp = *this;
+              float *tmp_data = atmp.fortran_vec ();
+
+              anorm = atmp.abs().sum().
+                row(static_cast<octave_idx_type>(0)).max();
 
               F77_XFCN (spotrf, SPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
                                          tmp_data, nr, info
@@ -1495,6 +1497,9 @@
             {
               octave_idx_type info = 0;
 
+              FloatMatrix atmp = *this;
+              float *tmp_data = atmp.fortran_vec ();
+
               Array<octave_idx_type> ipvt (dim_vector (nr, 1));
               octave_idx_type *pipvt = ipvt.fortran_vec ();
 
@@ -1760,9 +1765,11 @@
         {
           info = 0;
           char job = 'L';
+
           FloatMatrix atmp = *this;
           float *tmp_data = atmp.fortran_vec ();
-          anorm = atmp.abs ().sum ().row (static_cast<octave_idx_type>(0)).max ();
+
+          anorm = atmp.abs().sum().row(static_cast<octave_idx_type>(0)).max();
 
           F77_XFCN (spotrf, SPOTRF, (F77_CONST_CHAR_ARG2 (&job, 1), nr,
                                      tmp_data, nr, info
@@ -1838,8 +1845,9 @@
 
           FloatMatrix atmp = *this;
           float *tmp_data = atmp.fortran_vec ();
-          if (anorm < 0.)
-            anorm = atmp.abs ().sum ().row (static_cast<octave_idx_type>(0)).max ();
+
+          if(anorm < 0.)
+            anorm = atmp.abs().sum().row(static_cast<octave_idx_type>(0)).max();
 
           Array<float> z (dim_vector (4 * nc, 1));
           float *pz = z.fortran_vec ();