LPWrapper

class pyopenms.LPWrapper

Bases: object

Cython implementation of _LPWrapper

Documentation is available at http://www.openms.de/current_doxygen/html/classOpenMS_1_1LPWrapper.html

__init__()

Cython signature: void LPWrapper()

Methods

__init__

Cython signature: void LPWrapper()

addColumn

  • Cython signature: int addColumn()

addRow

  • Cython signature: int addRow(libcpp_vector[int] row_indices, libcpp_vector[double] row_values, const String & name)

deleteRow

Cython signature: void deleteRow(int index) Delete index-th row

getColumnIndex

Cython signature: int getColumnIndex(const String & name) Returns index of the column with name

getColumnLowerBound

Cython signature: double getColumnLowerBound(int index) Returns column's lower bound

getColumnName

Cython signature: String getColumnName(int index) Returns name of the index-th column

getColumnType

Cython signature: VariableType getColumnType(int index) Returns column/variable type.

getColumnUpperBound

Cython signature: double getColumnUpperBound(int index) Returns column's upper bound

getColumnValue

Cython signature: double getColumnValue(int index)

getElement

Cython signature: double getElement(int row_index, int column_index) Returns the element

getMatrixRow

Cython signature: void getMatrixRow(int idx, libcpp_vector[int] & indexes)

getNumberOfColumns

Cython signature: int getNumberOfColumns() Returns number of columns

getNumberOfNonZeroEntriesInRow

Cython signature: int getNumberOfNonZeroEntriesInRow(int idx)

getNumberOfRows

Cython signature: int getNumberOfRows() Returns number of rows

getObjective

Cython signature: double getObjective(int index) Returns objective value for column with index

getObjectiveSense

Cython signature: Sense getObjectiveSense() Returns objective sense

getObjectiveValue

Cython signature: double getObjectiveValue()

getRowIndex

Cython signature: int getRowIndex(const String & name) Returns index of the row with name

getRowLowerBound

Cython signature: double getRowLowerBound(int index) Returns row's lower bound

getRowName

Cython signature: String getRowName(int index) Sets name of the index-th row

getRowUpperBound

Cython signature: double getRowUpperBound(int index) Returns row's upper bound

getSolver

Cython signature: SOLVER getSolver() Returns currently active solver

getStatus

Cython signature: SolverStatus getStatus()

readProblem

Cython signature: void readProblem(String filename, String format_)

setColumnBounds

Cython signature: void setColumnBounds(int index, double lower_bound, double upper_bound, LPWrapper_Type type_) Sets column bounds

setColumnName

Cython signature: void setColumnName(int index, const String & name) Sets name of the index-th column

setColumnType

Cython signature: void setColumnType(int index, VariableType type_) Sets column/variable type.

setElement

Cython signature: void setElement(int row_index, int column_index, double value) Sets the element

setObjective

Cython signature: void setObjective(int index, double obj_value) Sets objective value for column with index

setObjectiveSense

Cython signature: void setObjectiveSense(Sense sense) Sets objective direction

setRowBounds

Cython signature: void setRowBounds(int index, double lower_bound, double upper_bound, LPWrapper_Type type_) Sets row bounds

setRowName

Cython signature: void setRowName(int index, const String & name) Sets name of the index-th row

solve

Cython signature: int solve(SolverParam & solver_param, size_t verbose_level)

writeProblem

Cython signature: void writeProblem(const String & filename, WriteFormat format_)

LPWrapper_Type

alias of pyopenms.pyopenms_6.__LPWrapper_Type

SOLVER

alias of pyopenms.pyopenms_6.__SOLVER

Sense

alias of pyopenms.pyopenms_6.__Sense

SolverStatus

alias of pyopenms.pyopenms_6.__SolverStatus

VariableType

alias of pyopenms.pyopenms_6.__VariableType

WriteFormat

alias of pyopenms.pyopenms_6.__WriteFormat

addColumn()
  • Cython signature: int addColumn() Adds an empty column to the LP matrix, returns index

  • Cython signature: int addColumn(libcpp_vector[int] column_indices, libcpp_vector[double] column_values, const String & name) Adds a column to the LP matrix, returns index

  • Cython signature: int addColumn(libcpp_vector[int] & column_indices, libcpp_vector[double] & column_values, const String & name, double lower_bound, double upper_bound, LPWrapper_Type type_) Adds a column with boundaries to the LP matrix, returns index

