Boost logo

Ublas :

From: Francisco J. González (fgonzalez_at_[hidden])
Date: 2006-01-25 06:02:09


Hello!

I'm trying to use ATLAS bindings in order to perform calculations with symmetric matrices.
I've written the following code:

#include "stdafx.h"
#include <boost/numeric/bindings/traits/vector_traits.hpp>
#include <boost/numeric/bindings/traits/ublas_symmetric.hpp>
#include <boost/numeric/bindings/atlas/cblas2.hpp>
#include <boost/numeric/ublas/io.hpp>

using namespace boost::numeric::ublas;
using namespace boost::numeric::bindings::atlas;

int main()
{
 vector<double> v1(3);
 v1(0) = 1; v1(1) = 0; v1(2) = 2;

 symmetric_matrix<double> sm1(3,3);
 sm1 (0,0) = 1; sm1 (0,1) = 1; sm1 (0,2) = 1;
 sm1 (1,0) = 1; sm1 (1,1) = 0; sm1 (1,2) = 2;
 sm1 (2,0) = 1; sm1 (2,1) = 2; sm1 (2,2) = 3;
 
 syr(1.0, v1, sm1);

 return 0;
}

  But I'm given an error when trying to compile:

Compiling...
Symmetrics.cpp
c:\mbslab\mbslab.foundation\boost\boost\numeric\bindings\atlas\cblas2.hpp(705) : error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
        with
        [
            x=false
        ]
        c:\mbslab\mbslab.foundation\boost\boost\numeric\bindings\atlas\cblas2.hpp(705) : see reference to class template instantiation

'boost::STATIC_ASSERTION_FAILURE<x>' being compiled
        with
        [
            x=false
        ]
        c:\mbslab\02_Pruebas\Bindings_3\Symmetrics\Symmetrics.cpp(33) : see reference to function template instantiation 'void

boost::numeric::bindings::atlas::syr<double,boost::numeric::ublas::symmetric_matrix<T>,boost::numeric::ublas::vector<T>>(const T &,const VctX &,SymmM &)'

being compiled
        with
        [
            T=double,
            VctX=boost::numeric::ublas::vector<double>,
            SymmM=boost::numeric::ublas::symmetric_matrix<double>
        ]

I've seen that this error doesn't appear if the symmetric matrix

 symmetric_matrix<double> sm1(3,3);

is replaced with

 matrix<double> m (3, 3);
 symmetric_adaptor<matrix<double>, lower> sm1 (m);

Is there any reason to enforce the user to use a symmetric_adaptor instead of a symmetric_matrix with ATLAS bindings, or maybe this is a bug?

Thank you!

Francisco J. González