Skip to content

Commit 5b72bab

Browse files
committed
@pa macro, better @show for arrays
1 parent 69fb852 commit 5b72bab

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/solve.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function sym_lu(A)
3838
end
3939
end
4040

41+
@pa p
4142
LU(factors, p, BlasInt(0))
4243
end
4344

@@ -56,10 +57,23 @@ function A_b(eqs, vars)
5657
A, b
5758
end
5859

60+
macro pa(x)
61+
n = string(x)
62+
quote
63+
println($n, " = ")
64+
Base.print_array(stdout, $(esc(x)))
65+
println()
66+
end
67+
end
5968
function solve_for(eqs, vars)
69+
@pa eqs
70+
@pa vars
71+
6072
A, b = A_b(eqs, vars)
6173
A = SymbolicUtils.simplify.(to_symbolic.(A), polynorm=true)
6274
b = SymbolicUtils.simplify.(to_symbolic.(b), polynorm=true)
75+
@pa A
76+
@pa b
6377
map(to_mtk, SymbolicUtils.simplify.(ldiv(sym_lu(A), b)))
6478
end
6579

0 commit comments

Comments
 (0)