org.gnu.glpk
Class GlpkSolver

java.lang.Object
  extended by org.gnu.glpk.GlpkSolver

public class GlpkSolver
extends java.lang.Object

This is the core class of the Java Native Interface for GLPK 4.8.
Use GLPK in the following way:

      GlpkSolver solver = new GlpkSolver();
      ... fill LP model
      solver.simplex();   // LP solver
      solver.integer();   // ILP solver
      ... obtain results
 
For a detailed manual and the C version of GLPK, take a look at the GLPK Homepage


Field Summary
static int LPX_B_UNDEF
           
static int LPX_B_VALID
           
static int LPX_BS
           
static int LPX_CV
           
static int LPX_D_FEAS
           
static int LPX_D_INFEAS
           
static int LPX_D_NOFEAS
           
static int LPX_D_UNDEF
           
static int LPX_DB
           
static int LPX_E_BADB
           
static int LPX_E_EMPTY
           
static int LPX_E_FAULT
           
static int LPX_E_INFEAS
           
static int LPX_E_INSTAB
           
static int LPX_E_ITLIM
           
static int LPX_E_NOCONV
           
static int LPX_E_NODFS
           
static int LPX_E_NOFEAS
           
static int LPX_E_NOPFS
           
static int LPX_E_OBJLL
           
static int LPX_E_OBJUL
           
static int LPX_E_OK
           
static int LPX_E_SING
           
static int LPX_E_TMLIM
           
static int LPX_FEAS
           
static int LPX_FR
           
static int LPX_FX
           
static int LPX_I_FEAS
           
static int LPX_I_NOFEAS
           
static int LPX_I_OPT
           
static int LPX_I_UNDEF
           
static int LPX_INFEAS
           
static int LPX_IV
           
static int LPX_K_BRANCH
           
static int LPX_K_BTRACK
           
static int LPX_K_DUAL
           
static int LPX_K_ITCNT
           
static int LPX_K_ITLIM
           
static int LPX_K_LPTORIG
           
static int LPX_K_MPSFREE
           
static int LPX_K_MPSINFO
           
static int LPX_K_MPSOBJ
           
static int LPX_K_MPSORIG
           
static int LPX_K_MPSSKIP
           
static int LPX_K_MPSWIDE
           
static int LPX_K_MSGLEV
           
static int LPX_K_OBJLL
           
static int LPX_K_OBJUL
           
static int LPX_K_OUTDLY
           
static int LPX_K_OUTFRQ
           
static int LPX_K_PRESOL
           
static int LPX_K_PRICE
           
static int LPX_K_RELAX
           
static int LPX_K_ROUND
           
static int LPX_K_SCALE
           
static int LPX_K_TMLIM
           
static int LPX_K_TOLBND
           
static int LPX_K_TOLDJ
           
static int LPX_K_TOLINT
           
static int LPX_K_TOLOBJ
           
static int LPX_K_TOLPIV
           
static int LPX_LO
           
static int LPX_LP
           
static int LPX_MAX
           
static int LPX_MIN
           
static int LPX_MIP
           
static int LPX_NF
           
static int LPX_NL
           
static int LPX_NOFEAS
           
static int LPX_NS
           
static int LPX_NU
           
static int LPX_OPT
           
static int LPX_P_FEAS
           
static int LPX_P_INFEAS
           
static int LPX_P_NOFEAS
           
static int LPX_P_UNDEF
           
static int LPX_T_OPT
           
static int LPX_T_UNDEF
           
static int LPX_UNBND
           
static int LPX_UNDEF
           
static int LPX_UP
           
 
Constructor Summary
GlpkSolver()
           
 
Method Summary
 void addCols(int ncs)
          Add new ncs columns (structural variables) to problem object
 void addRows(int nrs)
          Add nrs new rows (constraints) to problem object
 void advBasis()
          Construct advanced initial LP basis
 void checkKkt(int scaled, GlpkSolverKktConditions kkt)
          Check Karush-Kuhn-Tucker conditions
 void delCols(int ncs, int[] num)
          Delete ncs columns from problem object
 void delRows(int nrs, int[] num)
          Delete nrs rows from problem object
 int dualRatioTest(int len, int[] ind, double[] val, int how, double tol)
          Perform dual ratio test
 void enablePrints(boolean enable)
           
 int evalTabCol(int k, int[] ind, double[] val)
          Compute column of the simplex table
 int evalTabRow(int k, int[] ind, double[] val)
          Compute row of the simplex table
protected  void finalize()
           
 int getClss()
          Retrieve problem class
 double getColDual(int j)
          Retrieve dual value (reduced cost) of the structural variable (column) j
 int getColKind(int j)
          Retrieve kind of column j
 double getColLb(int j)
          Retrieve lower bound of column j
 java.lang.String getColName(int j)
          Retrieve name of column j
 double getColPrim(int j)
          Retrieve primal value of the structural variable (column) j
 int getColStat(int j)
          Retrieve status of column j
 int getColType(int j)
          Retrieve type of column j
 double getColUb(int j)
          Retrieve upper bound of column j
 int getDualStat()
          Retrieve dual status of the basic solution
 int getIntParm(int parm)
          Query integer control parameter
 int getMatCol(int j, int[] ind, double[] val)
          Retrieve column j of the constraint matrix.
 int getMatRow(int i, int[] ind, double[] val)
          Retrieve row i of the constraint matrix.
 int getNumBin()
          Retrieve number of binary columns
 int getNumCols()
          Retrieve number of columns
 int getNumInt()
          Retrieve number of integer columns
 int getNumNz()
          Retrieve number of constraint coefficients (non-zero elements in constraint matrix)
 int getNumRows()
          Retrieve number of rows
 double getObjCoef(int j)
          Retrieve objective function coefficient or constant term
 int getObjDir()
          Retrieve optimization direction flag
 java.lang.String getObjName()
          Retrieve objective function name
 double getObjVal()
          Retrieve current value of the objective function
 int getPrimStat()
          Retrieve primal status of the basic solution
 java.lang.String getProbName()
          Retrieve problem name
 int getRayInfo()
          Retrieve non-basic variable which causes unboundness
 double getRealParm(int parm)
          Query real control parameter
 double getRowDual(int i)
          Retrieve dual value (reduced cost) of auxiliary variable associated with row i
 double getRowLb(int i)
          Retrieve lower bound of row i
 java.lang.String getRowName(int i)
          Retrieve name of row i
 double getRowPrim(int i)
          Retrieve primal value of auxiliary variable of row i
 int getRowStat(int i)
          Retrieve status of row i
 int getRowType(int i)
          Retrieve type of row i
 double getRowUb(int i)
          Retrieve upper bound of row i
 int getStatus()
          Retrieve generic status of the basic solution
 int integer()
          Solve MIP problem using the branch-and-bound method
 int interior()
          Solve LP problem using the primal-dual interior point method
 double iptColDual(int j)
          Retrieve dual value (reduced cost) of auxiliary variable associated with column j
 double iptColPrim(int j)
          Retrieve primal value of structural variable of column j
 double iptObjVal()
          Retrieve objective value from interior-point solution
 double iptRowDual(int i)
          retrieve dual value (reduced cost) of auxiliary variable associated with row i
 double iptRowPrim(int i)
          Retrieve primal value of auxiliary variable of row i
 int iptStatus()
          Retrieve status of interior-point solution
 void loadMatrix(int ne, int[] ia, int[] ja, double[] ar)
          Load (replace) the whole constraint matrix
 double mipColVal(int j)
          Retrieve value of the structural variable associated with column j
 double mipObjVal()
          Retrieve value of the objective function
 double mipRowVal(int i)
          Retrieve value of the auxiliary variable associated with row i
 int mipStatus()
          Retrieve status of MIP solution
 int primRatioTest(int len, int[] ind, double[] val, int how, double tol)
          Perform primal ratio test
 boolean printIps(java.lang.String fname)
          Write interior point solution in printable format
 boolean printMip(java.lang.String fname)
          Write MIP solution in printable format
 boolean printProb(java.lang.String fname)
          Write problem data in plain text format
 boolean printSensBnds(java.lang.String fname)
          Write bounds sensitivity information
 boolean printSol(java.lang.String fname)
          Write basic solution in printable format
 boolean readBas(java.lang.String fname)
          Read LP basis in fixed MPS format
