LibreOffice Module sc (master) 1
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
sc::SolverSettings Class Reference

#include <SolverSettings.hxx>

Collaboration diagram for sc::SolverSettings:
[legend]

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< ModelConstraintGetConstraints ()
 
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

ScTablem_rTable
 
ScDocumentm_rDoc
 
ScDocShellm_pDocShell
 
ScRangeNamem_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< ModelConstraintm_aConstraints
 
std::map< SolverParameter, OUString > m_mNamedRanges
 
std::map< OUString, OUString > SolverNamesToExcelEngines
 
std::map< OUString, OUString > SolverCodesToLOEngines
 
std::map< OUString, TParamInfoSolverParamNames
 
std::vector< OUString > m_aConstraintParts { "solver_lhs", "solver_rel", "solver_rhs" }
 

Detailed Description

Definition at line 102 of file SolverSettings.hxx.

Member Typedef Documentation

◆ TParamInfo

typedef std::vector<std::variant<OUString, SolverParameter> > sc::SolverSettings::TParamInfo
private

Definition at line 176 of file SolverSettings.hxx.

Constructor & Destructor Documentation

◆ SolverSettings()

sc::SolverSettings::SolverSettings ( ScTable pTable)

Member Function Documentation

◆ DeleteAllNamedRanges()

void sc::SolverSettings::DeleteAllNamedRanges ( )
private

◆ GetConstraints()

SC_DLLPUBLIC std::vector< ModelConstraint > sc::SolverSettings::GetConstraints ( )
inline

Definition at line 200 of file SolverSettings.hxx.

References m_aConstraints.

◆ GetEngineOptions()

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.

◆ GetObjectiveType()

SC_DLLPUBLIC ObjectiveType sc::SolverSettings::GetObjectiveType ( )
inline

Definition at line 196 of file SolverSettings.hxx.

References m_eObjType.

◆ GetParameter()

OUString sc::SolverSettings::GetParameter ( SolverParameter  eParam)

◆ Initialize()

void sc::SolverSettings::Initialize ( )
private

◆ ReadConstraintPart()

bool sc::SolverSettings::ReadConstraintPart ( ConstraintPart  ePart,
tools::Long  nIndex,
OUString &  rValue 
)
private

◆ ReadConstraints()

void sc::SolverSettings::ReadConstraints ( )
private

◆ ReadEngine()

void sc::SolverSettings::ReadEngine ( )
private

◆ ReadParamValue()

bool sc::SolverSettings::ReadParamValue ( SolverParameter  eParam,
OUString &  rValue,
bool  bRemoveQuotes = false 
)
private

◆ ResetToDefaults()

void sc::SolverSettings::ResetToDefaults ( )

◆ SaveSolverSettings()

void sc::SolverSettings::SaveSolverSettings ( )

◆ SetConstraints()

void sc::SolverSettings::SetConstraints ( std::vector< ModelConstraint aConstraints)

Definition at line 302 of file SolverSettings.cxx.

References m_aConstraints.

◆ SetEngineOptions()

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().

◆ SetObjectiveType()

void sc::SolverSettings::SetObjectiveType ( ObjectiveType  eType)

Definition at line 196 of file SolverSettings.cxx.

References eType, and m_eObjType.

◆ SetParameter()

void sc::SolverSettings::SetParameter ( SolverParameter  eParam,
OUString  sValue 
)

◆ WriteConstraintPart()

void sc::SolverSettings::WriteConstraintPart ( ConstraintPart  ePart,
tools::Long  nIndex,
OUString  sValue 
)
private

Definition at line 245 of file SolverSettings.cxx.

References ScRangeName::insert(), m_aConstraintParts, m_pRangeName, m_rDoc, and nIndex.

Referenced by WriteConstraints().

◆ WriteConstraints()

void sc::SolverSettings::WriteConstraints ( )
private

◆ WriteEngine()

void sc::SolverSettings::WriteEngine ( )
private

◆ WriteParamValue()

void sc::SolverSettings::WriteParamValue ( SolverParameter  eParam,
OUString  sValue,
bool  bQuoted = false 
)
private

Member Data Documentation

◆ m_aConstraintParts

std::vector<OUString> sc::SolverSettings::m_aConstraintParts { "solver_lhs", "solver_rel", "solver_rhs" }
private

Definition at line 187 of file SolverSettings.hxx.

Referenced by ReadConstraintPart(), and WriteConstraintPart().

◆ m_aConstraints

std::vector<ModelConstraint> sc::SolverSettings::m_aConstraints
private

◆ m_aEngineOptions

css::uno::Sequence<css::beans::PropertyValue> sc::SolverSettings::m_aEngineOptions
private

Definition at line 126 of file SolverSettings.hxx.

Referenced by ResetToDefaults().

◆ m_eObjType

ObjectiveType sc::SolverSettings::m_eObjType
private

◆ m_mNamedRanges

std::map<SolverParameter, OUString> sc::SolverSettings::m_mNamedRanges
private
Initial value:
= { { SP_OBJ_CELL, "solver_opt" }, { SP_OBJ_TYPE, "solver_typ" },
{ SP_OBJ_VAL, "solver_val" }, { SP_VAR_CELLS, "solver_adj" },
{ SP_CONSTR_COUNT, "solver_num" }, { SP_LO_ENGINE, "solver_lo_eng" },
{ SP_MS_ENGINE, "solver_eng" }, { SP_INTEGER, "solver_int" },
{ SP_NON_NEGATIVE, "solver_neg" }, { SP_EPSILON_LEVEL, "solver_eps" },
{ SP_LIMIT_BBDEPTH, "solver_bbd" }, { SP_TIMEOUT, "solver_tim" },
{ SP_ALGORITHM, "solver_alg" } }
@ SP_OBJ_VAL
@ SP_MS_ENGINE
@ SP_OBJ_CELL
@ SP_CONSTR_COUNT
@ SP_TIMEOUT
@ SP_OBJ_TYPE
@ SP_LO_ENGINE
@ SP_EPSILON_LEVEL
@ SP_LIMIT_BBDEPTH
@ SP_VAR_CELLS
@ SP_ALGORITHM
@ SP_INTEGER
@ SP_NON_NEGATIVE

Definition at line 151 of file SolverSettings.hxx.

Referenced by ReadParamValue(), and WriteParamValue().

◆ m_pDocShell

ScDocShell* sc::SolverSettings::m_pDocShell
private

Definition at line 107 of file SolverSettings.hxx.

Referenced by SaveSolverSettings().

◆ m_pRangeName

ScRangeName* sc::SolverSettings::m_pRangeName
private

◆ m_rDoc

ScDocument& sc::SolverSettings::m_rDoc
private

Definition at line 106 of file SolverSettings.hxx.

Referenced by SolverSettings(), WriteConstraintPart(), and WriteParamValue().

◆ m_rTable

ScTable& sc::SolverSettings::m_rTable
private

Definition at line 105 of file SolverSettings.hxx.

Referenced by SolverSettings().

◆ m_sAlgorithm

OUString sc::SolverSettings::m_sAlgorithm
private

Definition at line 125 of file SolverSettings.hxx.

Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().

◆ m_sEpsilonLevel

OUString sc::SolverSettings::m_sEpsilonLevel
private

Definition at line 122 of file SolverSettings.hxx.

Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().

◆ m_sInteger

OUString sc::SolverSettings::m_sInteger
private

Definition at line 120 of file SolverSettings.hxx.

Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().

◆ m_sLimitBBDepth

OUString sc::SolverSettings::m_sLimitBBDepth
private

Definition at line 123 of file SolverSettings.hxx.

Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().

◆ m_sLOEngineName

OUString sc::SolverSettings::m_sLOEngineName
private

◆ m_sMSEngineId

OUString sc::SolverSettings::m_sMSEngineId
private

Definition at line 117 of file SolverSettings.hxx.

Referenced by GetParameter(), ReadEngine(), ResetToDefaults(), and WriteEngine().

◆ m_sNonNegative

OUString sc::SolverSettings::m_sNonNegative
private

Definition at line 121 of file SolverSettings.hxx.

Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().

◆ m_sObjCell

OUString sc::SolverSettings::m_sObjCell
private

◆ m_sObjVal

OUString sc::SolverSettings::m_sObjVal
private

◆ m_sTimeout

OUString sc::SolverSettings::m_sTimeout
private

Definition at line 124 of file SolverSettings.hxx.

Referenced by GetParameter(), Initialize(), SaveSolverSettings(), and SetParameter().

◆ m_sVariableCells

OUString sc::SolverSettings::m_sVariableCells
private

◆ SolverCodesToLOEngines

std::map<OUString, OUString> sc::SolverSettings::SolverCodesToLOEngines
private
Initial value:
= {
{ "1", "com.sun.star.comp.Calc.SwarmSolver" },
{ "2", "com.sun.star.comp.Calc.CoinMPSolver" },
{ "3", "com.sun.star.comp.Calc.SwarmSolver" }
}

Definition at line 168 of file SolverSettings.hxx.

◆ SolverNamesToExcelEngines

std::map<OUString, OUString> sc::SolverSettings::SolverNamesToExcelEngines
private
Initial value:
= {
{ "com.sun.star.comp.Calc.CoinMPSolver", "2" },
{ "com.sun.star.comp.Calc.LpsolveSolver", "2" },
{ "com.sun.star.comp.Calc.SwarmSolver", "1" }
}

Definition at line 161 of file SolverSettings.hxx.

Referenced by ReadEngine(), and WriteEngine().

◆ SolverParamNames

std::map<OUString, TParamInfo> sc::SolverSettings::SolverParamNames
private
Initial value:
= { { "Integer", { SP_INTEGER, "solver_int", "bool" } },
{ "NonNegative", { SP_NON_NEGATIVE, "solver_neg", "bool" } },
{ "EpsilonLevel", { SP_EPSILON_LEVEL, "solver_eps", "int" } },
{ "LimitBBDepth", { SP_LIMIT_BBDEPTH, "solver_bbd", "bool" } },
{ "Timeout", { SP_TIMEOUT, "solver_tim", "int" } },
{ "Algorithm", { SP_ALGORITHM, "solver_alg", "int" } } }

Definition at line 177 of file SolverSettings.hxx.

Referenced by GetEngineOptions(), and SetEngineOptions().


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