Now it is time to allocate memory for a linear program.
The easiest way to create the matrix is to use a double** pointer.
See book or first few slides of F03. You can also get inspiration from the check function in main.c in the intopt directory from Tresorit (type tar xvf intopt.tar.bz2 to expand it).
It is also a good idea to look at the video clips for Lecture 2.
But for lab 1, you don't have to understand anything about linear programs. It is only about reading the input and printing it.
See Appendix B, and
use the following format for the input, where m is the number of constraints and n the number of decision variables.
As you can see in the youtube clips, there is a vector
with n c-coefficients,
a matrix with m rows and n columns, and a
vector with m b-values. The matrix and vectors should have elements
of type double.
m n
c_0 c_1 ... c_{n-1}
a_00 a_01 ... a_{0,n-1}
a_10 a_11 ... a_{1,n-1}
...
a_{m-1,0} a_{m_1,1} ... a_{m-1,n-1}
b_0 b_1 ... b_{m-1}
Use the following input (from Appendix B):
2 2
1 2
-0.5 1
3 1
4 18