static GlpkSolver readCpxlp(java.lang.String fname)
          Read problem data in CPLEX LP format Example: GlpkSolver solver = solver.readFreemps("plan.lp");
static GlpkSolver readFreemps(java.lang.String fname)
          Read problem data in free MPS format
static GlpkSolver readModel(java.lang.String model, java.lang.String data, java.lang.String output)
          Read model written in GNU MathProg modeling language
static GlpkSolver readMps(java.lang.String fname)
          Read problem data in fixed MPS format
 void resetParms()
          Reset control parameters to default values
 void scaleProb()
          Scale problem data
 void setClss(int klass)
          Set (change) problem class
 void setColBnds(int j, int type, double lb, double ub)
          Set (change) column bounds
 void setColKind(int j, int kind)
          Set (change) kind of column (structural variable) j
 void setColName(int j, java.lang.String name)
          Assign (change) column name
 void setColStat(int j, int stat)
          Set (change) status of column j
 void setHook(GlpkHookIFC hook)
          Install a callback for handling printing and fault messages
 void setIntParm(int parm, int val)
          Set (change) integer control parameter
 void setMatCol(int j, int len, int[] ind, double[] val)
          Set (replace) column j of the constraint matrix
 void setMatRow(int i, int len, int[] ind, double[] val)
          Set (replace) row i of the constraint matrix
 void setObjCoef(int j, double coef)
          Set (change) objective coefficient or constant term
 void setObjDir(int dir)
          Set (change) optimization direction flag.
 void setObjName(java.lang.String name)
          Assign (change) the name of the objective funtion
 void setProbName(java.lang.String name)
          Assign (change) LP problem name
 void setRealParm(int parm, double val)
          Set (change) real control parameter
 void setRowBnds(int i, int type, double lb, double ub)
          Set (change) row bounds
 void setRowName(int i, java.lang.String name)
          Assign (change) row name
 void setRowStat(int i, int stat)
          Set (change) status of row i
 int simplex()
          Solve LP problem using the simplex method
 void stdBasis()
          Construct standard initial LP basis
 int transformCol(int len, int[] ind, double[] val)
          Transform explicitly specified column
 int transformRow(int len, int[] ind, double[] val)
          Transform explicitly specified row
 void unscaleProb()
          Unscale problem data
 int warmUp()
          “Warm up” / refresh LP basis
 boolean writeBas(java.lang.String fname)
          Write LP basis in fixed MPS format
 boolean writeCpxlp(java.lang.String fname)
          Write problem data in CPLEX LP format
 boolean writeFreemps(java.lang.String fname)
          Write problem data in free MPS format
 boolean writeMps(java.lang.String fname)
          Write problem data in fixed MPS format
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LPX_LP

public static final int LPX_LP
See Also:
Constant Field Values

LPX_MIP

public static final int LPX_MIP
See Also:
Constant Field Values

LPX_FR

public static final int LPX_FR
See Also:
Constant Field Values

LPX_LO

public static final int LPX_LO
See Also:
Constant Field Values

LPX_UP

public static final int LPX_UP
See Also:
Constant Field Values

LPX_DB

public static final int LPX_DB
See Also:
Constant Field Values

LPX_FX

public static final int LPX_FX
See Also:
Constant Field Values

LPX_MIN

public static final int LPX_MIN
See Also:
Constant Field Values

LPX_MAX

public static final int LPX_MAX
See Also:
Constant Field Values

LPX_B_UNDEF

public static final int LPX_B_UNDEF
See Also:
Constant Field Values

LPX_B_VALID

public static final int LPX_B_VALID
See Also:
Constant Field Values

LPX_P_UNDEF

public static final int LPX_P_UNDEF
See Also:
Constant Field Values

LPX_P_FEAS

public static final int LPX_P_FEAS
See Also:
Constant Field Values

LPX_P_INFEAS

public static final int LPX_P_INFEAS
See Also:
Constant Field Values

LPX_P_NOFEAS

public static final int LPX_P_NOFEAS
See Also:
Constant Field Values

LPX_D_UNDEF

public static final int LPX_D_UNDEF
See Also:
Constant Field Values

LPX_D_FEAS

public static final int LPX_D_FEAS
See Also:
Constant Field Values

LPX_D_INFEAS

public static final int LPX_D_INFEAS
See Also:
Constant Field Values

LPX_D_NOFEAS

public static final int LPX_D_NOFEAS
See Also:
Constant Field Values

LPX_BS

public static final int LPX_BS
See Also:
Constant Field Values

LPX_NL

public static final int LPX_NL
See Also:
Constant Field Values

LPX_NU

public static final int LPX_NU
See Also:
Constant Field Values

LPX_NF

public static final int LPX_NF
See Also:
Constant Field Values

LPX_NS

public static final int LPX_NS
See Also:
Constant Field Values

LPX_T_UNDEF

public static final int LPX_T_UNDEF
See Also:
Constant Field Values

LPX_T_OPT

public static final int LPX_T_OPT
See Also:
Constant Field Values

LPX_CV

public static final int LPX_CV
See Also:
Constant Field Values

LPX_IV

public static final int LPX_IV
See Also:
Constant Field Values

LPX_I_UNDEF

public static final int LPX_I_UNDEF
See Also:
Constant Field Values

LPX_I_OPT

public static final int LPX_I_OPT
See Also:
Constant Field Values

LPX_I_FEAS

public static final int LPX_I_FEAS
See Also:
Constant Field Values

LPX_I_NOFEAS

public static final int LPX_I_NOFEAS
See Also:
Constant Field Values

LPX_OPT

public static final int LPX_OPT
See Also:
Constant Field Values

LPX_FEAS

public static final int LPX_FEAS
See Also:
Constant Field Values

LPX_INFEAS

public static final int LPX_INFEAS
See Also:
Constant Field Values

LPX_NOFEAS

public static final int LPX_NOFEAS
See Also:
Constant Field Values

LPX_UNBND

public static final int LPX_UNBND
See Also:
Constant Field Values

LPX_UNDEF

public static final int LPX_UNDEF
See Also:
Constant Field Values

LPX_E_OK

public static final int LPX_E_OK
See Also:
Constant Field Values

LPX_E_EMPTY

public static final int LPX_E_EMPTY
See Also:
Constant Field Values

LPX_E_BADB

public static final int LPX_E_BADB
See Also:
Constant Field Values

LPX_E_INFEAS

public static final int LPX_E_INFEAS
See Also:
Constant Field Values

LPX_E_FAULT

public static final int LPX_E_FAULT
See Also:
Constant Field Values

LPX_E_OBJLL

public static final int LPX_E_OBJLL
See Also:
Constant Field Values

LPX_E_OBJUL

public static final int LPX_E_OBJUL
See Also:
Constant Field Values

LPX_E_ITLIM

public static final int LPX_E_ITLIM
See Also:
Constant Field Values

LPX_E_TMLIM

public static final int LPX_E_TMLIM
See Also:
Constant Field Values

LPX_E_NOFEAS

public static final int LPX_E_NOFEAS
See Also:
Constant Field Values

LPX_E_INSTAB

public static final int LPX_E_INSTAB
See Also:
Constant Field Values

LPX_E_SING

public static final int LPX_E_SING
See Also:
Constant Field Values

LPX_E_NOCONV

public static final int LPX_E_NOCONV
See Also:
Constant Field Values

LPX_E_NOPFS

public static final int LPX_E_NOPFS
See Also:
Constant Field Values

LPX_E_NODFS

public static final int LPX_E_NODFS
See Also:
Constant Field Values

LPX_K_MSGLEV

public static final int LPX_K_MSGLEV
See Also:
Constant Field Values

LPX_K_SCALE

public static final int LPX_K_SCALE
See Also:
Constant Field Values

LPX_K_DUAL

public static final int LPX_K_DUAL
See Also:
Constant Field Values

LPX_K_PRICE

public static final int LPX_K_PRICE
See Also:
Constant Field Values

LPX_K_RELAX

