Skip to content

solve_lin

Fabian Kindermann edited this page Apr 1, 2021 · 10 revisions
subroutine solve_lin(x, c, A, b, numle, numge, numeq)

Description:

This subroutine applies the simplex algorithm to solve a linear programming problem of the form


We thereby have


Next to the coefficient vector , the input to this subroutine is a stacked matrix and a stacked vector


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.

Input arguments:

  • real*8 :: c(:)
    The coefficients of the linear program. Note that this one-dimensional array needs to have exactly the same length as the array x.
  • 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 array x 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.

Output arguments:

  • real*8 :: x(:)
    A one-dimensional array into which the subroutine stores the solution vector of the linear program.

References

  • 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

HOME
» Toolbox Documentation
» Linear Programming with constraints

Clone this wiki locally