From: Markus Moll <markus.moll@es...>  20070221 11:56:32

Hi (Sorry Julio for receiving the mail twice, forgot to reply to the mailing list) On Wed, 20070221 at 11:59 +0100, Julio Pastrana wrote: > I am using the vnl_svd but when compile I get errors if I do the > following: >=20 > when I declare an SVD matrix and after that make a call > to cunstruct the U,W,V matrix. > I mean this:=20 >=20 > vnl_svd<double> svdMatrix; > svdMatrix(A); // where a is a vnl_matrix Yes, that won't work. You cannot defer construction of a blockscope automatic object. Your problems appear to be closer related to C++ than to VXL. > I get Errors: > error: no matching function for call to =E2=80=98vnl_svd<double>::vnl_sv= d()=E2=80=99 > /usr/local/include/vxl/core/vnl/algo/vnl_svd.h:193: note: candidates > are: vnl_svd<T>::vnl_svd(const vnl_svd<T>&) [with T =3D double] > /usr/local/include/vxl/core/vnl/algo/vnl_svd.h:83: note: > vnl_svd<T>::vnl_svd(const vnl_matrix<T>&, double) [with T =3D double] I.e., there is no defaultconstructor for vnl_svd<double>, you have the choice between a copyconstructor and a constructor taking a matrix and an optional double. > The only way to make it work is: >=20 > vnl_svd<double> svdMatrix(A); // where a is a vnl_matrix Here you use the latter. >=20 > or just > =20 > vnl_svd<double> svdMatrix();=20 Watch out, here you declare a function named svdMatrix. This is probably not what you want.=20 > My question is .... The call to the constructor has to be at the same > time when declaring the svd_matrix?? is there a way to declare and > then solve? This sounds a bit confused. In C++, the constructor of an object with automatic storage duration is invoked when the object is defined.=20 >From my understanding, vnl_svd is meant to be a decomposition of some matrix, so every vnl_svd object has to be initialized with some matrix in order to have a sane state. Maybe you could explain your problem? Regards Markus Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm 