LibreOffice Module sc (master)  1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ScMatrix Class Referencefinal

Matrix data type that can store values of mixed types. More...

#include <scmatrix.hxx>

Classes

struct  IterateResult
 When adding all numerical matrix elements for a scalar result such as summation, the interpreter wants to separate the first non-zero value with the rest of the summed values. More...
 

Public Types

typedef std::function< void(size_t, size_t, double)> DoubleOpFunction
 
typedef std::function< void(size_t, size_t, bool)> BoolOpFunction
 
typedef std::function< void(size_t, size_t, svl::SharedString)> StringOpFunction
 
typedef std::function< void(size_t, size_t)> EmptyOpFunction
 

Public Member Functions

 ScMatrix (SCSIZE nC, SCSIZE nR)
 
 ScMatrix (SCSIZE nC, SCSIZE nR, double fInitVal)
 
 ScMatrix (size_t nC, size_t nR, const std::vector< double > &rInitVals)
 
 ~ScMatrix ()
 
ScMatrixClone () const
 Clone the matrix. More...
 
ScMatrixCloneIfConst ()
 Clone the matrix if mbCloneIfConst (immutable) is set, otherwise return this matrix, to be assigned to a ScMatrixRef. More...
 
void SetMutable ()
 Set the matrix to mutable for CloneIfConst(), only the interpreter should do this and know the consequences. More...
 
void SetImmutable () const
 Set the matrix to immutable for CloneIfConst(), only the interpreter should do this and know the consequences. More...
 
void Resize (SCSIZE nC, SCSIZE nR)
 Resize the matrix to specified new dimension. More...
 
void Resize (SCSIZE nC, SCSIZE nR, double fVal)
 
ScMatrixCloneAndExtend (SCSIZE nNewCols, SCSIZE nNewRows) const
 Clone the matrix and extend it to the new size. More...
 
void IncRef () const
 
void DecRef () const
 
void SetErrorInterpreter (ScInterpreter *p)
 
void GetDimensions (SCSIZE &rC, SCSIZE &rR) const
 
SCSIZE GetElementCount () const
 
bool ValidColRow (SCSIZE nC, SCSIZE nR) const
 
bool ValidColRowReplicated (SCSIZE &rC, SCSIZE &rR) const
 For a row vector or column vector, if the position does not point into the vector but is a valid column or row offset it is adapted such that it points to an element to be replicated, same column row 0 for a row vector, same row column 0 for a column vector. More...
 
bool ValidColRowOrReplicated (SCSIZE &rC, SCSIZE &rR) const
 Checks if the matrix position is within the matrix. More...
 
void PutDouble (double fVal, SCSIZE nC, SCSIZE nR)
 
void PutDouble (double fVal, SCSIZE nIndex)
 
void PutDouble (const double *pArray, size_t nLen, SCSIZE nC, SCSIZE nR)
 
void PutString (const svl::SharedString &rStr, SCSIZE nC, SCSIZE nR)
 
void PutString (const svl::SharedString &rStr, SCSIZE nIndex)
 
void PutString (const svl::SharedString *pArray, size_t nLen, SCSIZE nC, SCSIZE nR)
 
void PutEmpty (SCSIZE nC, SCSIZE nR)
 
void PutEmptyPath (SCSIZE nC, SCSIZE nR)
 Jump sal_False without path. More...
 
void PutError (FormulaError nErrorCode, SCSIZE nC, SCSIZE nR)
 
void PutBoolean (bool bVal, SCSIZE nC, SCSIZE nR)
 
void FillDouble (double fVal, SCSIZE nC1, SCSIZE nR1, SCSIZE nC2, SCSIZE nR2)
 
void PutDoubleVector (const ::std::vector< double > &rVec, SCSIZE nC, SCSIZE nR)
 Put a column vector of doubles, starting at row nR, must fit into dimensions. More...
 
void PutStringVector (const ::std::vector< svl::SharedString > &rVec, SCSIZE nC, SCSIZE nR)
 Put a column vector of strings, starting at row nR, must fit into dimensions. More...
 
void PutEmptyVector (SCSIZE nCount, SCSIZE nC, SCSIZE nR)
 Put a column vector of empties, starting at row nR, must fit into dimensions. More...
 
void PutEmptyResultVector (SCSIZE nCount, SCSIZE nC, SCSIZE nR)
 Put a column vector of empty results, starting at row nR, must fit into dimensions. More...
 
void PutEmptyPathVector (SCSIZE nCount, SCSIZE nC, SCSIZE nR)
 Put a column vector of empty paths, starting at row nR, must fit into dimensions. More...
 
FormulaError GetError (SCSIZE nC, SCSIZE nR) const
 May be used before obtaining the double value of an element to avoid passing its NAN around. More...
 
FormulaError GetErrorIfNotString (SCSIZE nC, SCSIZE nR) const
 Use in ScInterpreter to obtain the error code, if any. More...
 
double GetDouble (SCSIZE nC, SCSIZE nR) const
 
double GetDouble (SCSIZE nIndex) const
 
double GetDoubleWithStringConversion (SCSIZE nC, SCSIZE nR) const
 
svl::SharedString GetString (SCSIZE nC, SCSIZE nR) const
 
svl::SharedString GetString (SCSIZE nIndex) const
 
svl::SharedString GetString (SvNumberFormatter &rFormatter, SCSIZE nC, SCSIZE nR) const
 
ScMatrixValue Get (SCSIZE nC, SCSIZE nR) const
 : If bString the ScMatrixValue->pS may still be NULL to indicate an empty string! More...
 
bool IsStringOrEmpty (SCSIZE nIndex) const
 
bool IsStringOrEmpty (SCSIZE nC, SCSIZE nR) const
 
bool IsEmpty (SCSIZE nC, SCSIZE nR) const
 
bool IsEmptyCell (SCSIZE nC, SCSIZE nR) const
 
bool IsEmptyResult (SCSIZE nC, SCSIZE nR) const
 
bool IsEmptyPath (SCSIZE nC, SCSIZE nR) const
 
bool IsValue (SCSIZE nIndex) const
 
bool IsValue (SCSIZE nC, SCSIZE nR) const
 
bool IsValueOrEmpty (SCSIZE nC, SCSIZE nR) const
 
bool IsBoolean (SCSIZE nC, SCSIZE nR) const
 
bool IsNumeric () const
 
void MatTrans (const ScMatrix &mRes) const
 
void MatCopy (const ScMatrix &mRes) const
 
void CompareEqual ()
 
void CompareNotEqual ()
 
void CompareLess ()
 
void CompareGreater ()
 
void CompareLessEqual ()
 
void CompareGreaterEqual ()
 
double And () const
 
double Or () const
 
double Xor () const
 
IterateResult Sum (bool bTextAsZero, bool bIgnoreErrorValues=false) const
 
IterateResult SumSquare (bool bTextAsZero, bool bIgnoreErrorValues=false) const
 
IterateResult Product (bool bTextAsZero, bool bIgnoreErrorValues=false) const
 
size_t Count (bool bCountStrings, bool bCountErrors) const
 
size_t MatchDoubleInColumns (double fValue, size_t nCol1, size_t nCol2) const
 
size_t MatchStringInColumns (const svl::SharedString &rStr, size_t nCol1, size_t nCol2) const
 
double GetMaxValue (bool bTextAsZero, bool bIgnoreErrorValues=false) const
 
double GetMinValue (bool bTextAsZero, bool bIgnoreErrorValues=false) const
 
double GetGcd () const
 
double GetLcm () const
 
ScMatrixRef CompareMatrix (sc::Compare &rComp, size_t nMatPos, sc::CompareOptions *pOptions) const
 
void GetDoubleArray (std::vector< double > &rArray, bool bEmptyAsZero=true) const
 Convert the content of matrix into a linear array of numeric values. More...
 
void MergeDoubleArrayMultiply (std::vector< double > &rArray) const
 
void NotOp (const ScMatrix &rMat)
 
void NegOp (const ScMatrix &rMat)
 
void AddOp (double fVal, const ScMatrix &rMat)
 
void SubOp (bool bFlag, double fVal, const ScMatrix &rMat)
 
void MulOp (double fVal, const ScMatrix &rMat)
 
void DivOp (bool bFlag, double fVal, const ScMatrix &rMat)
 
void PowOp (bool bFlag, double fVal, const ScMatrix &rMat)
 
std::vector< ScMatrix::IterateResultCollect (const std::vector< sc::op::Op > &aOp)
 
