Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further simplify StaticArrays usage #29

Merged
merged 1 commit into from
Mar 21, 2018
Merged

Conversation

wsshin
Copy link
Collaborator

@wsshin wsshin commented Mar 21, 2018

Extending the efforts in #27, eliminate unnecessary transpose operations on SVectors after JuliaArrays/StaticArrays.jl#274.

@codecov-io
Copy link

codecov-io commented Mar 21, 2018

Codecov Report

Merging #29 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #29   +/-   ##
=======================================
  Coverage   93.72%   93.72%           
=======================================
  Files           7        7           
  Lines         223      223           
=======================================
  Hits          209      209           
  Misses         14       14
Impacted Files Coverage Δ
src/ellipsoid.jl 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbb9880...de86e62. Read the comment docs.

# 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))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't r2 a real scalar, and hence doesn't need the '? Also use .* to fuse that multiply with the other dot ops.

Copy link
Collaborator Author

@wsshin wsshin Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, in this case r2 is a vector of the squared radii of the ellipsoid, and ndir is a matrix, so I think the operations are used correctly.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see.

@stevengj stevengj merged commit 747321c into stevengj:master Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants