From 08761a143f2ec59a07e3310c04ba34c4bfa87bb5 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 26 Sep 2003 06:54:57 +0000 Subject: Reverted from 'optimized' doMulMatrix to plain version (since the former botched the algo for nearly every non-trivial case --- basegfx/source/inc/hommatrixtemplate.hxx | 97 ++++---------------------------- 1 file changed, 12 insertions(+), 85 deletions(-) (limited to 'basegfx/source/inc/hommatrixtemplate.hxx') diff --git a/basegfx/source/inc/hommatrixtemplate.hxx b/basegfx/source/inc/hommatrixtemplate.hxx index 992d395dadfc..9f87ff293763 100644 --- a/basegfx/source/inc/hommatrixtemplate.hxx +++ b/basegfx/source/inc/hommatrixtemplate.hxx @@ -2,9 +2,9 @@ * * $RCSfile: hommatrixtemplate.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: thb $ $Date: 2003-08-20 16:56:48 $ + * last change: $Author: thb $ $Date: 2003-09-26 07:54:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -598,97 +598,24 @@ public: // create a copy as source for the original values const ImplHomMatrixTemplate aCopy(*this); - if(rMat.mpLine) - { - // complex first lines - for(sal_uInt16 a(0); a < (RowSize - 1); a++) - { - for(sal_uInt16 b(0); b < RowSize; b++) - { - double fValue(0.0); - - for(sal_uInt16 c(0); c < RowSize; c++) - { - fValue += aCopy.get(c, b) * rMat.get(a, c); - } + // TODO: maybe optimize cases where last line is [0 0 1]. - set(a, b, fValue); - } - } + double fValue(0.0); - if(mpLine) - { - // complex last line - for(sal_uInt16 b(0); b < RowSize; b++) - { - double fValue(0.0); - - for(sal_uInt16 c(0); c < RowSize; c++) - { - fValue += aCopy.get(c, b) * rMat.get((RowSize - 1), c); - } - - set((RowSize - 1), b, fValue); - } - - testLastLine(); - } - else - { - // last line is rMat line, copy - mpLine = new ImplMatLine< RowSize >((RowSize - 1), rMat.mpLine); - } - } - else + for(sal_uInt16 a(0); a < RowSize; ++a) { - // simplified first lines - for(sal_uInt16 a(0); a < (RowSize - 1); a++) + for(sal_uInt16 b(0); b < RowSize; ++b) { - for(sal_uInt16 b(0); b < RowSize; b++) - { - double fValue(0.0); - - for(sal_uInt16 c(0); c < (RowSize - 1); c++) - { - fValue += aCopy.get(c, b) * rMat.get(a, c); - } - - if(b == (RowSize -1)) - { - fValue += aCopy.get(a, (RowSize - 1)); - } - - set(a, b, fValue); - } - } - - if(mpLine) - { - // simplified last line - for(sal_uInt16 b(0); b < RowSize; b++) - { - double fValue(0.0); - - for(sal_uInt16 c(0); c < (RowSize - 1); c++) - { - fValue += aCopy.get(c, b) * rMat.get((RowSize - 1), c); - } + fValue = 0.0; - if(b == (RowSize -1)) - { - fValue += aCopy.get((RowSize - 1), (RowSize - 1)); - } - - set((RowSize - 1), b, fValue); - } + for(sal_uInt16 c(0); c < RowSize; ++c) + fValue += aCopy.get(c, b) * rMat.get(a, c); - testLastLine(); - } - else - { - // no last line + set(a, b, fValue); } } + + testLastLine(); } bool isEqual(const ImplHomMatrixTemplate& rMat) -- cgit v1.2.3