commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <ted.dunn...@gmail.com>
Subject Re: [math] use the more general super-type RealMatrix in place of Array2DRowRealMatrix in package ode?
Date Fri, 09 Sep 2011 01:41:38 GMT
Why doesn't solve just return a RealMatrix?  Why does it insist on returning
an Array2DRowRealMatrix?

Does the user really care?

2011/9/8 S├ębastien Brisard <sebastien.brisard@m4x.org>

> Hi Luc,
> thanks for your detailed explanations attached to the MATH-659. I'm
> worried about the changes I have applied to the code, now. Here is
> what I've done. I've replaced the following line
> {code}
> return new Array2DRowRealMatrix(decomposition.getSolver().solve(b), false);
> {code}
> with
> {code}
> RealMatrix x = decomposition.getSolver().solve(new
> Array2DRowRealMatrix(b, false));
> return new Array2DRowRealMatrix(x.getData(), false);
> {code}
>
> decomposition is in fact an instance of QRDecompositionImpl.Solver,
> whose method solve(RealMatrix) returns a BlockRealMatrix, not an
> Array2DRowRealMatrix, hence the ugly last line. This code seems to be
> correct (unit tests still pass), but I'm worried about the efficiency,
> especially if initializeHighOrderDerivatives is called very often.
> What do you think should be done?
>
> Best regards,
> S├ębastien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message