# HG changeset patch # User Gunnar Farneback # Date 1287688544 -7200 # Node ID 6ed521ed2d6ac878872c5cd59d5b92ef5745428d # Parent 953bb56af5984b725366b25801cd9082b7687adc Stop converting single valued output from mex files to doubles. diff -r 953bb56af598 -r 6ed521ed2d6a src/ChangeLog --- 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 + + * 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 * load-path.cc (load_path::do_find_first_of, diff -r 953bb56af598 -r 6ed521ed2d6a src/mex.cc --- 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 (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];