Le 31/12/2015 04:33, Ole Ersoy a écrit :
> Hi,
> 
> In RealMatrixFormat.parse() MatrixUtils makes the decision on what type
> of RealMatrix instance to return.  Flexibility is gained if it just
> returns double[][] letting the caller decide what type of RealMatrix
> instance to create.  It's also better for modularity, as is reduces
> RealMatrixFormat imports (The MatrixUtils supports Field matrices as
> well, and I'm attempting to separate real and field matrices into two
> difference modules).
> 
> Also just curious if Array2DRowRealMatrix is worth keeping?  It seems
> like the performance of BlockRealMatrix might be just as good or better
> regardless of matrix size ... although my testing is limited.

As far as I am concerned, Array2DRowRealMatrix is used in places where
I want to avoid copying the data. The can occur both at construction
and at data retrieval. See the constructor with the boolean to simply
reuse an allocated array rather, and see the getDataRef getter.

Of course, using this feature is rather expert use. Typically, it is
done when some algorithm creates the data array by itself, and then
wants to return it as a matrix, but will not use the array by itself
anymore. In this case, transfering ownership of the array to the matrix
instance is not a bad thing, particularly if the array is big.

I agree this case is really specific so it may not be sufficient to keep
this class (or to keep the constructor and the special getter).

best regards,
Luc

> 
> Cheers,
> Ole
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to