P
pmatos
Hi all,
I have implemented a matrix template to suit my needs and now I've
implemented some methods for computing SVD decomposition of
Matrix<double>.
I have:
template <class T>
class Matrix {
public:
....
Line 45: void svdcmp(Matrix<double> *u, vector<double> *wvec,
Matrix<double> *v);
....
};
Line 365: template <>
Line 366: void Matrix<double>::svdcmp(Matrix<double> *u, vector<double>
*wvec, Matrix<double> *v) {
....
}
I get the following error from gcc-3.3.4:
matrix.hpp:366: error: specialization of void
Matrix<T>::svdcmp(Matrix<double>*, std::vector<double,
std::allocator<double> >*, Matrix<double>*) [with T = double] after
instantiation
matrix.hpp:366: error: prototype for `void
Matrix<T>::svdcmp(Matrix<double>*,
std::vector<double, std::allocator<double> >*, Matrix<double>*)
[with T =
double]' does not match any in class `Matrix<double>'
matrix.hpp:45: error: candidate is: void
Matrix<T>::svdcmp(Matrix<double>*,
std::vector<double, std::allocator<double> >*, Matrix<double>*)
[with T =
double]
matrix.hpp:366: error: `void Matrix<T>::svdcmp(Matrix<double>*,
std::vector<double, std::allocator<double> >*, Matrix<double>*)
[with T =
double]' and `void Matrix<T>::svdcmp(Matrix<double>*,
std::vector<double,
std::allocator<double> >*, Matrix<double>*) [with T = double]'
cannot be
overloaded
This messages can get scary... I can't get where the problem is. Any
ideas?
Cheers,
Paulo Matos
I have implemented a matrix template to suit my needs and now I've
implemented some methods for computing SVD decomposition of
Matrix<double>.
I have:
template <class T>
class Matrix {
public:
....
Line 45: void svdcmp(Matrix<double> *u, vector<double> *wvec,
Matrix<double> *v);
....
};
Line 365: template <>
Line 366: void Matrix<double>::svdcmp(Matrix<double> *u, vector<double>
*wvec, Matrix<double> *v) {
....
}
I get the following error from gcc-3.3.4:
matrix.hpp:366: error: specialization of void
Matrix<T>::svdcmp(Matrix<double>*, std::vector<double,
std::allocator<double> >*, Matrix<double>*) [with T = double] after
instantiation
matrix.hpp:366: error: prototype for `void
Matrix<T>::svdcmp(Matrix<double>*,
std::vector<double, std::allocator<double> >*, Matrix<double>*)
[with T =
double]' does not match any in class `Matrix<double>'
matrix.hpp:45: error: candidate is: void
Matrix<T>::svdcmp(Matrix<double>*,
std::vector<double, std::allocator<double> >*, Matrix<double>*)
[with T =
double]
matrix.hpp:366: error: `void Matrix<T>::svdcmp(Matrix<double>*,
std::vector<double, std::allocator<double> >*, Matrix<double>*)
[with T =
double]' and `void Matrix<T>::svdcmp(Matrix<double>*,
std::vector<double,
std::allocator<double> >*, Matrix<double>*) [with T = double]'
cannot be
overloaded
This messages can get scary... I can't get where the problem is. Any
ideas?
Cheers,
Paulo Matos