public static final int LPX_K_RELAX
See Also:
Constant Field Values

LPX_K_TOLBND

public static final int LPX_K_TOLBND
See Also:
Constant Field Values

LPX_K_TOLDJ

public static final int LPX_K_TOLDJ
See Also:
Constant Field Values

LPX_K_TOLPIV

public static final int LPX_K_TOLPIV
See Also:
Constant Field Values

LPX_K_ROUND

public static final int LPX_K_ROUND
See Also:
Constant Field Values

LPX_K_OBJLL

public static final int LPX_K_OBJLL
See Also:
Constant Field Values

LPX_K_OBJUL

public static final int LPX_K_OBJUL
See Also:
Constant Field Values

LPX_K_ITLIM

public static final int LPX_K_ITLIM
See Also:
Constant Field Values

LPX_K_ITCNT

public static final int LPX_K_ITCNT
See Also:
Constant Field Values

LPX_K_TMLIM

public static final int LPX_K_TMLIM
See Also:
Constant Field Values

LPX_K_OUTFRQ

public static final int LPX_K_OUTFRQ
See Also:
Constant Field Values

LPX_K_OUTDLY

public static final int LPX_K_OUTDLY
See Also:
Constant Field Values

LPX_K_BRANCH

public static final int LPX_K_BRANCH
See Also:
Constant Field Values

LPX_K_BTRACK

public static final int LPX_K_BTRACK
See Also:
Constant Field Values

LPX_K_TOLINT

public static final int LPX_K_TOLINT
See Also:
Constant Field Values

LPX_K_TOLOBJ

public static final int LPX_K_TOLOBJ
See Also:
Constant Field Values

LPX_K_MPSINFO

public static final int LPX_K_MPSINFO
See Also:
Constant Field Values

LPX_K_MPSOBJ

public static final int LPX_K_MPSOBJ
See Also:
Constant Field Values

LPX_K_MPSORIG

public static final int LPX_K_MPSORIG
See Also:
Constant Field Values

LPX_K_MPSWIDE

public static final int LPX_K_MPSWIDE
See Also:
Constant Field Values

LPX_K_MPSFREE

public static final int LPX_K_MPSFREE
See Also:
Constant Field Values

LPX_K_MPSSKIP

public static final int LPX_K_MPSSKIP
See Also:
Constant Field Values

LPX_K_LPTORIG

public static final int LPX_K_LPTORIG
See Also:
Constant Field Values

LPX_K_PRESOL

public static final int LPX_K_PRESOL
See Also:
Constant Field Values
Constructor Detail

GlpkSolver

public GlpkSolver()
Method Detail

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

enablePrints

public void enablePrints(boolean enable)

setHook

public void setHook(GlpkHookIFC hook)
Install a callback for handling printing and fault messages


setProbName

public void setProbName(java.lang.String name)
Assign (change) LP problem name


setObjName

public void setObjName(java.lang.String name)
Assign (change) the name of the objective funtion


setObjDir

public void setObjDir(int dir)
Set (change) optimization direction flag.
Maximize: dir = GlpkSolver.LPX_MAX;
Minimize: dir = GlpkSolver.LPX_MIN;


addRows

public void addRows(int nrs)
Add nrs new rows (constraints) to problem object


addCols

public void addCols(int ncs)
Add new ncs columns (structural variables) to problem object


setRowName

public void setRowName(int i,
                       java.lang.String name)
Assign (change) row name


setColName

public void setColName(int j,
                       java.lang.String name)
Assign (change) column name


setRowBnds

public void setRowBnds(int i,
                       int type,
                       double lb,
                       double ub)
Set (change) row bounds


setColBnds

public void setColBnds(int j,
                       int type,
                       double lb,
                       double ub)
Set (change) column bounds


setObjCoef

public void setObjCoef(int j,
                       double coef)
Set (change) objective coefficient or constant term


setMatRow

public void setMatRow(int i,
                      int len,
                      int[] ind,
                      double[] val)
Set (replace) row i of the constraint matrix

Parameters:
len - length of new row
ind - indices of columns
val - corresponding values (no zeros allowed)

setMatCol