addRow()
  • Cython signature: int addRow(libcpp_vector[int] row_indices, libcpp_vector[double] row_values, const String & name) Adds a row to the LP matrix, returns index

  • Cython signature: int addRow(libcpp_vector[int] & row_indices, libcpp_vector[double] & row_values, const String & name, double lower_bound, double upper_bound, LPWrapper_Type type_) Adds a row with boundaries to the LP matrix, returns index

deleteRow()

Cython signature: void deleteRow(int index) Delete index-th row

getColumnIndex()

Cython signature: int getColumnIndex(const String & name) Returns index of the column with name

getColumnLowerBound()

Cython signature: double getColumnLowerBound(int index) Returns column’s lower bound

getColumnName()

Cython signature: String getColumnName(int index) Returns name of the index-th column

getColumnType()

Cython signature: VariableType getColumnType(int index) Returns column/variable type.

getColumnUpperBound()

Cython signature: double getColumnUpperBound(int index) Returns column’s upper bound

getColumnValue()

Cython signature: double getColumnValue(int index)

getElement()

Cython signature: double getElement(int row_index, int column_index) Returns the element

getMatrixRow()

Cython signature: void getMatrixRow(int idx, libcpp_vector[int] & indexes)

getNumberOfColumns()

Cython signature: int getNumberOfColumns() Returns number of columns

getNumberOfNonZeroEntriesInRow()

Cython signature: int getNumberOfNonZeroEntriesInRow(int idx)

getNumberOfRows()

Cython signature: int getNumberOfRows() Returns number of rows

getObjective()

Cython signature: double getObjective(int index) Returns objective value for column with index

getObjectiveSense()

Cython signature: Sense getObjectiveSense() Returns objective sense

getObjectiveValue()

Cython signature: double getObjectiveValue()

getRowIndex()

Cython signature: int getRowIndex(const String & name) Returns index of the row with name

getRowLowerBound()

Cython signature: double getRowLowerBound(int index) Returns row’s lower bound

getRowName()

Cython signature: String getRowName(int index) Sets name of the index-th row

getRowUpperBound()

Cython signature: double getRowUpperBound(int index) Returns row’s upper bound

getSolver()

Cython signature: SOLVER getSolver() Returns currently active solver

getStatus()

Cython signature: SolverStatus getStatus()

Returns

status: 1 - undefined, 2 - integer optimal, 3- integer feasible (no optimality proven), 4- no integer feasible solution

readProblem()

Cython signature: void readProblem(String filename, String format_)

Parameters
  • filename – Filename where to store the LP problem

  • format – LP, MPS or GLPK

setColumnBounds()

Cython signature: void setColumnBounds(int index, double lower_bound, double upper_bound, LPWrapper_Type type_) Sets column bounds

setColumnName()

Cython signature: void setColumnName(int index, const String & name) Sets name of the index-th column

setColumnType()

Cython signature: void setColumnType(int index, VariableType type_) Sets column/variable type.

setElement()

Cython signature: void setElement(int row_index, int column_index, double value) Sets the element

setObjective()

Cython signature: void setObjective(int index, double obj_value) Sets objective value for column with index

setObjectiveSense()

Cython signature: void setObjectiveSense(Sense sense) Sets objective direction

setRowBounds()

Cython signature: void setRowBounds(int index, double lower_bound, double upper_bound, LPWrapper_Type type_) Sets row bounds

setRowName()

Cython signature: void setRowName(int index, const String & name) Sets name of the index-th row

solve()

Cython signature: int solve(SolverParam & solver_param, size_t verbose_level)

Parameters
  • solver_param – Parameters of the solver introduced by SolverParam

  • verbose_level – Sets verbose level

Returns

solver dependent

writeProblem()

Cython signature: void writeProblem(const String & filename, WriteFormat format_)

Parameters
  • filename – Output filename, if the filename ends with ‘.gz’ it will be compressed

  • format – MPS-format is supported by GLPK and COIN-OR; LP and GLPK-formats only by GLPK