> I expected the inversed matrix of A from
> vcl_cerr << vnl_matrix_inverse<double>(A);
> But the output (overloaded << operator) gives me U, W, and V,
> the singular value decomposition result plus rank.
> Is it intended for vnl_matrix_inverse template class?
This is maybe a bit unexpected, but indeed "works as designed".
A short word of explanation:
 the vnl_matrix_inverse<T> class derives from vnl_svd<T>.
This explains the above behaviour, since you are calling the "<<" operator of vnl_svd<double>.
 wherever you use a vnl_matrix_inverse<T> in a vnl_matrix<T> context, it behaves really as the inverse itself, not (U,W,V), since in that case vnl_svd's inverse() method is called automatically.
Example: vnl_matrix<double> inv = vnl_matrix_inverse<double>(A);
vcl_cerr << inv;
 this is even more the case when using vnl_matrix_inverse<double>(A) directly in a multiplication, as in
x = vnl_matrix_inverse<double>(A) * b;
(for b either matrix or vector) which is actually implemented as
x = vnl_svd<double>(A).solve(b);
This explains the choice for vnl_matrix_inverse as a *class* derived from vnl_svd instead of just a *function* using vnl_svd. So it's a "convenience class", for code readablility purposes.
 When your matrix is "small", i.e., 2x2, 3x3, or 4x4, you should consider using the much faster *function*
vnl_inverse(A)
which does not use vnl_svd (and hence does not need lib vnl_algo).
This holds for both vnl_matrix<T> & vnl_matrix_fixed<T,n,n> with n<=4.
 Peter.
__________________________________________________________
Låna pengar utan säkerhet. Jämför vilkor online hos Kelkoo.
http://www.kelkoo.se/c100390123lanutansakerhet.html?partnerId=96915014
