22#include <com/sun/star/sheet/XSolver.hpp>
23#include <com/sun/star/sheet/XSolverDescription.hpp>
24#include <com/sun/star/table/CellAddress.hpp>
25#include <com/sun/star/lang/XServiceInfo.hpp>
32#include <unordered_map>
41 size_t operator()(
const css::table::CellAddress& rAddress )
const;
44inline bool AddressEqual(
const css::table::CellAddress& rAddr1,
const css::table::CellAddress& rAddr2 )
46 return rAddr1.Sheet == rAddr2.Sheet && rAddr1.Column == rAddr2.Column && rAddr1.Row == rAddr2.Row;
51 bool operator()(
const css::table::CellAddress& rAddr1,
const css::table::CellAddress& rAddr2 )
const;
56typedef cppu::WeakImplHelper<
58 css::sheet::XSolverDescription,
59 css::lang::XServiceInfo >
69 css::uno::Reference< css::sheet::XSpreadsheetDocument >
mxDoc;
87 static css::uno::Reference<css::table::XCell>
GetCell(
88 const css::uno::Reference<css::sheet::XSpreadsheetDocument>& xDoc,
89 const css::table::CellAddress& rPos );
91 const css::uno::Reference<css::sheet::XSpreadsheetDocument>& xDoc,
92 const css::table::CellAddress& rPos,
double fValue );
94 const css::uno::Reference<css::sheet::XSpreadsheetDocument>& xDoc,
95 const css::table::CellAddress& rPos );
102 DECLARE_XTYPEPROVIDER()
109 virtual css::
uno::Reference< css::sheet::XSpreadsheetDocument > SAL_CALL
getDocument() override;
111 css::sheet::XSpreadsheetDocument >& _document ) override;
112 virtual css::table::CellAddress SAL_CALL
getObjective() override;
113 virtual
void SAL_CALL
setObjective( const css::table::CellAddress& _objective ) override;
114 virtual css::
uno::Sequence< css::table::CellAddress > SAL_CALL
getVariables() override;
116 css::table::CellAddress >& _variables ) override;
117 virtual css::
uno::Sequence< css::sheet::SolverConstraint > SAL_CALL
getConstraints() override;
119 css::sheet::SolverConstraint >& _constraints ) override;
125 virtual css::
uno::Sequence<
double > SAL_CALL
getSolution() override;
127 virtual
void SAL_CALL
solve() override = 0;
cppu::WeakImplHelper< css::sheet::XSolver, css::sheet::XSolverDescription, css::lang::XServiceInfo > SolverComponent_Base
std::unordered_map< css::table::CellAddress, std::vector< double >, ScSolverCellHash, ScSolverCellEqual > ScSolverCellHashMap
bool AddressEqual(const css::table::CellAddress &rAddr1, const css::table::CellAddress &rAddr2)
virtual css::uno::Sequence< css::sheet::SolverConstraint > SAL_CALL getConstraints() override
virtual css::uno::Sequence< css::table::CellAddress > SAL_CALL getVariables() override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual void SAL_CALL setVariables(const css::uno::Sequence< css::table::CellAddress > &_variables) override
virtual sal_Bool SAL_CALL getSuccess() override
virtual sal_Bool SAL_CALL getMaximize() override
virtual void SAL_CALL solve() override=0
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::uno::Reference< css::sheet::XSpreadsheetDocument > SAL_CALL getDocument() override
virtual double SAL_CALL getResultValue() override
css::uno::Sequence< double > maSolution
virtual ~SolverComponent() override
virtual OUString SAL_CALL getImplementationName() override=0
virtual OUString SAL_CALL getComponentDescription() override=0
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
static css::uno::Reference< css::table::XCell > GetCell(const css::uno::Reference< css::sheet::XSpreadsheetDocument > &xDoc, const css::table::CellAddress &rPos)
virtual OUString SAL_CALL getPropertyDescription(const OUString &aPropertyName) override
css::uno::Reference< css::sheet::XSpreadsheetDocument > mxDoc
css::uno::Sequence< css::sheet::SolverConstraint > maConstraints
css::table::CellAddress maObjective
static double GetValue(const css::uno::Reference< css::sheet::XSpreadsheetDocument > &xDoc, const css::table::CellAddress &rPos)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static void SetValue(const css::uno::Reference< css::sheet::XSpreadsheetDocument > &xDoc, const css::table::CellAddress &rPos, double fValue)
virtual void SAL_CALL setObjective(const css::table::CellAddress &_objective) override
static OUString GetResourceString(TranslateId aId)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual OUString SAL_CALL getStatusDescription() override
virtual css::uno::Sequence< double > SAL_CALL getSolution() override
css::uno::Sequence< css::table::CellAddress > maVariables
virtual css::table::CellAddress SAL_CALL getObjective() override
virtual void SAL_CALL setDocument(const css::uno::Reference< css::sheet::XSpreadsheetDocument > &_document) override
virtual void SAL_CALL setConstraints(const css::uno::Sequence< css::sheet::SolverConstraint > &_constraints) override
virtual void SAL_CALL setMaximize(sal_Bool _maximize) override
bool operator()(const css::table::CellAddress &rAddr1, const css::table::CellAddress &rAddr2) const
size_t operator()(const css::table::CellAddress &rAddress) const
#define DECLARE_XINTERFACE()