* Fix compilation error
* Add implementation of pseudo-inverse
The implementation is based on this publication:
Courrieu, P. (2008). Fast Computation of Moore-Penrose Inverse Matrices, 8(2), 25–29. http://arxiv.org/abs/0804.4809
It is a fully templated implementation to guaranty type correctness.
* Add tests for pseudoinverse
* Apply suggestions from code review
Co-Authored-By: Mathieu Bresciani <brescianimathieu@gmail.com>
* Adapt fullRankCholesky tolerance to type
* Add pseudoinverse test with effectiveness matrix
* Fix coverage
* Fix rebase issue
* Fix SquareMatrix test, add null Matrix test
Before the print function was just implicitly called somewhere
and that's why we had 100% line coverage. With this we have actual
testing of the functions.
The original implementation with no wrapping on size_t is more readable
but the compiler errors with:
internal compiler error: in trunc_int_for_mode, at explow.c:55
I read up and it's apparently a loop optimization problem.
Inspired by https://stackoverflow.com/a/27224697/6326048
I used a far less readable implementation that works fine and
wrote a comment to explain it.
I had a look at the implementation of `slice`, and I found it odd that it doesn't have a copy loop. The current implementation does a raw memcpy of the underlying contiguous row-major data. As far as I can tell, this could only slice along rows. Interestingly, I found that the tests only tested for slicing along rows, so this bug would go unnoticed.
I added some tests that checks slicing along columns also. I have a feeling this would break, and we need to fix the implementation of `slice`. However I could be wrong, and hence I'm submitting these tests first to verify.