navy1991
18th September 2013, 15:22
I have a source file for qsimplex, which is given in the link below:
http://www.oschina.net/code/explore/qt-4.7.1/src/gui/graphicsview/qsimplex_p.cpp
The header file is given in the link:
http://www.oschina.net/code/explore/qt-4.7.1/src/gui/graphicsview/qsimplex_p.h
I have a text file with some data like:
Maximize:
obj: 3e-06 A - 3e-06 B + 2.7e-01 F
constraints:
RXN1: -1 A + 1 B -1 C + 1 D -1 E -1 F = 0
RXN2: -1 A + 1 B -1 C + 1 D -1 E -1 F = 0
RXN3: -1 A + 1 B -1 C + 1 D -1 E -1 F = 0
RXN4: -1 A + 1 B -1 C + 1 D -1 E -1 F = 0
... many constraints like this
Bounds:
A >= 0
B <= 100
C >= 0
.....
...........many bounds like this.
I wrote a small program to get the data from this file:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
ifstream ifs("Metabolism.txt");
string line;
while(getline(ifs,line)) {
cout << "[ " << line << " ]" << endl;
}
system("PAUSE");
}
I want some help to parse all the constraints and bounds as inputs and get the maximum value of the objective function as the output using the above lpsolver header file.
I want to see some examples of implementation of this Linear programming solver in order to use it. Could you anyone suggest some examples?
Thanks.
http://www.oschina.net/code/explore/qt-4.7.1/src/gui/graphicsview/qsimplex_p.cpp
The header file is given in the link:
http://www.oschina.net/code/explore/qt-4.7.1/src/gui/graphicsview/qsimplex_p.h
I have a text file with some data like:
Maximize:
obj: 3e-06 A - 3e-06 B + 2.7e-01 F
constraints:
RXN1: -1 A + 1 B -1 C + 1 D -1 E -1 F = 0
RXN2: -1 A + 1 B -1 C + 1 D -1 E -1 F = 0
RXN3: -1 A + 1 B -1 C + 1 D -1 E -1 F = 0
RXN4: -1 A + 1 B -1 C + 1 D -1 E -1 F = 0
... many constraints like this
Bounds:
A >= 0
B <= 100
C >= 0
.....
...........many bounds like this.
I wrote a small program to get the data from this file:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
ifstream ifs("Metabolism.txt");
string line;
while(getline(ifs,line)) {
cout << "[ " << line << " ]" << endl;
}
system("PAUSE");
}
I want some help to parse all the constraints and bounds as inputs and get the maximum value of the objective function as the output using the above lpsolver header file.
I want to see some examples of implementation of this Linear programming solver in order to use it. Could you anyone suggest some examples?
Thanks.