本文整理匯總了Python中cylp.cy.CyClpSimplex.initialDualSolve方法的典型用法代碼示例。如果您正苦於以下問題:Python CyClpSimplex.initialDualSolve方法的具體用法?Python CyClpSimplex.initialDualSolve怎麽用?Python CyClpSimplex.initialDualSolve使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cylp.cy.CyClpSimplex
的用法示例。
在下文中一共展示了CyClpSimplex.initialDualSolve方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TestCyClpSimplex
# 需要導入模塊: from cylp.cy import CyClpSimplex [as 別名]
# 或者: from cylp.cy.CyClpSimplex import initialDualSolve [as 別名]
class TestCyClpSimplex(unittest.TestCase):
def setUp(self):
self.s = CyClpSimplex()
self.s.readMps(join(currentFilePath, '../input/p0033.mps'))
def test_PE(self):
#pivot = PositiveEdgePivot(self.s)
self.s.setPivotMethod(PositiveEdgePivot(self.s))
self.s.primal()
self.assertEqual(round(self.s.objectiveValue, 4), 2520.5717)
def test_Dantzig(self):
#pivot = DantzigPivot(self.s)
self.s.setPivotMethod(DantzigPivot(self.s))
self.s.primal()
self.assertEqual(round(self.s.objectiveValue, 4), 2520.5717)
def test_LIFO(self):
#pivot = LIFOPivot(self.s)
self.s.setPivotMethod(LIFOPivot(self.s))
self.s.primal()
self.assertEqual(round(self.s.objectiveValue, 4), 2520.5717)
def test_MostFrequent(self):
#pivot = MostFrequentPivot(self.s)
self.s.setPivotMethod(MostFrequentPivot(self.s))
self.s.primal()
self.assertEqual(round(self.s.objectiveValue, 4), 2520.5717)
def test_initialSolve(self):
self.s.initialSolve()
self.assertEqual(round(self.s.objectiveValue, 4), 2520.5717)
def test_initialPrimalSolve(self):
self.s.initialPrimalSolve()
self.assertEqual(round(self.s.objectiveValue, 4), 2520.5717)
def test_initialDualSolve(self):
self.s.initialDualSolve()
self.assertEqual(round(self.s.objectiveValue, 4), 2520.5717)
def test_direction(self):
self.assertEqual(self.s.optimizationDirection, 'min')
self.s.optimizationDirection = 'max'
self.assertEqual(self.s.optimizationDirection, 'max')