|
Ublas : |
From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2007-02-26 08:33:58
symmetric_matrix is in packed format, symmetric_adaptor takes the
structure of the underlying matrix, which is dense in your case.
syr takes a dense matrix as argument, not a packed format.
Karl
Norman wrote:
>Hi everybody!
>
>I am trying to compute the outer product of two vectors using the atlas
>bindings and more precisely atlas::syr, but apparently there is a
>problem with the traits that defines the symmetric matrix, that is: it
>works with symmetric_adaptor but not with symmetric_matrix directly!
>
>Example:
>
>#include <boost/numeric/ublas/matrix.hpp>
>#include <boost/numeric/ublas/symmetric.hpp>
>
>#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
>#include <boost/numeric/bindings/traits/ublas_symmetric.hpp>
>#include <boost/numeric/bindings/traits/ublas_vector.hpp>
>#include <boost/numeric/bindings/atlas/cblas2.hpp>
>
>using namespace boost::numeric::bindings;
>using namespace boost::numeric;
>
>int main()
>{
> ublas::vector<double> v(10);
> // fill v
>
> ublas::matrix<double> matrix(10,10);
> matrix.clear();
> ublas::symmetric_adaptor< ublas::matrix<double> > sal (matrix);
>
> atlas::syr(v, sal); // OK
>
> ublas::symmetric_matrix<double> symMatrix(10,10);
> atlas::syr(v, symMatrix); // ERROR!
>}
>
>It seems that there is no typedef matrix_structure in
>boost/numeric/bindings/traits/ublas_symmetric.hpp, and that's why the
>static check fails.
>
>Any suggestion?
>
>Norman
>
>_______________________________________________
>ublas mailing list
>ublas_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/ublas
>
>
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm