Skip to content

Commit

Permalink
Further simplify StaticArrays usage (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsshin authored and stevengj committed Mar 21, 2018
1 parent 678b4eb commit 747321c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/ellipsoid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,7 @@ function boundpts(b::Ellipsoid{N}) where {N}
# n is (n .* r2) / sqrt(r2' * n.^2). Below is the broadcasted version of this over a
# matrix n, whose each column is a direction normal. Once calculated, we need to
# change the coordinates back to the original coordinates.
#
# This operation can be written M = b.p' * ((ndir .* r2) ./ sqrt.(r2' * ndir.^2)), but
# the resulting M is not an SMatrix. (The calculation involves broadcasted division by
# a row vector, which leads to a non-SMatrix.) Therefore, we first calculate M'
# (which remains SMatrix) and recover M.
M = (((ndir .* r2)' ./ sqrt.(ndir'.^2 * r2)) * b.p)'
M = b.p' * ((ndir .* r2) ./ sqrt.(r2' * ndir.^2))

return M
end
Expand Down

0 comments on commit 747321c

Please sign in to comment.