scpsolver.lpsolver
Interface LinearProgramSolver


public interface LinearProgramSolver

Common interface for available linear program solvers.

Author:
schober

Method Summary
 void addEqualsConstraint(LinearEqualsConstraint c)
          Adds a LinearEqualsConstraint to the solver.
 void addLinearBiggerThanEqualsConstraint(LinearBiggerThanEqualsConstraint c)
          Adds a LinearBiggerThanEqualsConstraint to the solver.
 void addLinearSmallerThanEqualsConstraint(LinearSmallerThanEqualsConstraint c)
          Adds a LinearSmallerThanEqualsConstraint to the solver.
 java.lang.String[] getLibraryNames()
          Returns the names of any system library that the solver depends on.
 java.lang.String getName()
          Returns the name of this linear program solver.
 void setTimeconstraint(int t)
           
 double[] solve(LinearProgram lp)
          Tries to solve a linear program.
 

Method Detail

solve

double[] solve(LinearProgram lp)
Tries to solve a linear program.

Parameters:
lp - the linear program to be solved
Returns:
an array of the found solutions for the variables

addLinearBiggerThanEqualsConstraint

void addLinearBiggerThanEqualsConstraint(LinearBiggerThanEqualsConstraint c)
Adds a LinearBiggerThanEqualsConstraint to the solver. Note that all existing constraints of a LinearProgram are automatically transfered by the solve method. Therefore, this method is only needed explicitly, if an additional constrained is to be added to the model without wanting to alter the LinearProgram itself. Usually, this method is needed and used by the programers in deeper parts of the code, which the user has not worry about.

Parameters:
c - the constraint to be added

addLinearSmallerThanEqualsConstraint

void addLinearSmallerThanEqualsConstraint(LinearSmallerThanEqualsConstraint c)
Adds a LinearSmallerThanEqualsConstraint to the solver. Note that all existing constraints of a LinearProgram are automatically transfered by the solve method. Therefore, this method is only needed explicitly, if an additional constrained is to be added to the model without wanting to alter the LinearProgram itself. Usually, this method is needed and used by the programers in deeper parts of the code, which the user has not worry about.

Parameters:
c - the constraint to be added

addEqualsConstraint

void addEqualsConstraint(LinearEqualsConstraint c)
Adds a LinearEqualsConstraint to the solver. Note that all existing constraints of a LinearProgram are automatically transfered by the solve method. Therefore, this method is only needed explicitly, if an additional constrained is to be added to the model without wanting to alter the LinearProgram itself. Usually, this method is needed and used by the programers in deeper parts of the code, which the user has not worry about.

Parameters:
c - the constraint to be added

getName

java.lang.String getName()
Returns the name of this linear program solver. This method is needed if a specific solver is requested from the solver factory.

Returns:
the name of the solver

getLibraryNames

java.lang.String[] getLibraryNames()
Returns the names of any system library that the solver depends on. Before returning an instance of the requested solver, the SolverFactory ensures that the required libraries are loaded. If the solver factory failed to load any library, it will not return an instance of this solver.

Returns:
all libary names that this solver depends on

setTimeconstraint

void setTimeconstraint(int t)