LP basis routines

Problem.bf_exists()

Check if LP basis factorization exists

Return type:bool
Problem.factorize()

Compute LP basis factorization

Problem.bf_updated()

Check if LP basis factorization has been updated

Return type:bool
Problem.get_bfcp()

Retrieve LP basis factorization control parameters

Returns:basis factorization control parameter object
Return type:FactorizationControls
Problem.set_bfcp(FactorizationControls controls)

Change LP basis factorization control parameters

Problem.get_bhead(int k, names_preferred=False)

Retrieve LP basis header information

Parameters:names_preferred (bool) – whether to return the row or column name or index
Problem.get_row_bind(row)

Retrieve row index in the basis header

Parameters:row (int or str) – the index or name of the row
Returns:basis header index
Return type:int
Problem.get_col_bind(col)

Retrieve column index in the basis header

Parameters:col (int or str) – the index or name of the column
Returns:basis header index
Return type:int
Problem.ftran(tuple rhs)

Perform forward transformation (solve system B*x = b)

Problem.btran(tuple rhs)

Perform backward transformation (solve system B’x = b)

Problem.warm_up()

“Warm up” LP basis

Basis factorization controls

class ecyglpki.FactorizationControls

The basis factorization control parameter object

>>> p = Problem()
>>> r = FactorizationControls(p)
eps_tol

Tolerance below which numbers are replaced by zero, a Real number

>>> r.eps_tol  # the GLPK default
2.220446049250313e-16
>>> r.eps_tol = 0.1
>>> r.eps_tol
0.1
nfs_max

Maximal number of additional row-like factors, an int

(Used only when type contains 'Forrest-Tomlin'.)

>>> r.nfs_max  # the GLPK default
100
>>> r.nfs_max = 200
>>> r.nfs_max
200
nrs_max

Maximal number of additional row and columns, an int

(Used only when type contains 'Bartels-Golub' or 'Givens'.)

>>> r.nrs_max  # the GLPK default
70
>>> r.nrs_max = 7
>>> r.nrs_max
7
piv_lim

Number of pivot candidates that need to be considered, an int ≥1

>>> r.piv_lim  # the GLPK default
4
>>> r.piv_lim = 3
>>> r.piv_lim
3
piv_tol

Markowitz threshold pivoting tolerance, a Real number

(Value must lie between 0 and 1.)

>>> r.piv_tol  # the GLPK default
0.1
>>> r.piv_tol = 0.5
>>> r.piv_tol
0.5
suhl

Whether to use Suhl heuristic, a bool

>>> r.suhl  # the GLPK default
True
>>> r.suhl = False
>>> r.suhl
False
type

The basis factorization type, str pairs

Possible first components:

  • 'LU': plain LU factorization
  • 'BTLU': block-triangular LU factorization

Possible second components

  • 'Forrest-Tomlin': Forrest–Tomlin update applied to U (only with plain LU factorization)
  • 'Bartels-Golub': Bartels–Golub update applied to Schur complement
  • 'Givens': Givens rotation update applied to Schur complement
>>> r.type  # the GLPK default
('LU', 'Forrest-Tomlin')
>>> r.type = ('BTLU', 'Bartels-Golub')
>>> r.type
('BTLU', 'Bartels-Golub')