public class NewGLPKSolver extends Object implements scpsolver.lpsolver.LinearProgramSolver
This class is added temporarily till issue of freeing the memory of the instance of the GlpkSolver in the solve() method gets resolved in SCPSolver.
Currently, while running the SBML Test Suite, it crashes in between due to the memory allocation error for GlpkSolver class.
The error: glp_free: memory allocation error Error detected in file env/alloc.c at line 72
This happened as the memory of the GlpkSolver instance was not freed. So, this class is the copy of the GLPKSolver class from the SCPSolver. The only change here is that the `solver.deleteProb();` is called in the solve() method after its use is done which deletes the object, i.e., frees the memory.
This class will be removed from SBSCL as this issue gets resolved in the SCPSolver.
Constructor and Description |
---|
NewGLPKSolver() |
Modifier and Type | Method and Description |
---|---|
void |
addEqualsConstraint(scpsolver.constraints.LinearEqualsConstraint c) |
void |
addLinearBiggerThanEqualsConstraint(scpsolver.constraints.LinearBiggerThanEqualsConstraint c) |
void |
addLinearSmallerThanEqualsConstraint(scpsolver.constraints.LinearSmallerThanEqualsConstraint c) |
int[] |
getIntegerSolution() |
String[] |
getLibraryNames() |
String |
getName() |
int |
getTimeconstraint() |
static void |
main(String[] args) |
void |
setTimeconstraint(int timeconstraint) |
double[] |
solve(scpsolver.problems.LinearProgram lp) |
public int getTimeconstraint()
public void setTimeconstraint(int timeconstraint)
setTimeconstraint
in interface scpsolver.lpsolver.LinearProgramSolver
timeconstraint
- the timeconstraint to setpublic double[] solve(scpsolver.problems.LinearProgram lp)
solve
in interface scpsolver.lpsolver.LinearProgramSolver
public int[] getIntegerSolution()
public void addLinearBiggerThanEqualsConstraint(scpsolver.constraints.LinearBiggerThanEqualsConstraint c)
addLinearBiggerThanEqualsConstraint
in interface scpsolver.lpsolver.LinearProgramSolver
public void addLinearSmallerThanEqualsConstraint(scpsolver.constraints.LinearSmallerThanEqualsConstraint c)
addLinearSmallerThanEqualsConstraint
in interface scpsolver.lpsolver.LinearProgramSolver
public void addEqualsConstraint(scpsolver.constraints.LinearEqualsConstraint c)
addEqualsConstraint
in interface scpsolver.lpsolver.LinearProgramSolver
public String getName()
getName
in interface scpsolver.lpsolver.LinearProgramSolver
public String[] getLibraryNames()
getLibraryNames
in interface scpsolver.lpsolver.LinearProgramSolver
public static void main(String[] args)
Copyright © 2007–2021. All rights reserved.