[Simple-support] Save a multidimensional or 3 dimensional array of double to xml
Brought to you by:
niallg
|
From: Lukas L. <luk...@gm...> - 2012-12-17 15:43:27
|
Hi everyone,
I've got a 3-dimensional array of double to represent a matrix with values
depending on 3 parameters ( double[][][] matrix; ). Now I would like to
save this to XML using @ElementArray. Unfortunately it doesn't work
properly and I'll get an xml-code like this:
<matrix3D _abbreviation="COP">
<_dimension>3</_dimension>
<_matrix length="2">
<double[] length="4">2.14, -1.0, -1.0, 2.14, -1.0, -1.0, 2.14, -1.0,
-1.0, 2.14, -1.0, -1.0</double[]>
<double[] length="4">-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 2.73,
-1.0, -1.0, 2.73, -1.0</double[]>
</_matrix>
</matrix3D>
so the last double is not splittet properly. The -1.0 values are all right.
With a double[][] it works fine.
For me the only way that works is to convert the double[][][] into an array
of an object, which holds a 2 dimensional array of double ( double[][]
matrix2D; ), but that is kind of pedestrian ;)
Does anyone have an other idea?
Thanks a lot in advance,
Lukas
|