Professional Documents
Culture Documents
CREATE TABLE "utilisateur" ("ID" INTEGER NOT NULL UNIQUE,"login" TEXT NOT NULL
UNIQUE,"password" TEXT NOT NULL,"imageProfilPath"TEXT,PRIMARY KEY("ID"
AUTOINCREMENT));
#################
Table projet:
CREATE TABLE "projet" ("ID" INTEGER NOT NULL UNIQUE,"titre" TEXT NOT NULL
UNIQUE,"note" REAL,PRIMARY KEY("ID" AUTOINCREMENT));
#################
CREATE TABLE "ressource" ("ID" INTEGER NOT NULL UNIQUE,"nom" TEXT NOT NULL
UNIQUE,"idProjet" INTEGER,PRIMARY KEY("ID" AUTOINCREMENT),FOREIGN KEY("idProjet")
REFERENCES "projet"("ID"));
################
CREATE TABLE "contribution" ("ID" INTEGER NOT NULL UNIQUE,"idUtilisateur"
INTEGER,"idProjet" INTEGER,"type" TEXT NOT NULL,PRIMARY KEY("ID"
AUTOINCREMENT),FOREIGN KEY("idProjet") REFERENCES "projet"("ID"),FOREIGN
KEY("idUtilisateur") REFERENCES "utilisateur"("ID"));
##############
CREATE TABLE "commentaire" ("ID" INTEGER NOT NULL UNIQUE,"idProjet"
INTEGER,"contenue" TEXT,PRIMARY KEY("ID" AUTOINCREMENT),FOREIGN KEY("idProjet")
REFERENCES "projet"("ID"));
public static ArrayList<Double> findPivot2(ArrayList<ArrayList<Double>> M)
{
ArrayList<ArrayList<Double>> R = M;
/**
* the residus array is the where we store the results of dividing the
elements below and above
* the a1 element.
* then we store their indexes as well to target the index of row for pivot
seek.
*/
double [] residus = new double[M.size() - 1];
int [] indexes = new int[M.size() - 1];
for (int i = 1, j = 0; i < R.size(); i++, j++) {
System.out.println("d : " + R.get(i).get(a1));
System.out.println("D : " + R.get(i).get(R.get(0).size() - 1));
//test if elements of the same column as pivot are positive (non-
negativity constraint)
//Debug stuffs
System.out.println("Array: residus : ");
for (int i = 0; i < residus.length; i++) {
System.out.print(residus[i] + " ");
}
double minima2 = Arrays.stream(residus).min().getAsDouble();
System.out.println("*************************");
returned.add(R.get(indexes[b1]).get(a1));
returned.add((double) indexes[b1]);
returned.add((double) a1);
return returned;
}