changeset 6271:6fab59e81b4e

[project @ 2007-02-06 01:36:46 by jwe]
author jwe
date Tue, 06 Feb 2007 01:36:47 +0000
parents c8d25f552230
children a1f3d3b7ee5c
files ChangeLog configure.in liboctave/ChangeLog liboctave/file-ops.cc src/ChangeLog src/mex.cc
diffstat 6 files changed, 66 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Feb 05 21:42:21 2007 +0000
+++ b/ChangeLog	Tue Feb 06 01:36:47 2007 +0000
@@ -1,5 +1,7 @@
 2007-02-05  John W. Eaton  <jwe@octave.org>
 
+	* configure.in: Check for realpath function.
+
 	* demo.m: Delete obsolete file.
 
 2007-01-29  Michael Goffioul  <michael.goffioul@swing.be>
--- a/configure.in	Mon Feb 05 21:42:21 2007 +0000
+++ b/configure.in	Tue Feb 06 01:36:47 2007 +0000
@@ -29,7 +29,7 @@
 EXTERN_CXXFLAGS="$CXXFLAGS"
 
 AC_INIT
-AC_REVISION($Revision: 1.551 $)
+AC_REVISION($Revision: 1.552 $)
 AC_PREREQ(2.57)
 AC_CONFIG_SRCDIR([src/octave.cc])
 AC_CONFIG_HEADER(config.h)
@@ -1418,7 +1418,7 @@
   getgid getgrent getgrgid getgrnam getpgrp getpid getppid getpwent \
   getpwuid gettimeofday getuid getwd _kbhit kill link localtime_r \
   lstat memmove mkdir mkfifo mkstemp on_exit pipe poll putenv raise \
-  readlink rename resolvepath rindex rmdir round select setgrent \
+  readlink realpath rename resolvepath rindex rmdir round select setgrent \
   setlocale setpwent setvbuf sigaction siglongjmp sigpending sigprocmask \
   sigsuspend stat strcasecmp strdup strerror stricmp \
   strncasecmp strnicmp strsignal symlink tempnam umask \
--- a/liboctave/ChangeLog	Mon Feb 05 21:42:21 2007 +0000
+++ b/liboctave/ChangeLog	Tue Feb 06 01:36:47 2007 +0000
@@ -1,3 +1,8 @@
+2007-02-05  Thomas Treichl  <Thomas.Treichl@gmx.net>
+
+	* file-ops.cc (file_ops::canonicalize_file_name):
+	Provide implementation if realpath function is available.
+
 2007-01-29  Michael Goffioul  <michael.goffioul@swing.be>
 
 	* oct-fftw.h: Sprinkle with OCTAVE_API as needed.
--- a/liboctave/file-ops.cc	Mon Feb 05 21:42:21 2007 +0000
+++ b/liboctave/file-ops.cc	Tue Feb 06 01:36:47 2007 +0000
@@ -482,6 +482,28 @@
         }
     }
 
+#elif defined (HAVE_REALPATH)
+
+#if !defined (__set_errno)
+# define __set_errno(Val) errno = (Val)
+#endif
+
+  if (name.empty ())
+    {
+      __set_errno (ENOENT);
+      return retval;
+    }
+
+  OCTAVE_LOCAL_BUFFER (char, buf, PATH_MAX);
+
+  char *tmp = ::realpath (name.c_str (), buf);
+
+  if (tmp)
+    {
+      retval = tmp;
+      ::free (tmp);
+    }
+
 #else
 
   // FIXME -- provide replacement here...
--- a/src/ChangeLog	Mon Feb 05 21:42:21 2007 +0000
+++ b/src/ChangeLog	Tue Feb 06 01:36:47 2007 +0000
@@ -1,5 +1,9 @@
 2007-02-05  John W. Eaton  <jwe@octave.org>
 
+	* mex.cc (mxArray_number::as_octave_value): Fake mxSINGLE_CLASS
+	by returning double-precision values.
+	(mxArray_sparse::as_octave_value): Clarify error message.
+
 	* ov-complex.h (octave_complex): Use std instead of OCTAVE_STD
 	since the latter was unconditionally defined to be std anyway.
 
--- a/src/mex.cc	Mon Feb 05 21:42:21 2007 +0000
+++ b/src/mex.cc	Tue Feb 06 01:36:47 2007 +0000
@@ -1249,7 +1249,36 @@
 	break;
 
       case mxSINGLE_CLASS:
-	error ("single precision data type not supported");
+	{
+	  int nel = get_number_of_elements ();
+
+	  float *ppr = static_cast<float *> (pr);
+
+	  if (pi)
+	    {
+	      ComplexNDArray val (dv);
+
+	      Complex *ptr = val.fortran_vec ();
+
+	      float *ppi = static_cast<float *> (pi);
+
+	      for (int i = 0; i < nel; i++)
+		ptr[i] = Complex (ppr[i], ppi[i]);
+
+	      retval = val;
+	    }
+	  else
+	    {
+	      NDArray val (dv);
+
+	      double *ptr = val.fortran_vec ();
+
+	      for (int i = 0; i < nel; i++)
+		ptr[i] = ppr[i];
+
+	      retval = val;
+	    }
+	}
 	break;
 
       case mxDOUBLE_CLASS:
@@ -1425,7 +1454,7 @@
 	break;
 
       case mxSINGLE_CLASS:
-	error ("single precision data type not supported");
+	error ("single precision sparse data type not supported");
 	break;
 
       case mxDOUBLE_CLASS: