106 std::unique_ptr<ScMatrixImpl>
pImpl;
114 ScMatrix(
size_t nC,
size_t nR,
const std::vector<double>& rInitVals );
132 template<
typename tRes>
147 template<
typename tRes>
217 void SetImmutable()
const;
235 SCSIZE GetElementCount()
const;
244 bool ValidColRowReplicated(
SCSIZE & rC,
SCSIZE & rR )
const;
252 bool ValidColRowOrReplicated(
SCSIZE & rC,
SCSIZE & rR )
const;
255 void PutDouble(
double fVal,
SCSIZE nIndex);
256 void PutDouble(
const double* pArray,
size_t nLen,
SCSIZE nC,
SCSIZE nR);
269 void FillDouble(
double fVal,
273 void PutDoubleVector( const ::std::vector< double > & rVec,
SCSIZE nC,
SCSIZE nR ) ;
276 void PutStringVector( const ::std::vector< svl::SharedString > & rVec,
SCSIZE nC,
SCSIZE nR ) ;
297 {
return IsValue( nC, nR) ?
GetError( nC, nR) : FormulaError::NONE; }
302 double GetDouble(
SCSIZE nIndex)
const ;
304 double GetDoubleWithStringConversion(
SCSIZE nC,
SCSIZE nR )
const ;
323 bool IsStringOrEmpty(
SCSIZE nIndex )
const ;
342 bool IsValue(
SCSIZE nIndex )
const ;
356 void MatTrans(
const ScMatrix& mRes)
const ;
357 void MatCopy (
const ScMatrix& mRes)
const ;
360 void CompareEqual() ;
361 void CompareNotEqual() ;
363 void CompareGreater() ;
364 void CompareLessEqual() ;
365 void CompareGreaterEqual() ;
371 KahanIterateResult
Sum(
bool bTextAsZero,
bool bIgnoreErrorValues =
false )
const ;
372 KahanIterateResult SumSquare(
bool bTextAsZero,
bool bIgnoreErrorValues =
false )
const ;
373 DoubleIterateResult
Product(
bool bTextAsZero,
bool bIgnoreErrorValues =
false )
const ;
374 size_t Count(
bool bCountStrings,
bool bCountErrors,
bool bIgnoreEmptyStrings =
false)
const ;
375 size_t MatchDoubleInColumns(
double fValue,
size_t nCol1,
size_t nCol2)
const ;
376 size_t MatchStringInColumns(
const svl::SharedString& rStr,
size_t nCol1,
size_t nCol2)
const ;
378 double GetMaxValue(
bool bTextAsZero,
bool bIgnoreErrorValues =
false )
const ;
379 double GetMinValue(
bool bTextAsZero,
bool bIgnoreErrorValues =
false )
const ;
381 double GetLcm()
const ;
394 void GetDoubleArray( std::vector<double>& rArray,
bool bEmptyAsZero =
true )
const ;
395 void MergeDoubleArrayMultiply( std::vector<double>& rArray )
const ;
399 void AddOp(
double fVal,
const ScMatrix& rMat) ;
400 void SubOp(
bool bFlag,
double fVal,
const ScMatrix& rMat) ;
401 void MulOp(
double fVal,
const ScMatrix& rMat) ;
402 void DivOp(
bool bFlag,
double fVal,
const ScMatrix& rMat) ;
403 void PowOp(
bool bFlag,
double fVal,
const ScMatrix& rMat) ;
405 KahanIterateResultMultiple CollectKahan(
const std::vector<sc::op::kOp>& aOp) ;
407 void ExecuteOperation(
const std::pair<size_t, size_t>& rStartPos,
const std::pair<size_t, size_t>& rEndPos,
408 DoubleOpFunction aDoubleFunc, BoolOpFunction aBoolFunc, StringOpFunction aStringFunc,
409 EmptyOpFunction aEmptyFunc)
const ;
bool ValidColRow(SCCOL nCol, SCROW nRow, SCCOL nMaxCol, SCROW nMaxRow)
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Matrix data type that can store values of mixed types.
IterateResult< double > DoubleIterateResult
static bool IsEmptyPathType(ScMatValType nType)
Empty path, but not empty or any other type.
FormulaError GetErrorIfNotString(SCSIZE nC, SCSIZE nR) const
Use in ScInterpreter to obtain the error code, if any.
std::function< double(double, double)> CalculateOpFunction
IterateResult< KahanSum > KahanIterateResult
std::function< void(size_t, size_t)> EmptyOpFunction
static bool IsBooleanType(ScMatValType nType)
Boolean.
IterateResultMultiple< KahanSum > KahanIterateResultMultiple
std::function< void(size_t, size_t, svl::SharedString)> StringOpFunction
static bool IsEmptyType(ScMatValType nType)
Empty, but not empty path or any other type.
static bool IsValueType(ScMatValType nType)
Value or boolean.
std::function< void(size_t, size_t, double)> DoubleOpFunction
IterateResultMultiple< double > DoubleIterateResultMultiple
ScMatrix & operator=(const ScMatrix &)=delete
ScMatrix(const ScMatrix &)=delete
std::function< void(size_t, size_t, bool)> BoolOpFunction
std::unique_ptr< ScMatrixImpl > pImpl
static bool IsNonValueType(ScMatValType nType)
String, empty or empty path, but not value nor boolean.
static bool IsRealStringType(ScMatValType nType)
String, but not empty or empty path or any other type.
FormulaError GetDoubleErrorValue(double fVal)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
OUString GetString(int nId)
bool IsNumeric(std::u16string_view rText)
static short Compare(const OUString &sInput1, const OUString &sInput2, const bool bCaseSens, const ScUserListData *pData, const CollatorWrapper *pCW)
Naturally compares two given strings.
CAUTION! The following defines must be in the same namespace as the respective type.
double GetGcd(double f1, double f2)
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
void intrusive_ptr_add_ref(const ScMatrix *p)
void intrusive_ptr_release(const ScMatrix *p)
Try NOT to use this struct.
bool operator==(const ScMatrixValue &r) const
FormulaError GetError() const
Only valid if ScMatrix methods indicate that this is no string!
ScMatrixValue & operator=(const ScMatrixValue &r)=default
bool operator!=(const ScMatrixValue &r) const
const svl::SharedString & GetString() const
Only valid if ScMatrix methods indicate so!
ScMatrixValue(const ScMatrixValue &r)=default
bool GetBoolean() const
Only valid if ScMatrix methods indicate that this is a boolean.
When adding all numerical matrix elements for a scalar result such as summation, the interpreter want...
IterateResultMultiple(size_t nCount)
std::vector< tRes > maAccumulator
Iterator for executing one operation with the matrix data.
IterateResult(tRes fAccumulator, size_t nCount)
::boost::intrusive_ptr< ScMatrix > ScMatrixRef