void ExecuteOperation (const std::pair< size_t, size_t > &rStartPos, const std::pair< size_t, size_t > &rEndPos, DoubleOpFunction aDoubleFunc, BoolOpFunction aBoolFunc, StringOpFunction aStringFunc, EmptyOpFunction aEmptyFunc) const
 
void MatConcat (SCSIZE nMaxCol, SCSIZE nMaxRow, const ScMatrixRef &xMat1, const ScMatrixRef &xMat2, SvNumberFormatter &rFormatter, svl::SharedStringPool &rPool)
 

Static Public Member Functions

static bool IsSizeAllocatable (SCSIZE nC, SCSIZE nR)
 Checks nC or nR for zero and uses GetElementsMax() whether a matrix of the size of nC*nR could be allocated. More...
 
static bool IsValueType (ScMatValType nType)
 Value or boolean. More...
 
static bool IsBooleanType (ScMatValType nType)
 Boolean. More...
 
static bool IsNonValueType (ScMatValType nType)
 String, empty or empty path, but not value nor boolean. More...
 
static bool IsRealStringType (ScMatValType nType)
 String, but not empty or empty path or any other type. More...
 
static bool IsEmptyType (ScMatValType nType)
 Empty, but not empty path or any other type. More...
 
static bool IsEmptyPathType (ScMatValType nType)
 Empty path, but not empty or any other type. More...
 

Private Member Functions

 ScMatrix (const ScMatrix &)=delete
 
ScMatrixoperator= (const ScMatrix &)=delete
 

Private Attributes

size_t nRefCnt
 
bool mbCloneIfConst
 
std::unique_ptr< ScMatrixImplpImpl
 

Friends

class ScMatrixImpl
 

Detailed Description

Matrix data type that can store values of mixed types.

Each element can be one of the following types: numeric, string, boolean, empty, and empty path.

Definition at line 113 of file scmatrix.hxx.

Member Typedef Documentation

typedef std::function<void(size_t, size_t, bool)> ScMatrix::BoolOpFunction

Definition at line 131 of file scmatrix.hxx.

typedef std::function<void(size_t, size_t, double)> ScMatrix::DoubleOpFunction

Definition at line 130 of file scmatrix.hxx.

typedef std::function<void(size_t, size_t)> ScMatrix::EmptyOpFunction

Definition at line 133 of file scmatrix.hxx.

typedef std::function<void(size_t, size_t, svl::SharedString)> ScMatrix::StringOpFunction

Definition at line 132 of file scmatrix.hxx.

Constructor & Destructor Documentation

ScMatrix::ScMatrix ( const ScMatrix )
privatedelete

Referenced by Clone(), and CloneAndExtend().

ScMatrix::ScMatrix ( SCSIZE  nC,
SCSIZE  nR 
)

Definition at line 2886 of file scmatrix.cxx.

References CreateDoubleError(), IsSizeAllocatable(), pImpl, and ScMatrixImpl.

ScMatrix::ScMatrix ( SCSIZE  nC,
SCSIZE  nR,
double  fInitVal 
)

Definition at line 2896 of file scmatrix.cxx.

References CreateDoubleError(), IsSizeAllocatable(), pImpl, and ScMatrixImpl.

ScMatrix::ScMatrix ( size_t  nC,
size_t  nR,
const std::vector< double > &  rInitVals 
)

Definition at line 2906 of file scmatrix.cxx.

References CreateDoubleError(), IsSizeAllocatable(), pImpl, and ScMatrixImpl.

ScMatrix::~ScMatrix ( )

Definition at line 2916 of file scmatrix.cxx.

Member Function Documentation

void ScMatrix::AddOp ( double  fVal,
const ScMatrix rMat 
)

Definition at line 3404 of file scmatrix.cxx.

References a, and pImpl.

double ScMatrix::And ( ) const

Definition at line 3208 of file scmatrix.cxx.

References pImpl.

ScMatrix * ScMatrix::Clone ( ) const

Clone the matrix.

Definition at line 2920 of file scmatrix.cxx.

References MatCopy(), pImpl, ScMatrix(), and SetErrorInterpreter().

Referenced by CloneIfConst().

ScMatrix * ScMatrix::CloneAndExtend ( SCSIZE  nNewCols,
SCSIZE  nNewRows 
) const

Clone the matrix and extend it to the new size.

nNewCols and nNewRows MUST be at least of the size of the original matrix.

Definition at line 2955 of file scmatrix.cxx.

