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.
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,