PySCIPOpt  4.3.0
Python Interface for the SCIP Optimization Suite
pyscipopt.lp Namespace Reference

Classes

class  LP
 

Functions

def __dealloc__ (self)
 
def __init__ (self, name="LP", sense="minimize")
 
def __repr__ (self)
 
def addCol (self, entries, obj=0.0, lb=0.0, ub=None)
 
def addCols (self, entrieslist, objs=None, lbs=None, ubs=None)
 
def addRow (self, entries, lhs=0.0, rhs=None)
 
def addRows (self, entrieslist, lhss=None, rhss=None)
 
def chgBound (self, col, lb, ub)
 
def chgCoef (self, row, col, newval)
 
def chgObj (self, col, obj)
 
def chgSide (self, row, lhs, rhs)
 
def clear (self)
 
def delCols (self, firstcol, lastcol)
 
def delRows (self, firstrow, lastrow)
 
def getBasisInds (self)
 
def getBounds (self, firstcol=0, lastcol=None)
 
def getDual (self)
 
def getDualRay (self)
 
def getNIterations (self)
 
def getPrimal (self)
 
def getPrimalRay (self)
 
def getRedcost (self)
 
def getSides (self, firstrow=0, lastrow=None)
 
def infinity (self)
 
def isDualFeasible (self)
 
def isInfinity (self, val)
 
def isPrimalFeasible (self)
 
def ncols (self)
 
def nrows (self)
 
def readLP (self, filename)
 
def solve (self, dual=True)
 
def writeLP (self, filename)
 

Variables

 name
 

Function Documentation

◆ __dealloc__()

def pyscipopt.lp.__dealloc__ (   self)

Definition at line 22 of file lp.pxi.

References SCIPlpiFree().

◆ __init__()

def pyscipopt.lp.__init__ (   self,
  name = "LP",
  sense = "minimize" 
)
Keyword arguments:
name -- the name of the problem (default 'LP')
sense -- objective sense (default minimize)

Definition at line 7 of file lp.pxi.

◆ __repr__()

def pyscipopt.lp.__repr__ (   self)

Definition at line 25 of file lp.pxi.

◆ addCol()

def pyscipopt.lp.addCol (   self,
  entries,
  obj = 0.0,
  lb = 0.0,
  ub = None 
)
Adds a single column to the LP.

Keyword arguments:
entries -- list of tuples, each tuple consists of a row index and a coefficient
obj     -- objective coefficient (default 0.0)
lb      -- lower bound (default 0.0)
ub      -- upper bound (default infinity)

Definition at line 57 of file lp.pxi.

References SCIPlpiAddCols().

◆ addCols()

def pyscipopt.lp.addCols (   self,
  entrieslist,
  objs = None,
  lbs = None,
  ubs = None 
)
Adds multiple columns to the LP.

Keyword arguments:
entrieslist -- list containing lists of tuples, each tuple contains a coefficient and a row index
objs  -- objective coefficient (default 0.0)
lbs   -- lower bounds (default 0.0)
ubs   -- upper bounds (default infinity)

Definition at line 89 of file lp.pxi.

References SCIPlpiAddCols().

◆ addRow()

def pyscipopt.lp.addRow (   self,
  entries,
  lhs = 0.0,
  rhs = None 
)
Adds a single row to the LP.

Keyword arguments:
entries -- list of tuples, each tuple contains a coefficient and a column index
lhs     -- left-hand side of the row (default 0.0)
rhs     -- right-hand side of the row (default infinity)

Definition at line 153 of file lp.pxi.

References SCIPlpiAddRows().

◆ addRows()

def pyscipopt.lp.addRows (   self,
  entrieslist,
  lhss = None,
  rhss = None 
)
Adds multiple rows to the LP.

Keyword arguments:
entrieslist -- list containing lists of tuples, each tuple contains a coefficient and a column index
lhss        -- left-hand side of the row (default 0.0)
rhss        -- right-hand side of the row (default infinity)

Definition at line 183 of file lp.pxi.

References SCIPlpiAddRows().

◆ chgBound()

def pyscipopt.lp.chgBound (   self,
  col,
  lb,
  ub 
)
Changes the lower and upper bound of a single column.

Keyword arguments:
col -- column to change
lb  -- new lower bound
ub  -- new upper bound

Definition at line 307 of file lp.pxi.

References SCIPlpiChgBounds().

◆ chgCoef()

def pyscipopt.lp.chgCoef (   self,
  row,
  col,
  newval 
)
Changes a single coefficient in the LP.

Keyword arguments:
row -- row to change
col -- column to change
newval -- new coefficient

Definition at line 297 of file lp.pxi.

References SCIPlpiChgCoef().

◆ chgObj()

def pyscipopt.lp.chgObj (   self,
  col,
  obj 
)
Changes objective coefficient of a single column.

Keyword arguments:
col -- column to change
obj -- new objective coefficient

Definition at line 286 of file lp.pxi.

References SCIPlpiChgObj().

◆ chgSide()

def pyscipopt.lp.chgSide (   self,
  row,
  lhs,
  rhs 
)
Changes the left- and right-hand side of a single row.

Keyword arguments:
row -- row to change
lhs -- new left-hand side
rhs -- new right-hand side

Definition at line 320 of file lp.pxi.

References SCIPlpiChgSides().

