Boost logo

Ublas :

From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2006-01-25 06:12:47


Francisco J. González wrote:

> 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?

Actually, _SYR assumes a square matrix argument, that is the reason.
symmetric_matrix is in packed format and cannot be used.

Karl

>
> Thank you!
>
> Francisco J. González
>
>------------------------------------------------------------------------
>
>_______________________________________________
>ublas mailing list
>ublas_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/ublas
>
>

-- 
==============================================
Look at our unique training program and
Register on-line at http://www.fft.be/?id=35
----------------------------------------------
Karl Meerbergen
Free Field Technologies
16 place de l'Université
B-1348 Louvain-la-Neuve - BELGIUM
Company Phone:  +32 10 45 12 26
Company Fax:    +32 10 45 46 26
Mobile Phone:   +32 474 26 66 59
Home Phone:     +32 2 306 38 10
mailto:Karl.Meerbergen_at_[hidden]
http://www.fft.be
============================================
NEW ADDRESS FROM FEBRUARY 1st ONWARD:
Axis Park Louvain-la-Neuve
rue Emile Francqui, 1
B-1435 Mont-Saint Guibert - BELGIUM
Same telephone, same fax, same e-mail
============================================