Hi Regina,

On Thursday, 2010-08-12 16:38:33 +0200, Regina Henschel wrote:

> The current implementation avoids to copy the matrices X or Y,
> although that would ease and shorten the code. I thought there must
> be a reason for that and tried to avoid it too. I hesitate to copy X
> or Y, because they might have a huge number of lines.

Indeed.

> I will try only using new matrices for products like X'X as it is
> done in the current implementation. That will result in a lot of
> nearly identical multiplication methods, but I think, that is better
> than copying the matrices.

To avoid both, having overly complicated code and copying large
matrices, we could introduce a const/non-const flag in ScMatrix,
defaulted to const and set to non-const by GetNewMat(), but to const
again when stored in ScFormulaResult. The usual case is that a matrix
was constructed from a range reference by the interpreter and not as
a const array or formula cell result. Then having
a ScMatrix::CloneIfConst() method could just return the current matrix
if non-const and would have to actually clone only in rare const cases.

Just an idea..

  Eike

-- 
 OOo Calc core developer. Number formatter stricken i18n transpositionizer.
 Signature key 0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS
 --
 Please don't send mail to the old e...@sun.com account that I used for mailing
 lists, it phased out. Use eike.rat...@oracle.com instead. Thanks.

Attachment: pgpJuyt4EM9bD.pgp
Description: PGP signature

Reply via email to