|
Ublas : |
Subject: [ublas] LAPACK/BLAS bindings
From: Peter Man (plwm2_at_[hidden])
Date: 2010-06-06 10:05:19
Dear all,
Would anyone know what the problem with the following code is?
///////////////////////////////////////////////////////////////////////////////////////////////////////////
Code 1 - inside a function called "void UTILS::LinAlgBasicTest()"
///////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace ublas = boost::numeric::ublas;
namespace blas = boost::numeric::bindings::blas;
namespace lapack = boost::numeric::bindings::lapack;
ublas::vector<double> uv (18);
for(unsigned int i=0; i<uv.size(); ++i)
{
uv(i) = i;
}
std::cout << blas::nrm2(uv) << std::endl;
ublas::vector_range<ublas::vector<double> > ur (uv, ublas::range (3, 15));
std::cout << blas::nrm2(ur) << std::endl;
This produces errors (in cygwin's g++):
/cygdrive/c/Program
Files/boost/boost_1_42/boost/numeric/bindings/detail/property_map.hpp:
In instantiation of
boost::numeric::bindings::detail::property_at<boost::numeric::ublas::vector_range<boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
> >, boost::numeric::bindings::tag::value_type>:
/cygdrive/c/Program
Files/boost/boost_1_42/boost/numeric/bindings/value_type.hpp:20:
instantiated from
boost::numeric::bindings::value_type<boost::numeric::ublas::vector_range<boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
> > >
./source/utils_linalgtest.cpp:224: instantiated from here
/cygdrive/c/Program
Files/boost/boost_1_42/boost/numeric/bindings/detail/property_map.hpp:30: error:
no type named property_map in struct
boost::numeric::bindings::detail::adaptor_access<boost::numeric::ublas::vector_range<boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
> >, void>
./source/utils_linalgtest.cpp: In function void UTILS::LinAlgBasicTest():
./source/utils_linalgtest.cpp:224: error: no matching function for call
to
nrm2(boost::numeric::ublas::vector_range<boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
> >&)
or (in Microsoft Visual Studio 2010):
c:\program
files\boost\boost_1_42\boost\numeric\bindings\detail\property_map.hpp(30):
error C2039: 'property_map' : is not a member of
'boost::numeric::bindings::detail::adaptor_access<T>'
1> with
1> [
1>
T=boost::numeric::ublas::vector_range<boost::numeric::ublas::vector<double,boost::numeric::ublas::unbounded_array<double>>>
1> ]
1> c:\program
files\boost\boost_1_42\boost\numeric\bindings\value_type.hpp(20) : see
reference to class template instantiation
'boost::numeric::bindings::detail::property_at<T,Key>' being compiled
1> with
1> [
1>
T=boost::numeric::ublas::vector_range<boost::numeric::ublas::vector<double,boost::numeric::ublas::unbounded_array<double>>>,
1> Key=boost::numeric::bindings::tag::value_type
1> ]
1> c:\users\george\desktop\wholeproject
new\utils\source\utils_linalgtest.cpp(224) : see reference to class
template instantiation 'boost::numeric::bindings::value_type<T>' being
compiled
1> with
1> [
1>
T=boost::numeric::ublas::vector_range<boost::numeric::ublas::vector<double,boost::numeric::ublas::unbounded_array<double>>>
1> ]
1>c:\program
files\boost\boost_1_42\boost\numeric\bindings\detail\property_map.hpp(30):
error C2146: syntax error : missing ',' before identifier 'property_map'
1>c:\program
files\boost\boost_1_42\boost\numeric\bindings\detail\property_map.hpp(30):
error C2065: 'property_map' : undeclared identifier
1>c:\program
files\boost\boost_1_42\boost\numeric\bindings\detail\property_map.hpp(30):
error C2955: 'boost::mpl::at' : use of class template requires template
argument list
1> c:\program files\boost\boost_1_42\boost\mpl\at.hpp(32) : see
declaration of 'boost::mpl::at'
1>c:\program
files\boost\boost_1_42\boost\numeric\bindings\detail\property_map.hpp(30):
error C2039: 'type' : is not a member of 'boost::mpl::at'
1> c:\program files\boost\boost_1_42\boost\mpl\at.hpp(32) : see
declaration of 'boost::mpl::at'
1>c:\users\george\desktop\wholeproject
new\utils\source\utils_linalgtest.cpp(224): error C2893: Failed to
specialize function template
'nrm2_impl<bindings::value_type<T>::type>::result_type
boost::numeric::bindings::blas::nrm2(const VectorX &)'
1> With the following template arguments:
1> 'boost::numeric::ublas::vector_range<V>'
1> with
1> [
1>
V=boost::numeric::ublas::vector<double,boost::numeric::ublas::unbounded_array<double>>
1> ]
Also, when trying the ublas_getri.cc file in libs/numeric/bindings/atlas
folder, it runs, but produces the following runtime error (in cygwin g++):
assertion "bindings::size(work.select(real_type())) >= min_size_work(
bindings::size_column(a) )" failed: file "/cygdrive/c/Program
Files/boost/boost_1_42/boost/numeric/bindings/lapack/computational/getri.hpp",
line 202, function: static ptrdiff_t
boost::numeric::bindings::lapack::getri_impl<Value, typename
boost::enable_if<boost::numeric::bindings::is_real<T>,
void>::type>::invoke(MatrixA&, const VectorIPIV&,
boost::numeric::bindings::lapack::detail::workspace1<WORK>) [with
MatrixA = boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<unsigned int, int>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, VectorIPIV = std::vector<int, std::allocator<int> >, WORK =
boost::numeric::bindings::detail::array<double>, Value = double]
Aborted (core dumped)
Thank you very much in advance, and I apologise for the long email!!
Peter