Skip to content

Commit d15556f

Browse files
committed
Setting upt
1 parent 1961d67 commit d15556f

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
# SimpleTableaux
2+
3+
Illustration project for the optimization problem
4+
$$\max c^t x \quad\text{subject to}\quad Ax ≤ b$$

src/SimpleTableaux.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@ using LinearAlgebra
55

66
import DataFrames: DataFrame
77

8+
89
TabEntry = Rational{BigInt}
910

10-
export Tableau
11+
export DataFrame, Tableau
12+
"""
13+
Tableau(A::Matrix, b::Vector, c::Vector)
1114
15+
Create a `Tableau` datastructure for the linear program maximize `c'x` subject to `Ax ≤ b`.
16+
"""
1217
struct Tableau
13-
M::Matrix{TabEntry}
14-
n_vars::Int
15-
n_cons::Int
16-
function Tableau(A::Matrix, b::Vector, c::Vector)
18+
M::Matrix{TabEntry} # place to hold the entire Tableau
19+
n_vars::Int # number of variables in the LP
20+
n_cons::Int # number of constraints in the LP
21+
22+
function Tableau(A::Matrix, b::Vector, c::Vector)
1723
m, n = size(A)
1824
if length(b) m || length(c) n
1925
throw(ArgumentError("Size mismatch"))

test/runtests.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using Test
2+
using SimpleTableaux
3+
using LinearAlgebra
4+
using DataFrames
5+
6+
7+
8+
@testset "Dumb start" begin
9+
A = [1 2 3 4; 5 6 7 8]
10+
b = [1; 3]
11+
c = [5; 6; 9; 2]
12+
T = Tableau(A,b,c)
13+
@show DataFrame(T)
14+
end

0 commit comments

Comments
 (0)