Michael Hanselmann wrote:
> Hello Daniel
> On Sun, Jan 07, 2007 at 03:49:43PM +0000, Daniel Thorpe wrote:
>> I'm trying to store a vector of doubles into a blob field in a mysql
>> database, along with the size of the vector in another field.
> Don't do that. Even if you could get it to work, you'll only have
> issues. Different architectures save numbers in different ways (Big and
> Little Endian, for example). At least for integers, you could also have
> problems between 32 and 64 bit architectures. You should create another
> table with a float column referencing the main table.
Or use some kind of encapsulation such as Ice's serialization support.
I've used Ice to serialize vectors (and other arbitrary types) and store
them in a blob for later retrieval and de-serialization.
- Bill Krahmer