Tuesday, 17 May 2011
Developer Journal 82 - On Boost Serialization
I'm still working on loading a vector of floats. I don't know why it won't work. I had a look at the Boost Numerics Library but I couldn't make sense of it.
I'm now converting the float to a string, reducing the number of decimal points to five or less, and converting back to a float.
I removed the decimal points and the number after that.
I kept the decimal point.
I kept the decimal point and one number after that.
Trying up to 4 decimal places.
Up to 3 decimal places.
Up to 2 decimal places.
Strange. So strange.
I placed 0.596109 in every vector position.
I'm tracking the min and max values as well as the min and max lengths.
I placed 0.100061 into every vector position.
I placed 0.599588 into every vector position.
I changed minBitProb and maxBitProb and that resulted in different min and max values.
Strange. Serialization of the vector of floats only works if the genome has a maximum of two decimal points. Has to be enough for now.
Looks like I'm going to have to stick with two decimal points for now.
Labels: developer journal