Now it is time to allocate memory for a linear program.
If you don't have the 2020 edition of the course book, you can download
pdfs with the pseudo code following this link.
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.
If you have the 2020 book, see Appendix B.
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