diff liboctave/CSparse.cc @ 8335:64cf956a109c

templatize & fix DET
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 19 Nov 2008 11:23:07 +0100
parents b11c31849b44
children 8b1a2555c4e2
line wrap: on
line diff
--- a/liboctave/CSparse.cc	Tue Nov 18 22:55:13 2008 +0100
+++ b/liboctave/CSparse.cc	Wed Nov 19 11:23:07 2008 +0100
@@ -1114,10 +1114,7 @@
 
   if (nr == 0 || nc == 0 || nr != nc)
     {
-      Complex d[2];
-      d[0] = 1.0;
-      d[1] = 0.0;
-      retval = ComplexDET (d);
+      retval = ComplexDET (1.0);
     }
   else
     {
@@ -1201,13 +1198,10 @@
 	    {
 	      UMFPACK_ZNAME (report_numeric) (Numeric, control);
 
-	      Complex d[2];
-	      double d_exponent;
-
-	      status = UMFPACK_ZNAME (get_determinant) 
-		(reinterpret_cast<double *> (&d[0]), 0, &d_exponent,
-		 Numeric, info);
-	      d[1] = d_exponent;
+	      double c10[2], e10;
+
+              status = UMFPACK_ZNAME (get_determinant) (c10, 0, &e10,
+                                                        Numeric, info);
 
 	      if (status < 0)
 		{
@@ -1218,7 +1212,7 @@
 		  UMFPACK_ZNAME (report_info) (control, info);
 		}
 	      else
-		retval = ComplexDET (d);
+		retval = ComplexDET (Complex (c10[0], c10[1]), e10, 10);
 		  
 	      UMFPACK_ZNAME (free_numeric) (&Numeric);
 	    }