public void setMatCol(int j,
                      int len,
                      int[] ind,
                      double[] val)
Set (replace) column j of the constraint matrix

Parameters:
len - length of new column
ind - indices of rows
val - corresponding values (no zeros allowed)

loadMatrix

public void loadMatrix(int ne,
                       int[] ia,
                       int[] ja,
                       double[] ar)
Load (replace) the whole constraint matrix

Parameters:
ne - number of elements in matrix
ia - row counter
ja - column counter
ar - value of matrix element (no zeros allowed)

delRows

public void delRows(int nrs,
                    int[] num)
Delete nrs rows from problem object

Parameters:
num - contains ordinal row numbers

delCols

public void delCols(int ncs,
                    int[] num)
Delete ncs columns from problem object

Parameters:
num - contains ordinal column numbers

getProbName

public java.lang.String getProbName()
Retrieve problem name


getObjName

public java.lang.String getObjName()
Retrieve objective function name


getObjDir

public int getObjDir()
Retrieve optimization direction flag


getNumRows

public int getNumRows()
Retrieve number of rows


getNumCols

public int getNumCols()
Retrieve number of columns


getRowName

public java.lang.String getRowName(int i)
Retrieve name of row i


getColName

public java.lang.String getColName(int j)
Retrieve name of column j


getRowType

public int getRowType(int i)
Retrieve type of row i


getRowLb

public double getRowLb(int i)
Retrieve lower bound of row i


getRowUb

public double getRowUb(int i)
Retrieve upper bound of row i


getColType

public int getColType(int j)
Retrieve type of column j


getColLb

public double getColLb(int j)
Retrieve lower bound of column j


getColUb

public double getColUb(int j)
Retrieve upper bound of column j


getObjCoef

public double getObjCoef(int j)
Retrieve objective function coefficient or constant term


getNumNz

public int getNumNz()
Retrieve number of constraint coefficients (non-zero elements in constraint matrix)


getMatRow

public int getMatRow(int i,
                     int[] ind,
                     double[] val)
Retrieve row i of the constraint matrix.

Parameters:
ind - contains column indices
val - contains the corresponding values

getMatCol

public int getMatCol(int j,
                     int[] ind,
                     double[] val)
Retrieve column j of the constraint matrix.

Parameters:
ind - contains column indices
val - contains the corresponding values

scaleProb

public void scaleProb()
Scale problem data


unscaleProb

public void unscaleProb()
Unscale problem data


stdBasis

public void stdBasis()
Construct standard initial LP basis


advBasis

public void advBasis()
Construct advanced initial LP basis


setRowStat

public void setRowStat(int i,
                       int stat)
Set (change) status of row i


setColStat

public void setColStat(int j,
                       int stat)
Set (change) status of column j


simplex

public int simplex()
Solve LP problem using the simplex method


getStatus

public int getStatus()
Retrieve generic status of the basic solution


getPrimStat

public int getPrimStat()
Retrieve primal status of the basic solution


getDualStat

public int getDualStat()
Retrieve dual status of the basic solution


getObjVal

public double getObjVal()
Retrieve current value of the objective function


getRowStat

public int getRowStat(int i)
Retrieve status of row i


getRowPrim

public double getRowPrim(int i)
Retrieve primal value of auxiliary variable of row i


getRowDual

public double getRowDual(int i)
Retrieve dual value (reduced cost) of auxiliary variable associated with row i


getColStat

public int getColStat(int j)
Retrieve status of column j


getColPrim

public double getColPrim(int j)
Retrieve primal value of the structural variable (column) j


getColDual

public double getColDual(int j)
Retrieve dual value (reduced cost) of the structural variable (column) j


getRayInfo

public int getRayInfo()
Retrieve non-basic variable which causes unboundness


checkKkt

public void checkKkt(int scaled,
                     GlpkSolverKktConditions kkt)
Check Karush-Kuhn-Tucker conditions


warmUp

public int warmUp()
“Warm up” / refresh LP basis


evalTabRow

public int evalTabRow(int k,
                      int[] ind,
                      double[] val)
Compute row of the simplex table


evalTabCol

public int evalTabCol(int k,
                      int[] ind,
                      double[] val)
Compute column of the simplex table


transformRow

public int transformRow(int len,
                        int[] ind,
                        double[] val)
Transform explicitly specified row


transformCol

public int transformCol(int len,
                        int[] ind,
                        double[] val)
Transform explicitly specified column


primRatioTest

public int primRatioTest(int len,
                         int[] ind,
                         double[] val,
                         int how,
                         double tol)
Perform primal ratio test


dualRatioTest

public int dualRatioTest(int len,
                         int[] ind,
                         double[] val,
                         int how,
                         double tol)
Perform dual ratio test


interior

public int interior()
Solve LP problem using the primal-dual interior point method


iptStatus

public int iptStatus()
Retrieve status of interior-point solution


iptObjVal

public double iptObjVal()
Retrieve objective value from interior-point solution


iptRowPrim

public double iptRowPrim(int i)
Retrieve primal value of auxiliary variable of row i


iptRowDual

public double iptRowDual(int i)
retrieve dual value (reduced cost) of auxiliary variable associated with row i


iptColPrim

public double iptColPrim(int j)
Retrieve primal value of structural variable of column j


iptColDual

public double iptColDual(int j)
Retrieve dual value (reduced cost) of auxiliary variable associated with column j


setClss

public void setClss(int klass)
Set (change) problem class

Parameters:
klass - LPX_LP: LP problem, LPX_MIP: MIP problem

getClss

public int getClss()
Retrieve problem class


setColKind

public void setColKind(int j,
                       int kind)
Set (change) kind of column (structural variable) j

Parameters:
kind - LPX_CV: continuous, LPX_IV: integer

getColKind

public int getColKind(int j)
Retrieve kind of column j


getNumInt

public int getNumInt()
Retrieve number of integer columns


getNumBin

public int getNumBin()
Retrieve number of binary columns


integer

public int integer()
Solve MIP problem using the branch-and-bound method


mipStatus

public int mipStatus()
Retrieve status of MIP solution


mipObjVal

public double mipObjVal()
Retrieve value of the objective function


mipRowVal

public double mipRowVal(int i)
Retrieve value of the auxiliary variable associated with row i


mipColVal

public double mipColVal(int j)
Retrieve value of the structural variable associated with column j


resetParms

public void resetParms()
Reset control parameters to default values


setIntParm

public void setIntParm(int parm,
                       int val)
Set (change) integer control parameter


getIntParm

public int getIntParm(int parm)
Query integer control parameter


setRealParm

public void setRealParm(int parm,
                        double val)
Set (change) real control parameter


getRealParm

public double getRealParm(int parm)
Query real control parameter


readMps

public static GlpkSolver readMps(java.lang.String fname)
Read problem data in fixed MPS format


writeMps

public boolean writeMps(java.lang.String fname)
Write problem data in fixed MPS format


readBas

public boolean readBas(java.lang.String fname)
Read LP basis in fixed MPS format


writeBas

public boolean writeBas(java.lang.String fname)
Write LP basis in fixed MPS format


readFreemps

public static GlpkSolver readFreemps(java.lang.String fname)
Read problem data in free MPS format


writeFreemps

public boolean writeFreemps(java.lang.String fname)
Write problem data in free MPS format


readCpxlp

public static GlpkSolver readCpxlp(java.lang.String fname)
Read problem data in CPLEX LP format Example: GlpkSolver solver = solver.readFreemps("plan.lp");


writeCpxlp

public boolean writeCpxlp(java.lang.String fname)
Write problem data in CPLEX LP format


readModel

public static GlpkSolver readModel(java.lang.String model,
                                   java.lang.String data,
                                   java.lang.String output)
Read model written in GNU MathProg modeling language


printProb

public boolean printProb(java.lang.String fname)
Write problem data in plain text format


printSol

public boolean printSol(java.lang.String fname)
Write basic solution in printable format


printSensBnds

public boolean printSensBnds(java.lang.String fname)
Write bounds sensitivity information


printIps

public boolean printIps(java.lang.String fname)
Write interior point solution in printable format


printMip

public boolean printMip(java.lang.String fname)
Write MIP solution in printable format