References MatCopy(), pImpl, ScMatrix(), and SetErrorInterpreter().

ScMatrix * ScMatrix::CloneIfConst ( )

Clone the matrix if mbCloneIfConst (immutable) is set, otherwise return this matrix, to be assigned to a ScMatrixRef.

Definition at line 2930 of file scmatrix.cxx.

References Clone(), and mbCloneIfConst.

std::vector< ScMatrix::IterateResult > ScMatrix::Collect ( const std::vector< sc::op::Op > &  aOp)

Definition at line 3473 of file scmatrix.cxx.

References pImpl.

void ScMatrix::CompareEqual ( )

Definition at line 3178 of file scmatrix.cxx.

References pImpl.

void ScMatrix::CompareGreater ( )

Definition at line 3193 of file scmatrix.cxx.

References pImpl.

void ScMatrix::CompareGreaterEqual ( )

Definition at line 3203 of file scmatrix.cxx.

References pImpl.

void ScMatrix::CompareLess ( )

Definition at line 3188 of file scmatrix.cxx.

References pImpl.

void ScMatrix::CompareLessEqual ( )

Definition at line 3198 of file scmatrix.cxx.

References pImpl.

ScMatrixRef ScMatrix::CompareMatrix ( sc::Compare rComp,
size_t  nMatPos,
sc::CompareOptions pOptions 
) const

Definition at line 3274 of file scmatrix.cxx.

References pImpl.

Referenced by ScInterpreter::CompareMat().

void ScMatrix::CompareNotEqual ( )

Definition at line 3183 of file scmatrix.cxx.

References pImpl.

size_t ScMatrix::Count ( bool  bCountStrings,
bool  bCountErrors 
) const

Definition at line 3238 of file scmatrix.cxx.

References pImpl.

void ScMatrix::DecRef ( ) const
void ScMatrix::DivOp ( bool  bFlag,
double  fVal,
const ScMatrix rMat 
)

Definition at line 3434 of file scmatrix.cxx.

References a, sc::div(), and pImpl.

void ScMatrix::ExecuteOperation ( const std::pair< size_t, size_t > &  rStartPos,
const std::pair< size_t, size_t > &  rEndPos,
DoubleOpFunction  aDoubleFunc,
BoolOpFunction  aBoolFunc,
StringOpFunction  aStringFunc,
EmptyOpFunction  aEmptyFunc 
) const

Definition at line 3466 of file scmatrix.cxx.

References pImpl.

void ScMatrix::FillDouble ( double  fVal,
SCSIZE  nC1,
SCSIZE  nR1,
SCSIZE  nC2,
SCSIZE  nR2 
)

Definition at line 3148 of file scmatrix.cxx.

References pImpl.

ScMatrixValue ScMatrix::Get ( SCSIZE  nC,
SCSIZE  nR 
) const
void ScMatrix::GetDimensions ( SCSIZE rC,
SCSIZE rR 
) const
double ScMatrix::GetDouble ( SCSIZE  nC,
SCSIZE  nR 
) const
double ScMatrix::GetDouble ( SCSIZE  nIndex) const
Returns
0.0 if empty or empty path, else value or DoubleError.

Definition at line 3053 of file scmatrix.cxx.

References pImpl.

void ScMatrix::GetDoubleArray ( std::vector< double > &  rArray,
bool  bEmptyAsZero = true 
) const

Convert the content of matrix into a linear array of numeric values.

String elements are mapped to NaN's and empty elements are mapped to either NaN or zero values.

Parameters
bEmptyAsZeroif true empty elements are mapped to zero values, otherwise they become NaN values.

Definition at line 3280 of file scmatrix.cxx.

References pImpl.

double ScMatrix::GetDoubleWithStringConversion ( SCSIZE  nC,
SCSIZE  nR 
) const
Returns
value or DoubleError or string converted to value.

Definition at line 3058 of file scmatrix.cxx.

References pImpl.

SCSIZE ScMatrix::GetElementCount ( ) const

Definition at line 2973 of file scmatrix.cxx.

References pImpl.

FormulaError ScMatrix::GetError ( SCSIZE  nC,
SCSIZE  nR 
) const

May be used before obtaining the double value of an element to avoid passing its NAN around.

: MUST NOT be used if the element is a string! Use GetErrorIfNotString() instead if not sure.

Returns
0 if no error, else one of err... constants

Definition at line 3043 of file scmatrix.cxx.

