diff liboctave/dSparse.cc @ 5203:dbeafbc0ff64

[project @ 2005-03-15 00:58:55 by jwe]
author jwe
date Tue, 15 Mar 2005 00:58:56 +0000
parents 57077d0ddc8e
children 90a9058de7e8
line wrap: on
line diff
--- a/liboctave/dSparse.cc
+++ b/liboctave/dSparse.cc
@@ -41,10 +41,12 @@
 #include "SparsedbleLU.h"
 #include "SparseType.h"
 
+#ifdef HAVE_UMFPACK
 // External UMFPACK functions in C
 extern "C" {
-#include "umfpack.h"
-}
+#include <umfpack/umfpack.h>
+}
+#endif
 
 // Fortran functions we call.
 extern "C"
@@ -714,6 +716,7 @@
 {
   DET retval;
 
+#ifdef HAVE_UMFPACK
   int nr = rows ();
   int nc = cols ();
 
@@ -821,6 +824,9 @@
 	    }
 	}
     }
+#else
+  (*current_liboctave_error_handler) ("UMFPACK not installed");
+#endif
 
   return retval;
 }
@@ -4671,6 +4677,7 @@
   void *Numeric;
   err = 0;
 
+#ifdef HAVE_UMFPACK
   // Setup the control parameters
   Control = Matrix (UMFPACK_CONTROL, 1);
   double *control = Control.fortran_vec ();
@@ -4766,6 +4773,10 @@
   if (err != 0)
     umfpack_di_free_numeric (&Numeric);
 
+#else
+  (*current_liboctave_error_handler) ("UMFPACK not installed");
+#endif
+
   return Numeric;
 }
 
@@ -4803,6 +4814,7 @@
 
       if (typ == SparseType::Full)
 	{
+#ifdef HAVE_UMFPACK
 	  Matrix Control, Info;
 	  void *Numeric = 
 	    factorize (err, rcond, Control, Info, sing_handler);
@@ -4862,6 +4874,9 @@
 		
 	      umfpack_di_free_numeric (&Numeric);
 	    }
+#else
+	  (*current_liboctave_error_handler) ("UMFPACK not installed");
+#endif
 	}
       else if (typ != SparseType::Hermitian)
 	(*current_liboctave_error_handler) ("incorrect matrix type");
@@ -4903,6 +4918,7 @@
 
       if (typ == SparseType::Full)
 	{
+#ifdef HAVE_UMFPACK
 	  Matrix Control, Info;
 	  void *Numeric = factorize (err, rcond, Control, Info, 
 				     sing_handler);
@@ -4994,6 +5010,9 @@
 
 	      umfpack_di_free_numeric (&Numeric);
 	    }
+#else
+	  (*current_liboctave_error_handler) ("UMFPACK not installed");
+#endif
 	}
       else if (typ != SparseType::Hermitian)
 	(*current_liboctave_error_handler) ("incorrect matrix type");
@@ -5035,6 +5054,7 @@
 
       if (typ == SparseType::Full)
 	{
+#ifdef HAVE_UMFPACK
 	  Matrix Control, Info;
 	  void *Numeric = factorize (err, rcond, Control, Info, 
 				     sing_handler);
@@ -5113,6 +5133,9 @@
 
 	      umfpack_di_free_numeric (&Numeric);
 	    }
+#else
+	  (*current_liboctave_error_handler) ("UMFPACK not installed");
+#endif
 	}
       else if (typ != SparseType::Hermitian)
 	(*current_liboctave_error_handler) ("incorrect matrix type");
@@ -5155,6 +5178,7 @@
 
       if (typ == SparseType::Full)
 	{
+#ifdef HAVE_UMFPACK
 	  Matrix Control, Info;
 	  void *Numeric = factorize (err, rcond, Control, Info, 
 				     sing_handler);
@@ -5256,6 +5280,9 @@
 
 	      umfpack_di_free_numeric (&Numeric);
 	    }
+#else
+	  (*current_liboctave_error_handler) ("UMFPACK not installed");
+#endif
 	}
       else if (typ != SparseType::Hermitian)
 	(*current_liboctave_error_handler) ("incorrect matrix type");