Gaurav Tamba
Gaurav Tamba
Could you share the exact matrix that you're trying to invert? When I try it with a singular matrix it gives me what I think should be the correct error...
I tried out _shahsaurabh0605_'s array input and the inverse function does indeed misbehave however the determinants seem to be correct. ``` ruby n = NMatrix.new(3, [1,2,3,4,5,6,7,8,9]) => [ [1, 2,...
I see, that makes sense. Apologies for missing that. Just a few doubts I had :- 1) Is the inverse calculated using Adjoint and Co-Factors or is it done by...
This line checks for singularity while inverting : ``` cpp if (matrix[k * (M + 1)] == (DType)(0)) { rb_raise(rb_eZeroDivError, "Expected Non-Singular Matrix."); } ``` So the determinant does not...
I've written a small fix that uses `NMatrix#det_exact` to reject singular matrices of size 3 or smaller. It solves the issue for this particular matrix and seems like the best...
I'll try to find more matrices that cause this problem in the meanwhile then. I suggested the above fix because in `det_exact`'s C++ implementation, the computations are hardcoded multiplications for...
`#inverse_exact` is implemented in `ext/nmatrix/math.cpp` already and only works for matrices of size 3 or 2. (Ref Version: 0.1.0.rc2 / 2014-03-12) (uppercase comments denote code blocks edited out) ``` cpp...
Here's another singular square matrix that returns an inverse :- ``` [22] pry(main)> NMatrix.new([3,3], [1.0,2.0,1.0,-2.0,-3.0,1.0,3.0,5.0,0]).det => 1.3322676295501884e-15 [23] pry(main)> NMatrix.new([3,3], [1.0,2.0,1.0,-2.0,-3.0,1.0,3.0,5.0,0]).det_exact => 0.0 [24] pry(main)> NMatrix.new([3,3], [1.0,2.0,1.0,-2.0,-3.0,1.0,3.0,5.0,0]).inverse => [ [-3.752999689475412e+15,...
@mohawkjohn I'm unable to replicate the issue as in #522 , build works fine for just the NMatrix source. Only when I try to compile SpiceRub is this error showing...
Can confirm that this problem arises when trying to compile SpiceRub with NMatrix built from source as well as from Rubygems for Rubies `2.3.0, 2.3.1`. As Prasun said, removing the...