Boost logo

Boost Users :

Subject: Re: [Boost-users] ublas list broken?
From: Maik Beckmann (beckmann.maik_at_[hidden])
Date: 2008-10-19 13:03:16


Here is an example:

<quote>

This is the Postfix program at host wowbagger.osl.iu.edu.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                       The Postfix program

<ublas_at_[hidden]>: mail forwarding loop for ublas_at_[hidden]

Final-Recipient: rfc822; ublas_at_[hidden]
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; mail forwarding loop for ublas_at_[hidden]

---------- Weitergeleitete Nachricht ----------
From: "Maik Beckmann" <beckmann.maik_at_[hidden]>
To: "ublas mailing list" <ublas_at_[hidden]>
Date: Sun, 19 Oct 2008 18:54:39 +0200
Subject: Re: [ublas] When I can not use two prec_prod's?
2008/10/19 Peng Yu <pengyu.ut_at_[hidden]>:
> #include <boost/numeric/ublas/matrix.hpp>
> #include <boost/numeric/ublas/io.hpp>
>
> int main () {
> boost::numeric::ublas::matrix<double> m(2, 2);
>
> m(0, 0) = 1;
> m(1, 0) = 2;
> m(0, 1) = 3;
> m(1, 1) = 4;
>
> std::cout << prec_prod(m, prec_prod(m, m)) << std::endl;//error
> }
>

Hello Peng,

$ g++ test.cpp
gives
{{{
/usr/include/boost/numeric/ublas/matrix_expression.hpp:4839: error:
invalid application of 'sizeof' to incomplete type
'boost::STATIC_ASSERTION_FAILURE<false>'
test.cpp:12: instantiated from here
}}}
where /usr/include/boost/numeric/ublas/matrix_expression.hpp:
{{{
4837_ prec_prod (const matrix_expression<E1> &e1,
4838: const matrix_expression<E2> &e2) {
4839: BOOST_STATIC_ASSERT (E1::complexity == 0 && E2::complexity == 0);
...
}}}

The problem is the nested prec_cond call. This
{{{
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>

int main () {
 typedef boost::numeric::ublas::matrix<double> mx_type;
 mx_type m(2, 2);

 m(0, 0) = 1;
 m(1, 0) = 2;
 m(0, 1) = 3;
 m(1, 1) = 4;

 std::cout << prec_prod(m, mx_type(prec_prod(m, m))) << std::endl;
}
}}}
works, since mx_type(prec_prod(m, m)) forces the matrix expression
returned by prec_prod(m, m) to be evaluated to mx_type, which in turn
causes E2::complexity == 0.

Regards,
 -- Maik
_______________________________________________
ublas mailing list
ublas_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/ublas

</quote>

But the message has been received:
 - http://lists.boost.org/MailArchives/ublas/2008/10/3024.php

-- Maik


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net