[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Conversion between Matrix and FloatMatrix classes in oct files

From: Mike Puglia
Subject: Conversion between Matrix and FloatMatrix classes in oct files
Date: Mon, 21 Oct 2013 03:49:17 -0700 (PDT)


I have an oct file application in which I need to convert a double precision Matrix into single precision FloatMatrix before passing it on to an external library.  Then on output from the external library, I need to copy a FloatMatrix into a pre-allocated Matrix.  I'm trying to figure out what is available in the API to do this as cheaply as possible.

It seems that the copy/conversion constructor for FloatMatrix accepts Matrix types, but I was wondering if there is anything in the API that might work faster for the conversion double->float?  Also, for the output case (float->double) the constructor obviously won't work since the Matrix is already allocated.  Are there any faster means for doing the copy from FloatMatrix to Matrix without simply using a double for loop and static casting the individual elements? Would static casting the entire matrix be faster, or even work?

If any one has some pointers it would be most appreciated.  I just thought I would ask before diving in, in hopes of saving some time.

Thanks in advance,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]