c++ - Armadillo: matrix.i(true) vs matrix.i()—one is a logic error, the other isn't? -
the input matrix looks this:
[ 1 2 4 ] [ 4 5 6 ] [ 7 8 9 ]
(mat1)
wolfram alpha confirms has inverse. using matrix.i()
(which means uses fast invert) yields approximately correct result of
[ 1.0000 -4.6667 2.6667 ] [ -1.0000 6.3333 -3.3333 ] [ 1.0000 -2.0000 1.0000 ]
(mat2)
but turning slow mode on writing matrix.i(true)
causes throw logic_error
. any reason that?
reason tried turn on multiplying inverted matrix vector of
[ 15 ] [ 24 ] [ 35 ]
(mat3)
yields incorrect answer of
[ -3.6667 ] [ 20.3333 ] [ 2.0000 ]
(mat4)
when should this, or
[ -3.6667 ] [ 5.3333 ] [ 2.0000 ]
(mat5)
checking before multiplication confirmed input (mat3) correct, leading me believe fast inverse created incorrect matrix output (mat4 instead of mat5).
... think of it, fast inverse correct , there no reason not correct... quandary.
the main question is, written above,
any reason matrix.i(true)
causes logic error while matrix.i()
doesn't?
Comments
Post a Comment