References pImpl.

Referenced by ScCompiler::CreateStringFromMatrix().

FormulaError ScMatrix::GetErrorIfNotString ( SCSIZE  nC,
SCSIZE  nR 
) const
inline

Use in ScInterpreter to obtain the error code, if any.

Returns
0 if no error or string element, else one of err... constants

Definition at line 290 of file scmatrix.hxx.

References GetError().

Referenced by lcl_MatrixCalculation().

double ScMatrix::GetGcd ( ) const

Definition at line 3263 of file scmatrix.cxx.

References pImpl.

double ScMatrix::GetLcm ( ) const

Definition at line 3268 of file scmatrix.cxx.

References pImpl.

double ScMatrix::GetMaxValue ( bool  bTextAsZero,
bool  bIgnoreErrorValues = false 
) const

Definition at line 3253 of file scmatrix.cxx.

References pImpl.

double ScMatrix::GetMinValue ( bool  bTextAsZero,
bool  bIgnoreErrorValues = false 
) const

Definition at line 3258 of file scmatrix.cxx.

References pImpl.

svl::SharedString ScMatrix::GetString ( SCSIZE  nC,
SCSIZE  nR 
) const
svl::SharedString ScMatrix::GetString ( SCSIZE  nIndex) const
Returns
empty string if empty or empty path, else string content.

Definition at line 3068 of file scmatrix.cxx.

References pImpl.

svl::SharedString ScMatrix::GetString ( SvNumberFormatter rFormatter,
SCSIZE  nC,
SCSIZE  nR 
) const
Returns
the matrix element's string if one is present, otherwise the numerical value formatted as string, or in case of an error the error string is returned; an empty string for empty, a "FALSE" string for empty path.

Definition at line 3073 of file scmatrix.cxx.

References pImpl.

void ScMatrix::IncRef ( ) const
bool ScMatrix::IsBoolean ( SCSIZE  nC,
SCSIZE  nR 
) const
Returns
<TRUE> if boolean.

Definition at line 3128 of file scmatrix.cxx.

References pImpl.

Referenced by ScCompiler::CreateStringFromMatrix(), and ScChart2DataSequence::FillCacheFromExternalRef().

static bool ScMatrix::IsBooleanType ( ScMatValType  nType)
inlinestatic

Boolean.

Definition at line 167 of file scmatrix.hxx.

References Boolean.

Referenced by XclExpFmlaCompImpl::ProcessMatrix().

bool ScMatrix::IsEmpty ( SCSIZE  nC,
SCSIZE  nR 
) const
Returns
<TRUE> if empty or empty cell or empty result, not empty path.

Definition at line 3093 of file scmatrix.cxx.

References pImpl.

Referenced by ScCompiler::CreateStringFromMatrix(), ScDBQueryDataIterator::DataAccessMatrix::getCurrent(), and lcl_storeJumpMatResult().

bool ScMatrix::IsEmptyCell ( SCSIZE  nC,
SCSIZE  nR 
) const
Returns
<TRUE> if empty cell, not empty or empty result or empty path.

Definition at line 3098 of file scmatrix.cxx.

References pImpl.

bool ScMatrix::IsEmptyPath ( SCSIZE  nC,
SCSIZE  nR 
) const
Returns
<TRUE> if empty path, not empty or empty cell or empty result.

Definition at line 3108 of file scmatrix.cxx.

References pImpl.

static bool ScMatrix::IsEmptyPathType ( ScMatValType  nType)
inlinestatic

Empty path, but not empty or any other type.

Definition at line 193 of file scmatrix.hxx.

References EmptyPath, and NonvalueMask.

Referenced by ScInterpreter::ScMatRef().

bool ScMatrix::IsEmptyResult ( SCSIZE  nC,
SCSIZE  nR 
) const
Returns
<TRUE> if empty result, not empty or empty cell or empty path.

Definition at line 3103 of file scmatrix.cxx.

References pImpl.

static bool ScMatrix::IsEmptyType ( ScMatValType  nType)
inlinestatic

Empty, but not empty path or any other type.

Definition at line 187 of file scmatrix.hxx.

References Empty, and NonvalueMask.

Referenced by ScInterpreter::ScMatRef(), and ScXMLExportDDELinks::WriteCell().

