-
Notifications
You must be signed in to change notification settings - Fork 128
Remove link between muon and curvefitting libs #39656
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
Remove link between muon and curvefitting libs #39656
Conversation
33b17d7
to
011ac0b
Compare
This reverts commit daa6ad6.
On Windows (and maybe ARM) a |
This is what I'm working with at the moment: https://godbolt.org/z/hf7GhGs77 Results are inconsistent when using double/long double. |
private: | ||
MatrixWorkspace_sptr m_loadedData; | ||
IAlgorithm_sptr phaseQuad; | ||
IAlgorithm_sptr m_phaseQuad; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
const double X = n0[h] * asym * cos(phi); | ||
const double Y = n0[h] * asym * sin(phi); | ||
n0Vectors[h] = CurveFitting::EigenVector({X, Y}); | ||
Eigen::Vector<eigenDataType, 2> n0vec; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unused, will push after review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done a functional test on Windows and on Linux (Ubuntu 20.04) and the two Muon GUIs open without any problem.
The code looks sensible.
I am assuming this does not need a release note @thomashampson ?
release notes will be added separately |
This PR removes the use of `Mantid::CurveFitting::EigenMatrix` from the `Muon` library to avoid the linking of two plugin libraries. We use `PartialPivLU` decomposition in calculating the inverse, replicating what the `Mantid::CurveFitting::EigenMatrix` is doing under the hood. `long double` is used on arm mac, as it brings precision of eigen matrix multiplication inline (lowers it) with the other operating systems. I'm not sure why, you would expect a greater degree of precision. Here is a compiler explorer used to interrogate the differences when different types are used with eigen across our compilers: https://godbolt.org/z/51W6KPecb This illustrates the issue, but doesn't show the same impact on arm64 of switching to `long double`.
This is a version of #39656 into `ornl-next` Co-authored-by: MialLewis <95620982+MialLewis@users.noreply.github.com>
Description of work
Summary of work
This PR removes the use of
Mantid::CurveFitting::EigenMatrix
from theMuon
library to avoid the linking of two plugin libraries.We use
PartialPivLU
decomposition in calculating the inverse, replicating what theMantid::CurveFitting::EigenMatrix
is doing under the hood.long double
is used on arm mac, as it brings precision of eigen matrix multiplication inline (lowers it) with the other operating systems. I'm not sure why, you would expect a greater degree of precision.Here is a compiler explorer used to interrogate the differences when different types are used with eigen across our compilers: https://godbolt.org/z/51W6KPecb
This illustrates the issue, but doesn't show the same impact on arm64 of switching to
long double
.Testing change on arm: https://builds.mantidproject.org/job/build_packages_from_branch/1200/
Fixes #39644
Reviewer
Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.
Code Review
Functional Tests
Does everything look good? Mark the review as Approve. A member of
@mantidproject/gatekeepers
will take care of it.Gatekeeper
If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.