On the fly jit.matrix type conversion (char, float32, float64, long)
Hello everyone!
My situation: I need to read a matrix of char values or [insert data type] values and convert them to float32, float64, or long values.
Ideally, I'd need a way to convert between these different data types on the fly, perhaps it would be possible to encapsulate the desired behaviour into its own abstraction?
I'm new to Max, and so at this point, I'm just a bit lost :/
Do you know of a way to take a pre-existing jit matrix and convert its contents from one data type to another?
maybe [jit.coerce] could be helpful
if you simply want to convert types, e.g. char to float32, then simply send your source matrix into a destination matrix that is adapt disabled (which it will be if you give it arguments, e.g. jit.matrix 4 float32 10 10
Thank you both for your help! In the end what I went with was sending settype messages to a destination matrix with the same dimensions as a source matrix (more get messages to automatically infer that info), and then filling the type-updated destination matrix with the source matrix using jit.fill.