static bool ScMatrix::IsNonValueType ( ScMatValType  nType)
inlinestatic
bool ScMatrix::IsNumeric ( ) const
Returns
<TRUE> if entire matrix is numeric, including booleans, with no strings or empties

Definition at line 3133 of file scmatrix.cxx.

References pImpl.

static bool ScMatrix::IsRealStringType ( ScMatValType  nType)
inlinestatic

String, but not empty or empty path or any other type.

Not named IsStringType to prevent confusion because previously IsNonValueType was named IsStringType.

Definition at line 181 of file scmatrix.hxx.

References NonvalueMask, and String.

Referenced by ScInterpreter::IterateParametersIf(), ScInterpreter::IterateParametersIfs(), ScInterpreter::ScCountIf(), and ScInterpreter::ScHyperLink().

bool ScMatrix::IsSizeAllocatable ( SCSIZE  nC,
SCSIZE  nR 
)
static

Checks nC or nR for zero and uses GetElementsMax() whether a matrix of the size of nC*nR could be allocated.

A zero size (both nC and nR zero) matrix is allowed for later resize.

Definition at line 2840 of file scmatrix.cxx.

References bElementsMaxFetched, GetElementsMax(), nElementsMax, SAL_WARN, and SAL_WARN_IF.

Referenced by ScInterpreter::CreateMatrixFromDoubleRef(), ScMatrixImpl::Resize(), ScInterpreter::ScEMat(), ScInterpreter::ScMatDet(), ScInterpreter::ScMatInv(), and ScMatrix().

bool ScMatrix::IsStringOrEmpty ( SCSIZE  nIndex) const
Returns
<TRUE> if string or any empty, empty cell, empty result, empty path, in fact non-value.

Definition at line 3083 of file scmatrix.cxx.

References pImpl.

Referenced by ScCompiler::CreateStringFromMatrix(), ScChart2DataSequence::FillCacheFromExternalRef(), ScDBQueryDataIterator::DataAccessMatrix::getCurrent(), and lcl_MatrixCalculation().

bool ScMatrix::IsStringOrEmpty ( SCSIZE  nC,
SCSIZE  nR 
) const
Returns
<TRUE> if string or any empty, empty cell, empty result, empty path, in fact non-value.

Definition at line 3088 of file scmatrix.cxx.

References pImpl.

bool ScMatrix::IsValue ( SCSIZE  nIndex) const
Returns
<TRUE> if value or boolean.

Definition at line 3113 of file scmatrix.cxx.

References pImpl.

Referenced by ScCompiler::CreateStringFromMatrix(), ScChart2DataSequence::FillCacheFromExternalRef(), and lcl_storeJumpMatResult().

bool ScMatrix::IsValue ( SCSIZE  nC,
SCSIZE  nR 
) const
Returns
<TRUE> if value or boolean.

Definition at line 3118 of file scmatrix.cxx.

References pImpl.

bool ScMatrix::IsValueOrEmpty ( SCSIZE  nC,
SCSIZE  nR 
) const
Returns
<TRUE> if value or boolean or empty or empty path.

Definition at line 3123 of file scmatrix.cxx.

References pImpl.

Referenced by lcl_MatrixCalculation().

static bool ScMatrix::IsValueType ( ScMatValType  nType)
inlinestatic
size_t ScMatrix::MatchDoubleInColumns ( double  fValue,
size_t  nCol1,
size_t  nCol2 
) const

Definition at line 3243 of file scmatrix.cxx.

References pImpl.

size_t ScMatrix::MatchStringInColumns ( const svl::SharedString rStr,
size_t  nCol1,
size_t  nCol2 
) const

Definition at line 3248 of file scmatrix.cxx.

References pImpl.

void ScMatrix::MatConcat ( SCSIZE  nMaxCol,
SCSIZE  nMaxRow,
const ScMatrixRef xMat1,
const ScMatrixRef xMat2,
SvNumberFormatter rFormatter,
svl::SharedStringPool rPool 
)

Definition at line 3485 of file scmatrix.cxx.

References pImpl.

void ScMatrix::MatCopy ( const ScMatrix mRes) const

Definition at line 3138 of file scmatrix.cxx.

References pImpl.

Referenced by Clone(), CloneAndExtend(), and ScInterpreter::ScDde().

void ScMatrix::MatTrans ( const ScMatrix mRes) const

Definition at line 3143 of file scmatrix.cxx.

References pImpl.

