rainwoodman / vast

vala and scientific numerical computation
11 stars 1 forks source link

Endianess #37

Open arteymix opened 7 years ago

arteymix commented 7 years ago

I like the idea that we don't deal with endianess and we leave that to the type and transformation.

We can do all this in Numeric-GLib by defining endianess-specific types: https://github.com/arteymix/numeric-glib/commit/775212e8f356cb3ab60ccf30af776000a0e46b79

This, of course, involve that the type is being boxed and converted on-demand. It's good because we can have have a representation of any endianess.

var arr = new Vast.Array (typeof (float_be), sizeof (float_be), {10});

var dest_value = Value (typeof (float));
arr.get_value ({0}).transform (ref dest_value);
var float_at_0 = dest_value.get_float ();
arteymix commented 7 years ago

Now we only need to fix #31 and it should be neat.