Skip to contents

A step of the miprgr_native implementation. Called by miprgr_solve_relaxation. See the file header for the source the module follows.

Usage

miprgr_simplex(A, b, c, tol = 1e-09, max_iter = 20000)

Arguments

A

A matrix; indexed by row and column.

b

A vector; its length is taken and its elements indexed.

c

A vector; its length is taken.

tol

Numeric; combined arithmetically in the body. Defaults to 1e-09.

max_iter

Passed to run_phase. Defaults to 20000.

Value

A list with feasible, x, value.

Examples

# maximise 3 x1 + 5 x2 subject to x1 <= 4, 2 x2 <= 12, 3 x1 + 2 x2 <= 18
A <- rbind(c(1, 0), c(0, 2), c(3, 2))
miprgr_simplex(A, b = c(4, 12, 18), c = c(3, 5))[c("x", "value")]   # (2, 6), 36
#> $x
#> [1] 2 6
#> 
#> $value
#> [1] 36
#>