Skip to content

Commit cfc7309

Browse files
committed
remove unused
1 parent fbd4595 commit cfc7309

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

src/FixedSizeArrays.jl

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export FixedMatrix
1515
export Mat
1616
export Vec
1717
export Point
18-
export @fsa
1918
export FixedVectorNoTuple
2019

2120
const FixedArray = StaticArray
@@ -24,36 +23,6 @@ const FixedMatrix = StaticMatrix
2423
const Mat = SMatrix
2524
const FixedVectorNoTuple = FieldVector
2625

27-
function fsa_ast(ex)
28-
@assert isa(ex, Expr)
29-
if ex.head == :vect # Vector
30-
return Expr(:call, SVector{length(ex.args)}, Expr(:tuple, ex.args...))
31-
elseif ex.head == :hcat # 1 x n
32-
s1 = 1
33-
s2 = length(ex.args)
34-
return Expr(:call, SMatrix{s1, s2}, Expr(:tuple, ex.args...))
35-
elseif ex.head == :vcat
36-
if isa(ex.args[1], Expr) && ex.args[1].head == :row # n x m
37-
# Validate
38-
s1 = length(ex.args)
39-
s2s = map(i -> ((isa(ex.args[i], Expr) && ex.args[i].head == :row) ? length(ex.args[i].args) : 1), 1:s1)
40-
s2 = minimum(s2s)
41-
if maximum(s2s) != s2
42-
error("Rows must be of matching lengths")
43-
end
44-
45-
exprs = [ex.args[i].args[j] for i = 1:s1, j = 1:s2]
46-
return Expr(:call, SMatrix{s1, s2}, Expr(:tuple, exprs...))
47-
else # n x 1
48-
return Expr(:call, SMatrix{length(ex.args), 1}, Expr(:tuple, ex.args...))
49-
end
50-
end
51-
end
52-
macro fsa(ex)
53-
expr = fsa_ast(ex)
54-
esc(expr)
55-
end
56-
5726
function unit(::Type{T}, i::Integer) where T <: StaticVector
5827
T(ntuple(Val(length(T))) do j
5928
ifelse(i == j, 1, 0)

0 commit comments

Comments
 (0)