Hi, All,
I'm a newbie using ublas library. I want to use the svd function in lapack. After installing boost binding lib and lapack lib for win32. I simply copied some codes from internet. However, it doesn't work and give some wired error information. Can anybody tell me how this could be solved?
codes are:
#include <boost/numeric/bindings/lapack/gesdd.hpp>
#include<boost/numeric/bindings/traits/ublas_matrix.hpp>
#include<boost/numeric/bindings/traits/ublas_vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/io.hpp>
int main()
{
using namespace boost::numeric::bindings::lapack;
using namespace boost::numeric::ublas;
matrix<double, column_major> A (4,2);
A(0,0)=2;
A(0,1)=4;
A(1,0)=1;
A(1,1)=3;
A(2,0)=0;
A(2,1)=0;
A(3,0)=0;
A(3,1)=0;
std::cout << A << std::end
l;
matrix<double, column_major> U(4,4);
matrix<double, column_major> V(2,2);
vector<double> S(2);
gesdd(A, S, U, V);
std::cout << U << std::endl;
std::cout << S << std::endl;
std::cout << V << std::endl;
return 0;
}
error information are:
1>c:\programme\boost\boost_1_36_0\boost\numeric\bindings\lapack\gesdd.hpp(180) : error C2039: 'cerr' : is not a member of 'std'
1>c:\programme\boost\boost_1_36_0\boost\numeric\bindings\lapack\gesdd.hpp(180) : error C2065: 'cerr' : undeclared identifier
1>c:\programme\boost\boost_1_36_0\boost\numeric\bindings\lapack\gesdd.hpp(194) : warning C4390: ';' : empty controlled statement found; is this the intent?
1>c:\programme\boost\boost_1_36_0\boost\numeric\bindings\lapack\gesdd.hpp(211) : warning C4390: ';' : empty controlled statement found; is this the intent?
Thanks.
Invite your mail contacts
to join your friends list with Windows Live Spaces. It's easy! Try it!