I'm using Armadillo & C++ and I'm trying to find the inverse of a Matrix, however, the inverse just returns the matrix itself.
It seems to me that there isn't any computation. Also, there are no errors thrown.
I am using the following header:
#include <armadillo>
using namespace std;
using namespace arma;
and I have been using Armadillo for a couple days and ran through several matrix manipulations that work properly.
Input:
mat A = randu<mat>(5,5);
A.print("A: ");
mat B = inv(A);
B.print("inv(A): ");
Output:
A:
0.0013 0.1741 0.9885 0.1662 0.8760
0.1933 0.7105 0.1191 0.4508 0.9559
0.5850 0.3040 0.0089 0.0571 0.5393
0.3503 0.0914 0.5317 0.7833 0.4621
0.8228 0.1473 0.6018 0.5199 0.8622
inv(A):
0.0013 0.1741 0.9885 0.1662 0.8760
0.1933 0.7105 0.1191 0.4508 0.9559
0.5850 0.3040 0.0089 0.0571 0.5393
0.3503 0.0914 0.5317 0.7833 0.4621
0.8228 0.1473 0.6018 0.5199 0.8622
Process finished with exit code 0
Question:
Why isn't inv(ofAMatrix) working, any hints or ideas? Thanks!