◆ clear()

def pyscipopt.lp.clear (   self)
Clears the whole LP.

Definition at line 333 of file lp.pxi.

References SCIPlpiClear().

◆ delCols()

def pyscipopt.lp.delCols (   self,
  firstcol,
  lastcol 
)
Deletes a range of columns from the LP.

Keyword arguments:
firstcol -- first column to delete
lastcol  -- last column to delete

Definition at line 144 of file lp.pxi.

References SCIPlpiDelCols().

◆ delRows()

def pyscipopt.lp.delRows (   self,
  firstrow,
  lastrow 
)
Deletes a range of rows from the LP.

Keyword arguments:
firstrow -- first row to delete
lastrow  -- last row to delete

Definition at line 219 of file lp.pxi.

References SCIPlpiDelRows().

◆ getBasisInds()

def pyscipopt.lp.getBasisInds (   self)
Returns the indices of the basic columns and rows; index i >= 0 corresponds to column i, index i < 0 to row -i-1

Definition at line 444 of file lp.pxi.

References SCIPlpiGetBasisInd().

◆ getBounds()

def pyscipopt.lp.getBounds (   self,
  firstcol = 0,
  lastcol = None 
)
Returns all lower and upper bounds for a range of columns.

Keyword arguments:
firstcol -- first column (default 0)
lastcol  -- last column (default ncols - 1)

Definition at line 228 of file lp.pxi.

References SCIPlpiGetBounds().

◆ getDual()

def pyscipopt.lp.getDual (   self)
Returns the dual solution of the last LP solve.

Definition at line 380 of file lp.pxi.

References SCIPlpiGetSol().

◆ getDualRay()

def pyscipopt.lp.getDualRay (   self)
Returns a dual ray if possible, None otherwise.

Definition at line 410 of file lp.pxi.

References SCIPlpiGetDualfarkas(), and SCIPlpiHasDualRay().

◆ getNIterations()

def pyscipopt.lp.getNIterations (   self)
Returns the number of LP iterations of the last LP solve.

Definition at line 424 of file lp.pxi.

References SCIPlpiGetIterations().

◆ getPrimal()

def pyscipopt.lp.getPrimal (   self)
Returns the primal solution of the last LP solve.

Definition at line 364 of file lp.pxi.

References SCIPlpiGetSol().

◆ getPrimalRay()

def pyscipopt.lp.getPrimalRay (   self)
Returns a primal ray if possible, None otherwise.

Definition at line 396 of file lp.pxi.

References SCIPlpiGetPrimalRay(), and SCIPlpiHasPrimalRay().

◆ getRedcost()

def pyscipopt.lp.getRedcost (   self)
Returns the reduced cost vector of the last LP solve.

Definition at line 430 of file lp.pxi.

References SCIPlpiGetSol().

◆ getSides()

def pyscipopt.lp.getSides (   self,
  firstrow = 0,
  lastrow = None 
)
Returns all left- and right-hand sides for a range of rows.

Keyword arguments:
firstrow -- first row (default 0)
lastrow  -- last row (default nrows - 1)

Definition at line 257 of file lp.pxi.

References SCIPlpiGetSides().

◆ infinity()

def pyscipopt.lp.infinity (   self)
Returns infinity value of the LP.

Definition at line 44 of file lp.pxi.

References SCIPlpiInfinity().

◆ isDualFeasible()

def pyscipopt.lp.isDualFeasible (   self)
Returns True iff LP is proven to be dual feasible.

Definition at line 392 of file lp.pxi.

References SCIPlpiIsDualFeasible().

◆ isInfinity()

def pyscipopt.lp.isInfinity (   self,
  val 
)
Checks if a given value is equal to the infinity value of the LP.

Keyword arguments:
val -- value that should be checked

Definition at line 49 of file lp.pxi.

References SCIPlpiIsInfinity().

◆ isPrimalFeasible()

def pyscipopt.lp.isPrimalFeasible (   self)
Returns True iff LP is proven to be primal feasible.

Definition at line 376 of file lp.pxi.

References SCIPlpiIsPrimalFeasible().

◆ ncols()

def pyscipopt.lp.ncols (   self)
Returns the number of columns.

Definition at line 343 of file lp.pxi.

References SCIPlpiGetNCols().

◆ nrows()

def pyscipopt.lp.nrows (   self)
Returns the number of rows.

Definition at line 337 of file lp.pxi.

References SCIPlpiGetNRows().

◆ readLP()

def pyscipopt.lp.readLP (   self,
  filename 
)
Reads LP from a file.

Keyword arguments:
filename -- the name of the file to be used

Definition at line 36 of file lp.pxi.

References SCIPlpiReadLP().

◆ solve()

def pyscipopt.lp.solve (   self,
  dual = True 
)
Solves the current LP.

Keyword arguments:
dual -- use the dual or primal Simplex method (default: dual)

Definition at line 349 of file lp.pxi.

References SCIPlpiGetObjval(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().

◆ writeLP()

def pyscipopt.lp.writeLP (   self,
  filename 
)
Writes LP to a file.

Keyword arguments:
filename -- the name of the file to be used

Definition at line 28 of file lp.pxi.

References SCIPlpiWriteLP().

Variable Documentation

◆ name

name

Definition at line 13 of file lp.pxi.