diff liboctave/base-lu.cc @ 9715:9f27172fbd1e

auto-set MatrixType from certain functions
author Jaroslav Hajek <highegg@gmail.com>
date Mon, 12 Oct 2009 14:23:20 +0200
parents 51c17bd18563
children 4c0cdbe0acca
line wrap: on
line diff
--- a/liboctave/base-lu.cc
+++ b/liboctave/base-lu.cc
@@ -168,6 +168,22 @@
   return p;
 }
 
+template <class lu_type>
+bool
+base_lu<lu_type>::regular (void) const
+{
+  octave_idx_type k = std::min (a_fact.rows (), a_fact.columns ());
+  bool retval = true;
+  for (octave_idx_type i = 0; i < k; i++)
+    if (a_fact(i, i) == lu_elt_type ())
+      {
+        retval = false;
+        break;
+      }
+
+  return true;
+}
+
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***