All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.constraints.linear.LinearSolverFactory Maven / Gradle / Ivy

Go to download

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);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy