[vsipl++] Matlab IO

Mark Mitchell mark at codesourcery.com
Mon May 22 17:54:57 UTC 2006


Assem Salama wrote:
> Everyone,
>  This patch allows a user to output a matrix using the Matlab binary
> format or the Matlab m file format.

Good!

I think Stefan should review this formally for check-in.

> +  // some structures to helps determine if a type is single precision
> +  template <typename T>
> +  struct Is_single
> +  { static bool const value = false; };
> +
> +  template <>
> +  struct Is_single<float>
> +  { static bool const value = true; };
> +
> +  template <>
> +  struct Is_single<std::complex<float> >
> +  { static bool const value = true; };

Depending on what you mean by "single-precision" this may not be the
right test.  For example, you might mean "32-bit IEEE", which is not
necessarily the same as "float"; on some systems "double" is 32-bits as
well, and on other systems "float" can be 16 bits, or not IEEE format.

Were you able to test that the format is correct by loading it into
Matlab (or Octave)?

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark at codesourcery.com
(650) 331-3385 x713



More information about the vsipl++ mailing list