javax.constraints.linear.LinearSolverFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsr331-ssc Show documentation
Show all versions of jsr331-ssc Show documentation
This is a JSR331 interface for SSC (Software for the Calculation of the Simplex) is a java library for solving linear programming problems v. 3.0.1.
SSC was designed and developed by Stefano Scarioli.
The newest version!
package javax.constraints.linear;
import javax.constraints.impl.Problem;
public class LinearSolverFactory {
public static LinearSolver newLinearSolver(Problem problem) {
try {
LinearSolver solver = (LinearSolver) Class.forName(
"javax.constraints.linear.impl.LinearSolver").newInstance();
solver.setProblem(problem);
problem.setSolver(solver);
return solver;
} catch (Exception e) {
throw new RuntimeException(
"LinearSolverFactory: Can not create an instance of the class javax.constraints.impl.LinearSolver",
e);
}
}
}