(Sorry Julio for receiving the mail twice, forgot to reply to the
On Wed, 2007-02-21 at 11:59 +0100, Julio Pastrana wrote:
> I am using the vnl_svd but when compile I get errors if I do the
> when I declare an SVD matrix and after that make a call
> to cunstruct the U,W,V matrix.
> I mean this:=20
> vnl_svd<double> svdMatrix;
> svdMatrix(A); // where a is a vnl_matrix
Yes, that won't work. You cannot defer construction of a block-scope
automatic object. Your problems appear to be closer related to C++ than
> I get Errors:
> error: no matching function for call to =E2=80=98vnl_svd<double>::vnl_sv=
> /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 default-constructor for vnl_svd<double>, you have the
choice between a copy-constructor and a constructor taking a matrix and
an optional double.
> The only way to make it work is:
> vnl_svd<double> svdMatrix(A); // where a is a vnl_matrix
Here you use the latter.
> or just
> 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?