We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I use your code, and this have issues when I run this program
Maximize p = x + y subject to 2x + y <= 4, x + 2y <= 3
I solve it changing findEnteringColumn function
`// finds the next entering column private int findEnteringColumn(){ //float[] values = new float[cols]; //int location = 0;
int count = 0; for(int pos = 0; pos < cols-1; pos++){ if(table[rows-1][pos] < 0){ return pos; //System.out.println("negative value found"); //count++; } } return -1; // This case never exist /* if(count > 1){ for(int i = 0; i < cols-1; i++) values[i] = Math.abs(table[rows-1][i]); location = findLargestValue(values); } else location = count - 1; return location; */ }`
To validate I use this web https://www.zweigmedia.com/RealWorld/simplex.html
My complete code is here
`/*
import lp.LPObjects.Simplex.ERROR;
/**
Use this class to test LP programs
@author Miguel Angel Ramos Valdovinos */ public class prueba {
public static void main(String[] args) {
float[][] table = new float[3][6]; table[0][0] = 2; table[0][1] = 1; table[0][2] = 1; table[0][3] = 0; table[0][4] = 0; table[0][5] = 4; table[1][0] = 1; table[1][1] = 2; table[1][2] = 0; table[1][3] = 1; table[1][4] = 0; table[1][5] = 3; table[2][0] = -1; table[2][1] = -1; table[2][2] = 0; table[2][3] = 0; table[2][4] = 1; table[2][5] = 0; Simplex solv = new Simplex(2, 5); solv.fillTable(table); solv.print(); boolean cont = true; while (cont){ ERROR res = solv.compute(); if (res == ERROR.IS_OPTIMAL || res == ERROR.UNBOUNDED){ cont = false; } solv.print(); }
}
} `
The text was updated successfully, but these errors were encountered:
Ok, I'll fix it up. Thanks
Sorry, something went wrong.
@miguel14 could you please again upload somethere your fix? All your links is broken :(
@MiKaminskas Hi, I found several bugs, so I better used the solver of CommonsMath3 of Apache. Sorry I delete the code.
http://commons.apache.org/proper/commons-math/
No branches or pull requests
I use your code, and this have issues when I run this program
Maximize p = x + y subject to 2x + y <= 4, x + 2y <= 3
I solve it changing findEnteringColumn function
`// finds the next entering column
private int findEnteringColumn(){
//float[] values = new float[cols];
//int location = 0;
To validate I use this web https://www.zweigmedia.com/RealWorld/simplex.html
My complete code is here
`/*
*/
package lp.LPObjects;
import lp.LPObjects.Simplex.ERROR;
/**
Use this class to test LP programs
@author Miguel Angel Ramos Valdovinos
*/
public class prueba {
public static void main(String[] args) {
}
}
`
The text was updated successfully, but these errors were encountered: