Affine transforms - matrix algebra

Pavel Safrata pavel.safrata at
Thu Jul 12 10:42:00 PDT 2012

On 12.7.2012 19:22, Martin Desruisseaux wrote:
> Le 12/07/12 17:15, Pavel Safrata a écrit :
>> Should the array-accepting methods accept also arrays of length 6 
>> (containing only 2D-relevant elements)?
> I don't see any objection.

Me neither unless we know that it's completely useless and would only 
complicate the doc.

>> Should the array-returning methods return 12 elements or 16?
> I don't see an obvious answer... Maybe the following method:
>> public double[] toArray(double[] a) 
> could accept both. But I'm not sure what should be the default 
> behavior when no destination array is given. Or maybe we could avoid 
> the question by making the destination array mandatory.

Even in this case I don't really like the inconsistency with List which 
allocates new array if the given one is not sufficient. I think we 
either need to choose one of the numbers or do

public double[] toArray(MatrixArrayType type[, double[] a)

where MatrixArrayType is an enum with values MAT_2D, MAT_3D, MAT_Full, 
requesting 6, 12, 16 numbers respectively. How does that sound?


>     Martin

More information about the openjfx-dev mailing list