LibreOffice Module sc (master) 1
|
#include <SolverSettings.hxx>
Public Member Functions | |
SolverSettings (ScTable &pTable) | |
SC_DLLPUBLIC OUString | GetParameter (SolverParameter eParam) |
SC_DLLPUBLIC void | SetParameter (SolverParameter eParam, OUString sValue) |
SC_DLLPUBLIC ObjectiveType | GetObjectiveType () |
SC_DLLPUBLIC void | SetObjectiveType (ObjectiveType eType) |
SC_DLLPUBLIC void | GetEngineOptions (css::uno::Sequence< css::beans::PropertyValue > &aOptions) |
SC_DLLPUBLIC void | SetEngineOptions (css::uno::Sequence< css::beans::PropertyValue > &aOptions) |
SC_DLLPUBLIC std::vector< ModelConstraint > | GetConstraints () |
SC_DLLPUBLIC void | SetConstraints (std::vector< ModelConstraint > aConstraints) |
SC_DLLPUBLIC void | SaveSolverSettings () |
SC_DLLPUBLIC void | ResetToDefaults () |
Private Types | |
typedef std::vector< std::variant< OUString, SolverParameter > > | TParamInfo |
Private Member Functions | |
void | Initialize () |
bool | ReadParamValue (SolverParameter eParam, OUString &rValue, bool bRemoveQuotes=false) |
void | WriteParamValue (SolverParameter eParam, OUString sValue, bool bQuoted=false) |
void | ReadConstraints () |
void | WriteConstraints () |
bool | ReadConstraintPart (ConstraintPart ePart, tools::Long nIndex, OUString &rValue) |
void | WriteConstraintPart (ConstraintPart ePart, tools::Long nIndex, OUString sValue) |
void | ReadEngine () |
void | WriteEngine () |
void | DeleteAllNamedRanges () |
Private Attributes | |
ScTable & | m_rTable |
ScDocument & | m_rDoc |
ScDocShell * | m_pDocShell |
ScRangeName * | m_pRangeName |
OUString | m_sObjCell |
ObjectiveType | m_eObjType |
OUString | m_sObjVal |
OUString | m_sVariableCells |
OUString | m_sLOEngineName |
OUString | m_sMSEngineId |
OUString | m_sInteger |
OUString | m_sNonNegative |
OUString | m_sEpsilonLevel |
OUString | m_sLimitBBDepth |
OUString | m_sTimeout |
OUString | m_sAlgorithm |
css::uno::Sequence< css::beans::PropertyValue > | m_aEngineOptions |
std::vector< ModelConstraint > | m_aConstraints |
std::map< SolverParameter, OUString > | m_mNamedRanges |
std::map< OUString, OUString > | SolverNamesToExcelEngines |
std::map< OUString, OUString > | SolverCodesToLOEngines |
std::map< OUString, TParamInfo > | SolverParamNames |
std::vector< OUString > | m_aConstraintParts { "solver_lhs", "solver_rel", "solver_rhs" } |
Definition at line 102 of file SolverSettings.hxx.
|
private |
Definition at line 176 of file SolverSettings.hxx.
sc::SolverSettings::SolverSettings | ( | ScTable & | pTable | ) |
Definition at line 20 of file SolverSettings.cxx.
References ScTable::GetName(), ScDocument::GetRangeNameMap(), Initialize(), m_pRangeName, m_rDoc, m_rDoc, m_rTable, and m_rTable.
|
private |
Definition at line 460 of file SolverSettings.cxx.
References ScRangeName::erase(), ScRangeName::findByIndex(), i, m_pRangeName, pData, and ScRangeName::size().
Referenced by SaveSolverSettings().
|
inline |
Definition at line 200 of file SolverSettings.hxx.
References m_aConstraints.
void sc::SolverSettings::GetEngineOptions | ( | css::uno::Sequence< css::beans::PropertyValue > & | aOptions | ) |
Definition at line 374 of file SolverSettings.cxx.
References GetParameter(), i, nValue, and SolverParamNames.
|
inline |
Definition at line 196 of file SolverSettings.hxx.
References m_eObjType.
OUString sc::SolverSettings::GetParameter | ( | SolverParameter | eParam | ) |
Definition at line 79 of file SolverSettings.cxx.
References m_aConstraints, m_eObjType, m_sAlgorithm, m_sEpsilonLevel, m_sInteger, m_sLimitBBDepth, m_sLOEngineName, m_sMSEngineId, m_sNonNegative, m_sObjCell, m_sObjVal, m_sTimeout, m_sVariableCells, sc::SP_ALGORITHM, sc::SP_CONSTR_COUNT, sc::SP_EPSILON_LEVEL, sc::SP_INTEGER, sc::SP_LIMIT_BBDEPTH, sc::SP_LO_ENGINE, sc::SP_MS_ENGINE, sc::SP_NON_NEGATIVE, sc::SP_OBJ_CELL, sc::SP_OBJ_TYPE, sc::SP_OBJ_VAL, sc::SP_TIMEOUT, and sc::SP_VAR_CELLS.
Referenced by GetEngineOptions().
|
private |
Definition at line 33 of file SolverSettings.cxx.
References m_eObjType, m_sAlgorithm, m_sEpsilonLevel, m_sInteger, m_sLimitBBDepth, m_sNonNegative, m_sObjCell, m_sObjVal, m_sTimeout, m_sVariableCells, sc::OT_MAXIMIZE, sc::OT_MINIMIZE, sc::OT_VALUE, ReadConstraints(), ReadEngine(), ReadParamValue(), ResetToDefaults(), sc::SP_ALGORITHM, sc::SP_EPSILON_LEVEL, sc::SP_INTEGER, sc::SP_LIMIT_BBDEPTH, sc::SP_NON_NEGATIVE, sc::SP_OBJ_CELL, sc::SP_OBJ_TYPE, sc::SP_OBJ_VAL, sc::SP_TIMEOUT, and sc::SP_VAR_CELLS.
Referenced by SolverSettings().
|
private |
Definition at line 258 of file SolverSettings.cxx.
References ScRangeName::findByUpperName(), ScGlobal::getCharClass(), ScRangeData::GetSymbol(), m_aConstraintParts, m_pRangeName, and nIndex.
Referenced by ReadConstraints().
|
private |
Definition at line 199 of file SolverSettings.cxx.
References sc::ModelConstraint::aLeftStr, sc::ModelConstraint::aRightStr, sc::CP_LEFT_HAND_SIDE, sc::CP_OPERATOR, sc::CP_RIGHT_HAND_SIDE, m_aConstraints, sc::ModelConstraint::nOperator, and ReadConstraintPart().
Referenced by Initialize().
|
private |
Definition at line 274 of file SolverSettings.cxx.
References m_sLOEngineName, m_sMSEngineId, ReadParamValue(), SolverNamesToExcelEngines, and sc::SP_LO_ENGINE.
Referenced by Initialize().
|
private |
Definition at line 340 of file SolverSettings.cxx.
References ScGlobal::EraseQuotes(), ScRangeName::findByUpperName(), ScGlobal::getCharClass(), ScRangeData::GetSymbol(), m_mNamedRanges, and m_pRangeName.
Referenced by Initialize(), and ReadEngine().
void sc::SolverSettings::ResetToDefaults | ( | ) |
Definition at line 480 of file SolverSettings.cxx.
References ScSolverUtil::GetDefaults(), ScSolverUtil::GetImplementations(), m_aConstraints, m_aEngineOptions, m_eObjType, m_sLOEngineName, m_sMSEngineId, m_sObjCell, m_sObjVal, m_sVariableCells, sc::OT_MAXIMIZE, and SetEngineOptions().
Referenced by Initialize().
void sc::SolverSettings::SaveSolverSettings | ( | ) |
Definition at line 308 of file SolverSettings.cxx.
References DeleteAllNamedRanges(), m_aConstraints, m_eObjType, m_pDocShell, m_sAlgorithm, m_sEpsilonLevel, m_sInteger, m_sLimitBBDepth, m_sNonNegative, m_sObjCell, m_sObjVal, m_sTimeout, m_sVariableCells, ScDocShell::SetDocumentModified(), sc::SP_ALGORITHM, sc::SP_CONSTR_COUNT, sc::SP_EPSILON_LEVEL, sc::SP_INTEGER, sc::SP_LIMIT_BBDEPTH, sc::SP_NON_NEGATIVE, sc::SP_OBJ_CELL, sc::SP_OBJ_TYPE, sc::SP_OBJ_VAL, sc::SP_TIMEOUT, sc::SP_VAR_CELLS, WriteConstraints(), WriteEngine(), and WriteParamValue().
void sc::SolverSettings::SetConstraints | ( | std::vector< ModelConstraint > | aConstraints | ) |
Definition at line 302 of file SolverSettings.cxx.
References m_aConstraints.
void sc::SolverSettings::SetEngineOptions | ( | css::uno::Sequence< css::beans::PropertyValue > & | aOptions | ) |
Definition at line 416 of file SolverSettings.cxx.
References i, nValue, SetParameter(), and SolverParamNames.
Referenced by ResetToDefaults().
void sc::SolverSettings::SetObjectiveType | ( | ObjectiveType | eType | ) |
Definition at line 196 of file SolverSettings.cxx.
References eType, and m_eObjType.
void sc::SolverSettings::SetParameter | ( | SolverParameter | eParam, |
OUString | sValue | ||
) |
Definition at line 128 of file SolverSettings.cxx.
References m_eObjType, m_sAlgorithm, m_sEpsilonLevel, m_sInteger, m_sLimitBBDepth, m_sLOEngineName, m_sNonNegative, m_sObjCell, m_sObjVal, m_sTimeout, m_sVariableCells, sc::OT_MAXIMIZE, sc::OT_MINIMIZE, sc::OT_VALUE, sc::SP_ALGORITHM, sc::SP_EPSILON_LEVEL, sc::SP_INTEGER, sc::SP_LIMIT_BBDEPTH, sc::SP_LO_ENGINE, sc::SP_NON_NEGATIVE, sc::SP_OBJ_CELL, sc::SP_OBJ_TYPE, sc::SP_OBJ_VAL, sc::SP_TIMEOUT, and sc::SP_VAR_CELLS.
Referenced by SetEngineOptions().
|
private |
Definition at line 245 of file SolverSettings.cxx.
References ScRangeName::insert(), m_aConstraintParts, m_pRangeName, m_rDoc, and nIndex.
Referenced by WriteConstraints().
|
private |
Definition at line 227 of file SolverSettings.cxx.
References sc::CP_LEFT_HAND_SIDE, sc::CP_OPERATOR, sc::CP_RIGHT_HAND_SIDE, m_aConstraints, and WriteConstraintPart().
Referenced by SaveSolverSettings().
|
private |
Definition at line 290 of file SolverSettings.cxx.
References m_sLOEngineName, m_sMSEngineId, SolverNamesToExcelEngines, sc::SP_LO_ENGINE, sc::SP_MS_ENGINE, and WriteParamValue().
Referenced by SaveSolverSettings().
|
private |
Definition at line 359 of file SolverSettings.cxx.
References ScGlobal::AddQuotes(), ScRangeName::insert(), m_mNamedRanges, m_pRangeName, and m_rDoc.
Referenced by SaveSolverSettings(), and WriteEngine().
|
private |
Definition at line 187 of file SolverSettings.hxx.
Referenced by ReadConstraintPart(), and WriteConstraintPart().
|
private |
Definition at line 128 of file SolverSettings.hxx.
Referenced by GetConstraints(), GetParameter(), ReadConstraints(), ResetToDefaults(), SaveSolverSettings(), SetConstraints(), and WriteConstraints().
|
private |
Definition at line 126 of file SolverSettings.hxx.
Referenced by ResetToDefaults().
|
private |
Definition at line 113 of file SolverSettings.hxx.
Referenced by GetObjectiveType(), GetParameter(), Initialize(), ResetToDefaults(), SaveSolverSettings(), SetObjectiveType(), and SetParameter().
|
private |
Definition at line 151 of file SolverSettings.hxx.
Referenced by ReadParamValue(), and WriteParamValue().
|
private |
Definition at line 107 of file SolverSettings.hxx.
Referenced by SaveSolverSettings().
|
private |
Definition at line 110 of file SolverSettings.hxx.
Referenced by DeleteAllNamedRanges(), ReadConstraintPart(), ReadParamValue(), SolverSettings(), WriteConstraintPart(), and WriteParamValue().
|
private |
Definition at line 106 of file SolverSettings.hxx.
Referenced by SolverSettings(), WriteConstraintPart(), and WriteParamValue().
|
private |
Definition at line 105 of file SolverSettings.hxx.
Referenced by SolverSettings().
|
private |
Definition at line 125 of file SolverSettings.hxx.
Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().
|
private |
Definition at line 122 of file SolverSettings.hxx.
Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().
|
private |
Definition at line 120 of file SolverSettings.hxx.
Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().
|
private |
Definition at line 123 of file SolverSettings.hxx.
Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().
|
private |
Definition at line 116 of file SolverSettings.hxx.
Referenced by GetParameter(), ReadEngine(), ResetToDefaults(), SetParameter(), and WriteEngine().
|
private |
Definition at line 117 of file SolverSettings.hxx.
Referenced by GetParameter(), ReadEngine(), ResetToDefaults(), and WriteEngine().
|
private |
Definition at line 121 of file SolverSettings.hxx.
Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().
|
private |
Definition at line 112 of file SolverSettings.hxx.
Referenced by GetParameter(), Initialize(), ResetToDefaults(), SaveSolverSettings(), and SetParameter().
|
private |
Definition at line 114 of file SolverSettings.hxx.
Referenced by GetParameter(), Initialize(), ResetToDefaults(), SaveSolverSettings(), and SetParameter().
|
private |
Definition at line 124 of file SolverSettings.hxx.
Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().
|
private |
Definition at line 115 of file SolverSettings.hxx.
Referenced by GetParameter(), Initialize(), ResetToDefaults(), SaveSolverSettings(), and SetParameter().
|
private |
Definition at line 168 of file SolverSettings.hxx.
|
private |
Definition at line 161 of file SolverSettings.hxx.
Referenced by ReadEngine(), and WriteEngine().
|
private |
Definition at line 177 of file SolverSettings.hxx.
Referenced by GetEngineOptions(), and SetEngineOptions().