changeset 11132:6ed521ed2d6a

Stop converting single valued output from mex files to doubles.
author Gunnar Farneback <gunnar@lysator.liu.se>
date Thu, 21 Oct 2010 21:15:44 +0200
parents 953bb56af598
children c5640104bce1
files src/ChangeLog src/mex.cc
diffstat 2 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Oct 21 16:15:16 2010 -0400
+++ b/src/ChangeLog	Thu Oct 21 21:15:44 2010 +0200
@@ -17,6 +17,12 @@
 	* toplev.cc (Fsystem): Allow optional RETURN_OUTPUT and TYPE
 	arguments to be specified independently.  Update doc string.
 
+2010-10-21  Gunnar Farneback  <gunnar@lysator.liu.se>
+
+	* mex.cc (mxArray_number::as_octave_value): Convert single
+	matlab array to single octave array instead of to double octave
+	array.
+
 2010-10-18  John W. Eaton  <jwe@octave.org>
 
 	* load-path.cc (load_path::do_find_first_of,
--- a/src/mex.cc	Thu Oct 21 16:15:16 2010 -0400
+++ b/src/mex.cc	Thu Oct 21 21:15:44 2010 +0200
@@ -1361,22 +1361,22 @@
 
           if (pi)
             {
-              ComplexNDArray val (dv);
-
-              Complex *ptr = val.fortran_vec ();
+              FloatComplexNDArray val (dv);
+
+              FloatComplex *ptr = val.fortran_vec ();
 
               float *ppi = static_cast<float *> (pi);
 
               for (mwIndex i = 0; i < nel; i++)
-                ptr[i] = Complex (ppr[i], ppi[i]);
+                ptr[i] = FloatComplex (ppr[i], ppi[i]);
 
               retval = val;
             }
           else
             {
-              NDArray val (dv);
-
-              double *ptr = val.fortran_vec ();
+              FloatNDArray val (dv);
+
+              float *ptr = val.fortran_vec ();
 
               for (mwIndex i = 0; i < nel; i++)
                 ptr[i] = ppr[i];