Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: meas_modelfit
-
Labels:
-
Story Points:0.5
-
Epic Link:
-
Sprint:AP F18-1
-
Team:Alert Production
Description
meas_modelfit has some issues with Eigen 3.3.4. I am making this a separate ticket from DM-14305 in hopes that these can be fixed in a way that is backwards compatible.
The first issue is that this does not compile:
ndarray::asEigenMatrix(*ix) = component._mu
|
+ std::sqrt(_df/rng.chisq(_df)) * (component._sigmaLLT.matrixL() * _workspace);
|
but the solution to that is trivial: swap component._sigmaLLT.matrixL() and _workspace, though Jim Bosch suggested a solution that reduces duplication with nearby code.
A more serious concern is that the following code in TruncatedGaussian.cc TruncatedGaussian::maximize raises an assertion error that a matrix is empty when running tests/test_truncatedGaussian.py:
Eigen::FullPivLU<Matrix> solver(G.topLeftCorner(n - k, n - k));
|
To fix that problem Jim Bosch suggests returning a vector of all zeros if n == k.
Attachments
Issue Links
- blocks
-
DM-14305 Upgrade Eigen to 3.3.4
- Done
Looks good.
For posterity, I believe the first of these problems is an Eigen bug, but the new code would be a bit better than the old code even if the bug did not exist.
The second problem was almost certainly reliance on behavior in an edge context (zero-size matrices) where Eigen did not make any guarantees.