void ScMatrix::MergeDoubleArrayMultiply ( std::vector< double > &  rArray) const

Definition at line 3285 of file scmatrix.cxx.

References pImpl.

void ScMatrix::MulOp ( double  fVal,
const ScMatrix rMat 
)

Definition at line 3427 of file scmatrix.cxx.

References a, and pImpl.

void ScMatrix::NegOp ( const ScMatrix rMat)

Definition at line 3397 of file scmatrix.cxx.

References a, and pImpl.

void ScMatrix::NotOp ( const ScMatrix rMat)

Definition at line 3390 of file scmatrix.cxx.

References a, and pImpl.

ScMatrix& ScMatrix::operator= ( const ScMatrix )
privatedelete
double ScMatrix::Or ( ) const

Definition at line 3213 of file scmatrix.cxx.

References pImpl.

void ScMatrix::PowOp ( bool  bFlag,
double  fVal,
const ScMatrix rMat 
)

Definition at line 3450 of file scmatrix.cxx.

References a, pImpl, and sc::power().

ScMatrix::IterateResult ScMatrix::Product ( bool  bTextAsZero,
bool  bIgnoreErrorValues = false 
) const

Definition at line 3233 of file scmatrix.cxx.

References pImpl.

void ScMatrix::PutBoolean ( bool  bVal,
SCSIZE  nC,
SCSIZE  nR 
)

Definition at line 3038 of file scmatrix.cxx.

References pImpl.

Referenced by ScTokenArray::MergeArray(), and ExcelToSc::ReadExtensionArray().

void ScMatrix::PutDouble ( double  fVal,
SCSIZE  nC,
SCSIZE  nR 
)

Definition at line 2993 of file scmatrix.cxx.

References pImpl.

Referenced by lcl_LUP_decompose(), ScTokenArray::MergeArray(), and ExcelToSc::ReadExtensionArray().

void ScMatrix::PutDouble ( double  fVal,
SCSIZE  nIndex 
)

Definition at line 2998 of file scmatrix.cxx.

References pImpl.

void ScMatrix::PutDouble ( const double *  pArray,
size_t  nLen,
SCSIZE  nC,
SCSIZE  nR 
)

Definition at line 3003 of file scmatrix.cxx.

References pImpl.

void ScMatrix::PutDoubleVector ( const ::std::vector< double > &  rVec,
SCSIZE  nC,
SCSIZE  nR 
)

Put a column vector of doubles, starting at row nR, must fit into dimensions.

Definition at line 3153 of file scmatrix.cxx.

References pImpl.

void ScMatrix::PutEmpty ( SCSIZE  nC,
SCSIZE  nR 
)

Definition at line 3023 of file scmatrix.cxx.

References pImpl.

Referenced by ScTokenArray::MergeArray(), and ExcelToSc::ReadExtensionArray().

void ScMatrix::PutEmptyPath ( SCSIZE  nC,
SCSIZE  nR 
)

Jump sal_False without path.

Definition at line 3028 of file scmatrix.cxx.

References pImpl.

void ScMatrix::PutEmptyPathVector ( SCSIZE  nCount,
SCSIZE  nC,
SCSIZE  nR 
)

Put a column vector of empty paths, starting at row nR, must fit into dimensions.

Definition at line 3173 of file scmatrix.cxx.

References pImpl.

void ScMatrix::PutEmptyResultVector ( SCSIZE  nCount,
SCSIZE  nC,
SCSIZE  nR 
)

Put a column vector of empty results, starting at row nR, must fit into dimensions.

Definition at line 3168 of file scmatrix.cxx.

References pImpl.

void ScMatrix::PutEmptyVector ( SCSIZE  nCount,
SCSIZE  nC,
SCSIZE  nR 
)

Put a column vector of empties, starting at row nR, must fit into dimensions.

Definition at line 3163 of file scmatrix.cxx.

References pImpl.

void ScMatrix::PutError ( FormulaError  nErrorCode,
SCSIZE  nC,
SCSIZE  nR 
)

Definition at line 3033 of file scmatrix.cxx.

References pImpl.

Referenced by ExcelToSc::ReadExtensionArray().

void ScMatrix::PutString ( const svl::SharedString rStr,
SCSIZE  nC,
SCSIZE  nR 
)

Definition at line 3008 of file scmatrix.cxx.

References pImpl.

Referenced by ScTokenArray::MergeArray(), and ExcelToSc::ReadExtensionArray().

void ScMatrix::PutString ( const svl::SharedString rStr,
SCSIZE  nIndex 
)

Definition at line 3013 of file scmatrix.cxx.

References pImpl.

void ScMatrix::PutString ( const svl::SharedString pArray,
size_t  nLen,
SCSIZE  nC,
SCSIZE  nR 
)

Definition at line 3018 of file scmatrix.cxx.

References pImpl.

void ScMatrix::PutStringVector ( const ::std::vector< svl::SharedString > &  rVec,
SCSIZE  nC,
SCSIZE  nR 
)

Put a column vector of strings, starting at row nR, must fit into dimensions.

Definition at line 3158 of file scmatrix.cxx.

References pImpl.

void ScMatrix::Resize ( SCSIZE  nC,
SCSIZE  nR 
)

Resize the matrix to specified new dimension.

Definition at line 2945 of file scmatrix.cxx.

References pImpl.

Referenced by ExcelToSc::ReadExtensionArray().

void ScMatrix::Resize ( SCSIZE  nC,
SCSIZE  nR,
double  fVal 
)

Definition at line 2950 of file scmatrix.cxx.

References pImpl.

void ScMatrix::SetErrorInterpreter ( ScInterpreter p)

Definition at line 2963 of file scmatrix.cxx.

References pImpl.

Referenced by Clone(), and CloneAndExtend().

void ScMatrix::SetImmutable ( ) const

Set the matrix to immutable for CloneIfConst(), only the interpreter should do this and know the consequences.

Definition at line 2940 of file scmatrix.cxx.

References mbCloneIfConst.

void ScMatrix::SetMutable ( )

Set the matrix to mutable for CloneIfConst(), only the interpreter should do this and know the consequences.

Definition at line 2935 of file scmatrix.cxx.

References mbCloneIfConst.

void ScMatrix::SubOp ( bool  bFlag,
double  fVal,
const ScMatrix rMat 
)

Definition at line 3411 of file scmatrix.cxx.

References a, and pImpl.

ScMatrix::IterateResult ScMatrix::Sum ( bool  bTextAsZero,
bool  bIgnoreErrorValues = false 
) const

Definition at line 3223 of file scmatrix.cxx.

References pImpl.

ScMatrix::IterateResult ScMatrix::SumSquare ( bool  bTextAsZero,
bool  bIgnoreErrorValues = false 
) const

Definition at line 3228 of file scmatrix.cxx.

References pImpl.

bool ScMatrix::ValidColRow ( SCSIZE  nC,
SCSIZE  nR 
) const

Definition at line 2978 of file scmatrix.cxx.

References pImpl.

Referenced by ValidColRowOrReplicated().

bool ScMatrix::ValidColRowOrReplicated ( SCSIZE rC,
SCSIZE rR 
) const

Checks if the matrix position is within the matrix.

If it is not, for a row vector or column vector the position is adapted such that it points to an element to be replicated, same column row 0 for a row vector, same row column 0 for a column vector. Else, for a 2D matrix and position not within matrix, returns false.

Definition at line 2988 of file scmatrix.cxx.

References ValidColRow(), and ValidColRowReplicated().

bool ScMatrix::ValidColRowReplicated ( SCSIZE rC,
SCSIZE rR 
) const

For a row vector or column vector, if the position does not point into the vector but is a valid column or row offset it is adapted such that it points to an element to be replicated, same column row 0 for a row vector, same row column 0 for a column vector.

Else, for a 2D matrix, returns false.

Definition at line 2983 of file scmatrix.cxx.

References pImpl.

Referenced by ValidColRowOrReplicated().

double ScMatrix::Xor ( ) const

Definition at line 3218 of file scmatrix.cxx.

References pImpl.

Friends And Related Function Documentation

friend class ScMatrixImpl
friend

Definition at line 115 of file scmatrix.hxx.

Referenced by ScMatrix().

Member Data Documentation

bool ScMatrix::mbCloneIfConst
mutableprivate

Definition at line 118 of file scmatrix.hxx.

Referenced by CloneIfConst(), SetImmutable(), and SetMutable().

size_t ScMatrix::nRefCnt
mutableprivate

Definition at line 117 of file scmatrix.hxx.

std::unique_ptr<ScMatrixImpl> ScMatrix::pImpl
private

The documentation for this class was generated from the following files: