summaryrefslogtreecommitdiff
path: root/patches/scsolver/scsolver-source-ui-lpbuilder-cxx.diff
blob: ba4ce990891e35c365a21ec8c2f3af5e05db36d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
--- /dev/null	
+++ scsolver/source/ui/lpbuilder.cxx	
@@ -0,0 +1,628 @@
+/*************************************************************************
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Kohei Yoshida.
+ *    1039 Kingsway Dr., Apex, NC 27502, USA
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+ *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
+ *
+ ************************************************************************/
+
+
+#include "lpbuilder.hxx"
+#include "global.hxx"
+#include "type.hxx"
+#include "numeric/type.hxx"
+#include "numeric/lpmodel.hxx"
+#include "numeric/matrix.hxx"
+
+#include <algorithm>
+#include <exception>
+
+using namespace std;
+using namespace ::com::sun::star;
+using com::sun::star::table::CellAddress;
+using scsolver::numeric::Matrix;
+
+namespace scsolver {
+
+class NoMatchingElementsFound : public std::exception {};
+class LogicError : public std::exception
+{
+public:
+	virtual const char* what() const throw()
+	{
+		return "Logic Error";
+	}
+};
+
+//---------------------------------------------------------------------------
+// Local entities
+
+bool operator==( const CellAddress& lhs, const CellAddress& rhs )
+{
+	if ( lhs.Sheet != rhs.Sheet || lhs.Column != rhs.Column || lhs.Row != rhs.Row )
+		return false;
+	return true;
+}
+
+bool operator!=( const CellAddress& lhs, const CellAddress& rhs )
+{
+	return !( lhs == rhs );
+}
+
+struct DecisionVar
+{
+	CellAddress Address;
+	double Cost;
+};
+
+/** Used to hold a set of temporary cell attributes during constraint 
+	parsing. */
+struct CellAttr
+{
+	CellAddress Address;
+	rtl::OUString Formula;
+};
+
+
+//---------------------------------------------------------------------------
+// ConstraintAddress
+
+ConstraintAddress::ConstraintAddress() :
+	m_bIsRHSNumber( false ), m_fRHSValue( 0.0 )
+{
+}
+
+ConstraintAddress::ConstraintAddress( const ConstraintAddress& aOther ) :
+	Left( aOther.Left ), Right( aOther.Right ), Equal( aOther.Equal ),
+	m_bIsRHSNumber( aOther.m_bIsRHSNumber ), m_fRHSValue( aOther.m_fRHSValue )
+{
+}
+
+ConstraintAddress::~ConstraintAddress() throw()
+{
+}
+
+bool ConstraintAddress::equals( const ConstraintAddress& aOther ) const
+{
+	if ( m_bIsRHSNumber )
+	{
+		// The right-hand side cell is a number.  Don't compare the address
+		// of the right-hand side cells, but do compare their numerical
+		// values.
+		if ( aOther.Left.Sheet == Left.Sheet &&
+			 aOther.Left.Column == Left.Column &&
+			 aOther.Left.Row == Left.Row &&
+			 aOther.Equal == Equal &&
+			 aOther.m_bIsRHSNumber == m_bIsRHSNumber &&
+			 aOther.m_fRHSValue == m_fRHSValue )
+			return true;
+		return false;
+	}
+
+	if ( aOther.Left.Sheet == Left.Sheet &&
+		 aOther.Left.Column == Left.Column &&
+		 aOther.Left.Row == Left.Row &&
+		 aOther.Right.Sheet == Right.Sheet &&
+		 aOther.Right.Column == Right.Column &&
+		 aOther.Right.Row == Right.Row &&
+		 aOther.Equal == Equal )
+		return true;
+	return false;
+}
+
+bool ConstraintAddress::operator==( const ConstraintAddress& aOther ) const
+{
+	return equals( aOther );
+}
+
+table::CellAddress ConstraintAddress::getLeftCellAddr() const
+{
+	return Left;
+}
+
+void ConstraintAddress::setLeftCellAddr( const table::CellAddress& addr )
+{
+	Left = addr;
+}
+
+table::CellAddress ConstraintAddress::getRightCellAddr() const
+{
+	return Right;
+}
+
+void ConstraintAddress::setRightCellAddr( const table::CellAddress& addr )
+{
+	Right = addr;
+	m_bIsRHSNumber = false;
+}
+
+double ConstraintAddress::getRightCellValue() const
+{
+	return m_fRHSValue;
+}
+
+void ConstraintAddress::setRightCellValue( double value )
+{
+	m_fRHSValue = value;
+	m_bIsRHSNumber = true;
+}
+
+bool ConstraintAddress::isRightCellNumeric() const
+{
+	return m_bIsRHSNumber;
+}
+
+numeric::opres::Equality ConstraintAddress::getEquality() const
+{
+	return Equal;
+}
+
+void ConstraintAddress::setEquality( numeric::opres::Equality eq )
+{
+	Equal = eq;
+}
+
+
+//---------------------------------------------------------------------------
+// LpModelBuilderImpl
+
+/** The parent of this class (class LpModelBuilder) is to be instantiated by 
+	an object of class SolveModel.  It builds up necessary model parameters
+	via its member functions which are expected to be called from SolveModel.
+	It then instantiates an object of class numeric::opres::lp::Model based 
+	on those parameters when getModel() is called.
+	
+	In other words, this class acts as a liason between the model in a 
+	spreadsheet form and the model in a form of class lp::Model.
+ */
+class LpModelBuilderImpl
+{
+public:
+	LpModelBuilderImpl();
+	~LpModelBuilderImpl() throw();
+
+	numeric::opres::lp::Model getModel();
+
+	numeric::opres::Goal getGoal() const;
+	void setGoal( numeric::opres::Goal );
+
+	// Objective Formula
+	CellAddress getObjectiveFormulaAddress() const;
+	void setObjectiveFormulaAddress( const table::CellAddress& );
+
+	// Constraints	
+	sal_uInt32 getConstraintId( const ConstraintAddress& );
+	void setConstraintAddress( const ConstraintAddress& );
+	std::vector< ConstraintAddress > getAllConstraintAddresses() const { return m_cnConstraintAddress; }
+	void setConstraintMatrixSize( size_t, size_t );
+	void setConstraintCoefficient( const CellAddress&, const ConstraintAddress&, double, double );
+	void clearConstraintAddresses() { m_cnConstraintAddress.clear(); }
+	numeric::opres::Equality getConstraintEquality( sal_uInt32 ) const;
+
+	sal_uInt32 getDecisionVarId( const CellAddress& );
+	void setDecisionVarAddress( const CellAddress& );
+	vector< CellAddress > getAllDecisionVarAddresses() const;
+	void clearDecisionVarAddresses() { m_cnDecisionVars.clear(); }
+
+	double getCostVector( const CellAddress& );
+	void setCostVector( const CellAddress&, double );
+	
+	const rtl::OUString getTempCellFormula( const CellAddress& ) const;
+	void setTempCellFormula( const table::CellAddress&, const rtl::OUString& );
+
+	void stripConstConstraint();
+	void stripZeroCostDecisionVar();
+
+private:
+
+	numeric::opres::Goal m_eGoal;
+
+	// Objective Formula & Decision Variables
+	table::CellAddress m_aObjFormulaAddr;
+	std::vector< DecisionVar > m_cnDecisionVars;
+	std::vector< ConstraintAddress > m_cnConstraintAddress;
+
+	// Constraint Matrix
+	Matrix m_mxConstraint;
+	Matrix m_mxRHS;
+
+	// Temporary Cell Formula Container used for recovery of cell values 
+	// after modifying the cell.
+	std::vector< CellAttr > m_cnCellAttrs;
+};
+
+LpModelBuilderImpl::LpModelBuilderImpl() :
+		m_eGoal( numeric::opres::GOAL_UNKNOWN ), m_mxConstraint( 0, 0 ), m_mxRHS( 0, 0 )
+{
+}
+
+LpModelBuilderImpl::~LpModelBuilderImpl() throw()
+{
+}
+
+/** Construct an object of class numeric::opres::lp::Model based on the 
+	related parameters derived prior to calling this method, and 
+	return it to the caller when it's successfully created. */
+numeric::opres::lp::Model LpModelBuilderImpl::getModel()
+{
+	//stripZeroCostDecisionVar();
+	//stripConstConstraint();
+
+	numeric::opres::lp::Model aModel;
+	
+	vector< DecisionVar >::const_iterator it,
+			itBeg = m_cnDecisionVars.begin(), itEnd = m_cnDecisionVars.end();
+	for ( it = itBeg; it != itEnd; ++it )
+		aModel.setCostVectorElement( distance( itBeg, it ), (*it).Cost );
+	
+	// Constraint matrix, equality, and RHS
+	for ( sal_uInt32 i = 0; i < m_mxConstraint.rows(); ++i )
+	{
+		vector<double> aConst;
+		for ( sal_uInt32 j = 0; j < m_mxConstraint.cols(); ++j )
+			aConst.push_back( m_mxConstraint( i, j ) );
+
+		numeric::opres::Equality e = getConstraintEquality( i );
+		aModel.addConstraint( aConst, e, m_mxRHS( i, 0 ) );
+	}
+
+	aModel.setGoal( getGoal() );
+	return aModel;
+}
+
+numeric::opres::Goal LpModelBuilderImpl::getGoal() const
+{
+	return m_eGoal;
+}
+
+void LpModelBuilderImpl::setGoal( numeric::opres::Goal e )
+{
+	m_eGoal = e;
+}
+
+CellAddress LpModelBuilderImpl::getObjectiveFormulaAddress() const
+{ 
+	return m_aObjFormulaAddr;
+}
+
+void LpModelBuilderImpl::setObjectiveFormulaAddress( const table::CellAddress& aAddr )
+{
+	m_aObjFormulaAddr = aAddr; 
+}
+
+sal_uInt32 LpModelBuilderImpl::getConstraintId( const ConstraintAddress& aConstAddr )
+{
+	vector< ConstraintAddress >::iterator pos;
+	for ( pos = m_cnConstraintAddress.begin(); pos != m_cnConstraintAddress.end(); ++pos )
+		if ( pos->equals( aConstAddr ) )
+			return distance( m_cnConstraintAddress.begin(), pos );
+	
+	throw NoMatchingElementsFound();
+	return 0;
+}
+
+void LpModelBuilderImpl::setConstraintAddress( const ConstraintAddress& aItem )
+{
+	m_cnConstraintAddress.push_back( aItem );
+}
+
+void LpModelBuilderImpl::setConstraintMatrixSize( size_t nRow, size_t nCol )
+{
+	m_mxConstraint.resize( nRow, nCol );
+}
+
+void LpModelBuilderImpl::setConstraintCoefficient( 
+	const table::CellAddress& aCellAddr, const ConstraintAddress& aConstAddr, 
+	double fCoef, double fRHS )
+{
+	// First, get the column ID of this coefficient from the address of a 
+	// decision variable (aCellAddr).
+	sal_uInt32 nColId = getDecisionVarId( aCellAddr );
+	
+	// Next, get this coefficient's row ID from ConstraintAddress.
+	sal_uInt32 nRowId = getConstraintId( aConstAddr );
+	
+// 	cout << "(" << nRowId << ", " << nColId << ") = " << fCoef << "  RHS = " << fRHS << endl;
+	m_mxConstraint( nRowId, nColId ) = fCoef;
+	m_mxRHS( nRowId, 0 ) = fRHS;
+}
+
+/** Returns a value of Equality enum by constraint ID.  A constraint ID 
+	corresponds to an appropriate row ID of the constraint matrix.
+ */
+numeric::opres::Equality LpModelBuilderImpl::getConstraintEquality( sal_uInt32 i ) const
+{
+	if ( m_cnConstraintAddress.size() > i )
+		return m_cnConstraintAddress.at(i).getEquality();
+	return numeric::opres::EQUAL;
+}
+
+sal_uInt32 LpModelBuilderImpl::getDecisionVarId( const table::CellAddress& aAddr )
+{
+	vector< DecisionVar >::const_iterator it,
+			itBeg = m_cnDecisionVars.begin(), itEnd = m_cnDecisionVars.end();
+	for ( it = itBeg; it != itEnd; ++it )
+	{
+		CellAddress aAddrTmp = it->Address;
+		if ( aAddrTmp == aAddr )
+			return distance( itBeg, it );
+	}
+
+	throw NoMatchingElementsFound();
+	return 0;
+}
+
+/** Append the address of a cell whose value represents the value of a decision
+	variable.  Member variable m_cnDecisionVars contains their addresses in 
+	sequential order (x_1, x_2, x_3, ... where each x is a decision variable). */
+void LpModelBuilderImpl::setDecisionVarAddress( const table::CellAddress& aAddr )
+{
+	DecisionVar aVar;
+	aVar.Address = aAddr;
+	aVar.Cost = 0.0;
+	m_cnDecisionVars.push_back( aVar );
+}
+
+vector< CellAddress > LpModelBuilderImpl::getAllDecisionVarAddresses() const
+{
+	vector< CellAddress > cnAddrs;
+	vector< DecisionVar >::const_iterator it,
+			itBeg = m_cnDecisionVars.begin(), itEnd = m_cnDecisionVars.end();
+	for ( it = itBeg; it != itEnd; ++it )
+		cnAddrs.push_back( it->Address );
+
+	return cnAddrs;
+}
+
+/** Get a cost vector value associated with a given decision variable, whose
+	value is in the cell passed on as the argument. */
+double LpModelBuilderImpl::getCostVector( const table::CellAddress& aAddr )
+{	
+	vector< DecisionVar >::const_iterator it,
+			itBeg = m_cnDecisionVars.begin(), itEnd = m_cnDecisionVars.end();
+	for ( it = itBeg; it != itEnd; ++it )
+	{
+		DecisionVar aVar = *it;
+		if ( aVar.Address == aAddr )
+			return aVar.Cost;
+	}
+	
+	// This should NOT be reached!
+	throw NoMatchingElementsFound();
+	return 0.0;
+}
+
+void LpModelBuilderImpl::setCostVector( const table::CellAddress& aAddr, double fCost )
+{
+	vector< DecisionVar >::iterator it,
+			itBeg = m_cnDecisionVars.begin(), itEnd = m_cnDecisionVars.end();
+	for ( it = itBeg; it != itEnd; ++it )
+	{
+		if ( it->Address == aAddr )
+		{
+			it->Cost = fCost;
+			return;
+		}
+	}
+	OSL_ASSERT( !"LogicError: no matching address found" );
+}
+
+const rtl::OUString LpModelBuilderImpl::getTempCellFormula( const table::CellAddress& aAddr ) const
+{
+	vector< CellAttr >::const_iterator it,
+			itBeg = m_cnCellAttrs.begin(), itEnd = m_cnCellAttrs.end();
+
+	for ( it = itBeg; it != itEnd; ++it )
+		if( it->Address == aAddr )
+			return it->Formula;
+
+	rtl::OUString sEmpty;
+	return sEmpty;
+}
+
+void LpModelBuilderImpl::setTempCellFormula( const table::CellAddress& aAddr, const rtl::OUString& sStr )
+{
+	CellAttr aCellAttr;
+	aCellAttr.Address = aAddr;
+	aCellAttr.Formula = sStr;
+	m_cnCellAttrs.push_back( aCellAttr );
+}
+
+/** Remove constraint and right-hand-side row(s) if all elements of the 
+	constraint row is zero and the constraint is already satisfied. */
+void LpModelBuilderImpl::stripConstConstraint()
+{
+	using namespace numeric::opres;
+
+	Debug( "stripConstConstraint" );
+
+	Matrix mxConstraint( m_mxConstraint ), mxRHS( m_mxRHS );
+	OSL_ASSERT( mxConstraint.rows() == mxRHS.rows() );
+	size_t nRowSize = mxConstraint.rows();
+
+	vector<size_t> cnRowsToRemove;
+
+	// Scan the constraint matrix to find empty rows.
+	for ( size_t i = 0; i < nRowSize; ++i )
+		if ( mxConstraint.isRowEmpty( i ) )
+		{
+			double fRHS = mxRHS( i, 0 );
+            Equality eEq = getConstraintEquality( i );
+			if ( ( fRHS <= 0 && eEq == GREATER_THAN_EQUAL ) ||
+				 ( fRHS >= 0 && eEq == LESS_THAN_EQUAL ) ||
+				 ( fRHS == 0.0 && eEq == EQUAL ) )
+				cnRowsToRemove.push_back( i );
+		}
+
+	cout << "rows to remove: ";
+	printElements( cnRowsToRemove );
+
+	mxConstraint.deleteRows( cnRowsToRemove );
+	mxRHS.deleteRows( cnRowsToRemove );
+
+	m_mxConstraint.swap( mxConstraint );
+	m_mxRHS.swap( mxRHS );
+}
+
+/** Remove decision variables and their corresponding constraint columns if 
+	and only if they all have a zero cost coefficient and all elements in 
+	their constraint column. */
+void LpModelBuilderImpl::stripZeroCostDecisionVar()
+{
+	Debug( "stripZeroCostDecisionVar" );
+
+	vector< DecisionVar > cnNewVars;
+	Matrix mxConstraint( m_mxConstraint );
+	cnNewVars.reserve( m_cnDecisionVars.size() );
+	vector< size_t > cnColsToRemove;
+
+	vector< DecisionVar >::iterator it,
+			itBeg = m_cnDecisionVars.begin(), itEnd = m_cnDecisionVars.end();
+	cout << m_cnDecisionVars.size() << endl;
+	size_t nLastRow = mxConstraint.rows();
+	for ( it = itBeg; it != itEnd; ++it )
+	{
+		if ( it->Cost )
+			cnNewVars.push_back( *it );
+		else
+		{
+			size_t nCol = distance( itBeg, it );
+			if ( mxConstraint.isColumnEmpty( nCol ) )
+				cnColsToRemove.push_back( nCol );
+			else
+				cnNewVars.push_back( *it );
+		}
+	}
+
+	printElements( cnColsToRemove );
+	cout << "mxConstraint:" << endl;
+	mxConstraint.print( 0 );
+	
+	cout << "(" << nLastRow << ", " << mxConstraint.cols() << ")" << endl;
+	
+	mxConstraint.deleteColumns( cnColsToRemove );
+	mxConstraint.print( 0 );
+	swap( cnNewVars, m_cnDecisionVars );
+	m_mxConstraint.swap( mxConstraint );
+}
+
+//---------------------------------------------------------------------------
+// LpModelBuilder
+
+LpModelBuilder::LpModelBuilder() : m_pImpl( new LpModelBuilderImpl() )
+{
+}
+
+LpModelBuilder::~LpModelBuilder()
+{
+}
+
+numeric::opres::lp::Model LpModelBuilder::getModel()
+{
+	return m_pImpl->getModel();
+}
+
+numeric::opres::Goal LpModelBuilder::getGoal() const
+{
+	return m_pImpl->getGoal();
+}
+
+void LpModelBuilder::setGoal( numeric::opres::Goal e )
+{
+	m_pImpl->setGoal( e );
+}
+
+const CellAddress LpModelBuilder::getObjectiveFormulaAddress() const
+{
+	return m_pImpl->getObjectiveFormulaAddress();
+}
+
+void LpModelBuilder::setObjectiveFormulaAddress( const table::CellAddress& aAddr )
+{
+	m_pImpl->setObjectiveFormulaAddress( aAddr );
+}
+	
+double LpModelBuilder::getCostVector( const table::CellAddress& aAddr )
+{
+	return m_pImpl->getCostVector( aAddr );
+}
+
+void LpModelBuilder::setCostVector( const table::CellAddress& aAddr, double fCost )
+{
+	m_pImpl->setCostVector( aAddr, fCost );
+}
+
+void LpModelBuilder::clearConstraintAddresses()
+{
+	m_pImpl->clearConstraintAddresses();
+}
+
+void LpModelBuilder::setConstraintAddress( const ConstraintAddress& aItem )
+{
+	m_pImpl->setConstraintAddress( aItem );
+}
+
+vector< ConstraintAddress > LpModelBuilder::getAllConstraintAddresses() const
+{
+	return m_pImpl->getAllConstraintAddresses();
+}
+
+void LpModelBuilder::setConstraintMatrixSize( size_t nRow, size_t nCol )
+{
+	m_pImpl->setConstraintMatrixSize( nRow, nCol );
+}
+
+void LpModelBuilder::setConstraintCoefficient( 
+	const CellAddress& aCellAddr, const ConstraintAddress& aConstAddr, 
+	double fCoef, double fRHS )
+{
+	m_pImpl->setConstraintCoefficient( aCellAddr, aConstAddr, fCoef, fRHS );
+}
+
+void LpModelBuilder::setDecisionVarAddress( const table::CellAddress& aAddr )
+{
+	m_pImpl->setDecisionVarAddress( aAddr );
+}
+
+vector< CellAddress > LpModelBuilder::getAllDecisionVarAddresses() const
+{
+	return m_pImpl->getAllDecisionVarAddresses();
+}
+
+void LpModelBuilder::clearDecisionVarAddresses()
+{
+	return m_pImpl->clearDecisionVarAddresses();
+}
+
+const rtl::OUString LpModelBuilder::getTempCellFormula( const table::CellAddress& aAddr ) const
+{
+	return m_pImpl->getTempCellFormula( aAddr );
+}
+
+void LpModelBuilder::setTempCellFormula( const table::CellAddress& aAddr, const rtl::OUString& sStr )
+{
+	m_pImpl->setTempCellFormula( aAddr, sStr );
+}
+
+
+}
+