You may wish to use the Armadillo library, which provides an inv() function
in C++, instead of writing your own. Have a look at:
http://arma.sourceforge.net/docs.html#inv
Armadillo uses LAPACK for inv(), so it will provide the same answer as
Octave. To see how inv() is implemented, have a look at Armadillo's source.
The related functions are in the "include/armadillo_bits/auxlib_meat.hpp"
file, within the Armadillo archive, which you can get from:
http://arma.sourceforge.net/download.html
ionone wrote
Also to do it simpler, here are the numbers in a 20x20 matrix in Octave
and in C++
the funny thing is that when i take the inverse in octave, ihave the exact
answer, but if i take the inverse with Lapack i have something totally
different...Not even close as before. Dunno...
--
View this message in context:
http://octave.1599824.n4.nabble.com/Octave-C-matrix-Inv-comparison-tp4655291p4655747.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.