it.ssc.vector_spaces.Vector 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 it.ssc.vector_spaces;
public class Vector {
public enum TYPE_VECTOR {ROW, COLUMN};
private TYPE_VECTOR tipo;
private double[] vector;
/**
* Crea un vettore riga */
public Vector(double[] vectorArg) {
this(vectorArg,TYPE_VECTOR.ROW);
}
public Vector(int size,TYPE_VECTOR tipo) {
this.tipo=tipo;
vector=new double[size];
}
public TYPE_VECTOR getTipo() {
return tipo;
}
public Vector(double[] vectorArg,TYPE_VECTOR tipo) {
this.tipo=tipo;
if(vectorArg==null) throw new NullPointerException("Non posso costruire un oggetto Vector con argomento del costruttore a null");
this.vector=new double[vectorArg.length];
for(int _a=0;_a