Boost logo

Ublas :

From: Jianwei Han (tuxhan_at_[hidden])
Date: 2005-10-13 03:45:57


Hi:
    I'm trying to compile lapack sample using ublas bindings, but failed:(
    The sample is very simple:

    int main()
    {
        typedef ublas::matrix<double, ublas::column_major> mat;

        mat A(5,5);
        mat b(5, 1);

        // Construct a simple matrix
        for (int i=0; i<5; ++i)
            for (int j=0; j<5; ++j)
                A(i,j) = i<=j ? 5.0+i-j : 0.0;

        std::cout << A << std::endl;
      
        for (int i=0; i<5; ++i)
            b(i,0) = i;

        boost::numeric::bindings::lapack::gesv(A, b);

        // .... Other staff ...

        return 0;
    }

    Is there anyone successfully using ublas lapack bindings under VC 7.1?

But I get the following error (it seems something wrong with
"matrix_traits.hpp"):
>---------------------------------------------------------------------------------------------------------------------------------------------------------------

    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(102):
    error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
            with
            [
                x=false
            ]
           
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(102)
    : see reference to class template instantiation
    'boost::STATIC_ASSERTION_FAILURE<x>' being compiled
            with
            [
                x=false
            ]
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(98):
    error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
            with
            [
                x=false
            ]
           
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(98)
    : see reference to class template instantiation
    'boost::STATIC_ASSERTION_FAILURE<x>' being compiled
            with
            [
                x=false
            ]
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(102):
    error C2039: 'matrix_structure' : is not a member of
    'boost::numeric::bindings::traits::matrix_traits<M>'
            with
            [
                M=mat
            ]
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(98):
    error C2039: 'matrix_structure' : is not a member of
    'boost::numeric::bindings::traits::matrix_traits<M>'
            with
            [
                M=mat
            ]
           
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(137)
    : see reference to function template instantiation 'int
    boost::numeric::bindings::lapack::gesv<MatrA,MatrB,boost::numeric::bindings::traits::detail::array<T>>(MatrA
    &,IVec &,MatrB &)' being compiled
            with
            [
                MatrA=mat,
                MatrB=mat,
                T=int,
                IVec=boost::numeric::bindings::traits::detail::array<int>
            ]
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\traits\matrix_traits.hpp(102):
    error C2039: 'size1' : is not a member of
    'boost::numeric::bindings::traits::matrix_traits<M>'
            with
            [
                M=mat
            ]
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(98):
    error C2065: 'matrix_structure' : undeclared identifier
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(98):
    error C2146: syntax error : missing ',' before identifier
    'matrix_structure'
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(102):
    error C2146: syntax error : missing ',' before identifier
    'matrix_structure'
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(115):
    error C2893: Failed to specialize function template
    'matrix_traits<M>::pointer
    boost::numeric::bindings::traits::matrix_storage(M &)'
            With the following template arguments:
            'mat'
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(118):
    error C2893: Failed to specialize function template
    'matrix_traits<M>::pointer
    boost::numeric::bindings::traits::matrix_storage(M &)'
            With the following template arguments:
            'mat'
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(98):
    error C2955: 'boost::is_same' : use of class template requires
    template argument list
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(102):
    error C2955: 'boost::is_same' : use of class template requires
    template argument list
           
    d:\Develop\Project\Libraries\Boost_Compile\Boost_1_33\include\boost-1_33\boost\type_traits\is_same.hpp(37)
    : see declaration of 'boost::is_same'
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(98):
    error C2976: 'boost::is_same' : too few template arguments
           
    d:\Develop\Project\Libraries\Boost_Compile\Boost_1_33\include\boost-1_33\boost\type_traits\is_same.hpp(37)
    : see declaration of 'boost::is_same'
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(102):
    error C2976: 'boost::is_same' : too few template arguments
           
    d:\Develop\Project\Libraries\Boost_Compile\Boost_1_33\include\boost-1_33\boost\type_traits\is_same.hpp(37)
    : see declaration of 'boost::is_same'
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\lapack\gesv.hpp(102):
    error C3861: 'matrix_structure': identifier not found, even with
    argument-dependent lookup
    d:\Develop\Project\Libraries\boost-sandbox\boost\numeric\bindings\traits\matrix_traits.hpp(102):
    error C3861: 'size1': identifier not found, even with
    argument-dependent lookup

>---------------------------------------------------------------------------------------------------------------------------------------------------------------