Subject: Re: [ublas] different size for matrix addition
From: Andrea Cassioli (cassioliandre_at_[hidden])
Date: 2010-06-16 04:12:34
I'd like just to point out that, strictly speaking, matrix addition is
defined only for matrices with the same dimensions. What Kraus maybe
need is to use from the very beginning with a big empty matrix and
then use subranges to add contributions inside:
using namespace boost::numeric::ublas;
I hope it helps....
Cheers, Andrea Cassioli
On Wed, Jun 16, 2010 at 9:43 AM, Kraus Philipp
> Hi David, thanks for the fast answer.
> Am 16.06.2010 um 09:34 schrieb David Bellot:
> better to give the same size to x and y, filling x with extra zeros.
> I can't do this, because I need a "grow up" for my matrix. I have a
> symmetric matrix with NxN
> elements and in a next step the matrix must grow up to (N+1)x(N+1)
> here z takes the size of y but is filled with wrong indices due to x having
> a smaller size.
> By the way, I have never been so confortable with the idea of assuming zeros
> when adding 2 matrices of different sizes :-)
> That's only a test and my elements of x and y aren't be zero in reality
> ublas mailing list
> Sent to: cassioliandre_at_[hidden]
-- Andrea Cassioli