-
Notifications
You must be signed in to change notification settings - Fork 46
solve_lin
Fabian Kindermann edited this page Apr 2, 2021
·
10 revisions
subroutine solve_lin(x, c, A, b, numle, numge, numeq)
This subroutine applies the simplex algorithm to solve a linear programming problem of the form
Note that the matrix and vector need to be stacked in exactly this order, meaning first the set of lower than or equality constraints, then the set of greater than or equality constraints and last the strict equality constraints.
-
real*8 :: c(:)
The coefficients of the linear program. Note that this one-dimensional array needs to have exactly the same length as the arrayx
. -
real*8 :: A(:, :)
The stacked coefficient matrix for the total set of constraints. Note that this two-dimensional array needs to have the length in the first dimension and the same length as the arrayx
in the second dimension. -
real*8 :: b(:)
The stacked vector for the total set of constraints. Note that this one-dimensional array needs to have the length . -
integer :: numle
This integer scalar tells the subroutine how many lower than or equality constraints the linear program has. -
integer :: numge
This integer scalar tells the subroutine how many greater than or equality constraints the linear program has. -
integer :: numeq
This integer scalar tells the subroutine how many strict equality constraints the linear program has.
-
real*8 :: x(:)
A one-dimensional array into which the subroutine stores the solution vector of the linear program.
- For further reading refer to:
- Dantzig, G.B. & Thapa, M. N. (1997). Linear Programming 1: Introduction. New York: Springer Series in Operations Research and Financial Engineering.
- This routine is used in the following programs:
prog02_20.f90