[Libreoffice-commits] .: Branch 'feature/calc-matrix-rework' - sc/inc sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri Dec 17 14:31:11 PST 2010
sc/inc/scmatrix.hxx | 13 ++++-
sc/source/core/tool/scmatrix.cxx | 90 ++++++++++++++++++++++++++++++++++++---
2 files changed, 95 insertions(+), 8 deletions(-)
New commits:
commit 5e856835e6b8a30220d6bcbdd0074503075190fc
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Fri Dec 17 17:30:33 2010 -0500
Added skeleton methods for all sorts of iterative calculations.
They are not yet implemented.
diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx
index 1407f56..1d381b9 100644
--- a/sc/inc/scmatrix.hxx
+++ b/sc/inc/scmatrix.hxx
@@ -342,8 +342,17 @@ public:
void CompareLessEqual();
void CompareGreaterEqual();
- double And(); // logical AND of all matrix values, or NAN
- double Or(); // logical OR of all matrix values, or NAN
+ double And() const; // logical AND of all matrix values, or NAN
+ double Or() const; // logical OR of all matrix values, or NAN
+
+ double Sum() const;
+ double SumSquare() const;
+ double Product() const;
+ double Average(bool bTextAsZero) const;
+ double Min() const;
+ double Max() const;
+ size_t Count(bool bCountStrings) const;
+
// All other matrix functions MatMult, MInv, ... are in ScInterpreter
// to be numerically safe.
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 1af02d7..d426d08 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -208,8 +208,16 @@ public:
void CompareGreater();
void CompareLessEqual();
void CompareGreaterEqual();
- double And();
- double Or();
+ double And() const;
+ double Or() const;
+
+ double Sum() const;
+ double SumSquare() const;
+ double Product() const;
+ double Average(bool bTextAsZero) const;
+ double Min() const;
+ double Max() const;
+ size_t Count(bool bCountStrings) const;
private:
void CalcPosition(SCSIZE nIndex, SCSIZE& rC, SCSIZE& rR) const;
@@ -722,20 +730,55 @@ bool EvalMatrix(const MatrixImplType& rMat)
}
-double ScMatrixImpl::And()
+double ScMatrixImpl::And() const
{
// All elements must be of value type.
// True only if all the elements have non-zero values.
return EvalMatrix<AndEvaluator>(maMat);
}
-double ScMatrixImpl::Or()
+double ScMatrixImpl::Or() const
{
// All elements must be of value type.
// True if at least one element has a non-zero value.
return EvalMatrix<OrEvaluator>(maMat);
}
+double ScMatrixImpl::Sum() const
+{
+ return 0.0;
+}
+
+double ScMatrixImpl::SumSquare() const
+{
+ return 0.0;
+}
+
+double ScMatrixImpl::Product() const
+{
+ return 0.0;
+}
+
+double ScMatrixImpl::Average(bool bTextAsZero) const
+{
+ return 0.0;
+}
+
+double ScMatrixImpl::Min() const
+{
+ return 0.0;
+}
+
+double ScMatrixImpl::Max() const
+{
+ return 0.0;
+}
+
+size_t ScMatrixImpl::Count(bool bCountStrings) const
+{
+ return 0;
+}
+
void ScMatrixImpl::CalcPosition(SCSIZE nIndex, SCSIZE& rC, SCSIZE& rR) const
{
SCSIZE nRowSize = maMat.size().first;
@@ -998,14 +1041,49 @@ void ScMatrix::CompareGreaterEqual()
pImpl->CompareGreaterEqual();
}
-double ScMatrix::And()
+double ScMatrix::And() const
{
return pImpl->And();
}
-double ScMatrix::Or()
+double ScMatrix::Or() const
{
return pImpl->Or();
}
+double ScMatrix::Sum() const
+{
+ return pImpl->Sum();
+}
+
+double ScMatrix::SumSquare() const
+{
+ return pImpl->SumSquare();
+}
+
+double ScMatrix::Product() const
+{
+ return pImpl->Product();
+}
+
+double ScMatrix::Average(bool bTextAsZero) const
+{
+ return pImpl->Average(bTextAsZero);
+}
+
+double ScMatrix::Min() const
+{
+ return pImpl->Min();
+}
+
+double ScMatrix::Max() const
+{
+ return pImpl->Max();
+}
+
+size_t ScMatrix::Count(bool bCountStrings) const
+{
+ return pImpl->Count(bCountStrings);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list