changeset 5297:234abf4c74dd

[project @ 2005-04-21 21:29:46 by jwe]
author jwe
date Thu, 21 Apr 2005 21:31:26 +0000
parents 4e753a157ed2
children d2518305564e
files ChangeLog configure.in src/ChangeLog src/DLD-FUNCTIONS/colamd.cc src/ls-mat5.cc
diffstat 5 files changed, 51 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2005-04-21  John W. Eaton  <jwe@octave.org>
 
 	* configure.in (AC_CONFIG_FILES): Remove install-octave from the list.
+	(AH_BOTTOM): Define SIZEOF_OCTAVE_IDX_TYPE.
 
 2005-04-14  John W. Eaton  <jwe@octave.org>
 
--- a/configure.in
+++ b/configure.in
@@ -29,7 +29,7 @@
 EXTERN_CXXFLAGS="$CXXFLAGS"
 
 AC_INIT
-AC_REVISION($Revision: 1.472 $)
+AC_REVISION($Revision: 1.473 $)
 AC_PREREQ(2.57)
 AC_CONFIG_SRCDIR([src/octave.cc])
 AC_CONFIG_HEADER(config.h)
@@ -1571,6 +1571,12 @@
 #define F77_USES_VISUAL_FORTRAN_CALLING_CONVENTION
 #endif
 
+#ifdef USE_64_BIT_IDX_T
+#define SIZEOF_OCTAVE_IDX_TYPE 8
+#else
+#define SIZEOF_OCTAVE_IDX_TYPE SIZEOF_INT
+#endif
+
 #include "oct-types.h"
 ])
 
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,10 @@
-2005-04-21  John W. Eaton  <jwe@octave.org>
+2005-04-21  John W Eaton  <jwe@octave.org>
+
+	* ls-mat5.cc (read_mat5_binary_element): Only read sparse matrix
+	values if sizeof (int) == sizeof (octave_idx_type).
+
+	* DLD-FUNCTIONS/colamd.cc: These functions only work if
+	sizeof (int) == sizeof (octave_idx_type).
 
 	* version.h (OCTAVE_VERSION): Now 2.9.2.
 	(OCTAVE_API_VERSION): Now api-v15.
--- a/src/DLD-FUNCTIONS/colamd.cc
+++ b/src/DLD-FUNCTIONS/colamd.cc
@@ -39,6 +39,8 @@
 #include "ov-re-sparse.h"
 #include "ov-cx-sparse.h"
 
+#if SIZEOF_INT == SIZEOF_OCTAVE_IDX_TYPE
+
 // External COLAMD functions in C
 extern "C" {
 #include "COLAMD/colamd.h"
@@ -188,6 +190,8 @@
     }
 }
 
+#endif
+
 DEFUN_DLD (colamd, args, nargout,
     "-*- texinfo -*-\n\
 @deftypefn {Loadable Function} {@var{p} =} colamd (@var{s})\n\
@@ -256,6 +260,9 @@
 @seealso{colperm, symamd}")
 {
   octave_value_list retval;
+
+#if SIZEOF_INT == SIZEOF_OCTAVE_IDX_TYPE
+
   int nargin = args.length ();
   int spumoni = 0;
  
@@ -393,6 +400,12 @@
 	}
     }
 
+#else
+
+  error ("colamd: not available in this version of Octave");
+
+#endif
+
   return retval;
 }
 
@@ -461,6 +474,9 @@
 @seealso{colperm, colamd}")
 {
   octave_value_list retval;
+
+#if SIZEOF_INT == SIZEOF_OCTAVE_IDX_TYPE
+
   int nargin = args.length ();
   int spumoni = 0;
  
@@ -580,6 +596,12 @@
 	}
     }
 
+#else
+
+  error ("symamd: not available in this version of Octave");
+
+#endif
+
   return retval;
 }
 
@@ -600,6 +622,9 @@
 @end deftypefn")
 {
   octave_value_list retval;
+
+#if SIZEOF_INT == SIZEOF_OCTAVE_IDX_TYPE
+
   int nargin = args.length ();
 
   if (nargout < 0 || nargout > 2 || nargin < 0 || nargin > 2)
@@ -705,6 +730,12 @@
 	}
     }
 
+#else
+
+  error ("etree: not available in this version of Octave");
+
+#endif
+
   return retval;
 }
 
--- a/src/ls-mat5.cc
+++ b/src/ls-mat5.cc
@@ -573,6 +573,10 @@
       goto skip_ahead;
 
     case mxSPARSE_CLASS:
+#if SIZEOF_INT != SIZEOF_OCTAVE_IDX_TYPE
+      warning ("load: sparse objects are not implemented");
+      goto skip_ahead;
+#else
       {
 	int nr = dims(0);
 	int nc = dims(1);
@@ -695,6 +699,7 @@
 	  tc = sm;
       }
       break;
+#endif
 
     case mxFUNCTION_CLASS:
       warning ("load: function handles are not implemented");