Boost logo

Boost :

From: boost (boost_at_[hidden])
Date: 2001-12-03 17:35:09


Salut,

On Sunday 02 December 2001 10:39, walter_at_[hidden] wrote:

> I'm rather sure, that we should try to go with double d = real (hm
> (i, i)). Isn't that similar enough to double d = hm.diag (i)? There
> also is an open issue with proxies like diag, which I'll address in
> another posting.

In my old code, for HMatrix< complex<double> > ,
I had a complex array for the off-diagonal elements,
and a double* for the diagonal part. You may call it a premature
optimization, it's the opposite way, returing
complex<T>( diag(i), 0) for the value of an iterator.

> The type of the scalar in hermitean_matrix *= scalar is a template
> argument. So it should be no problem to write hm *= d;

Sure, but multiplying with a complex number is likely to be an error
and the user should be notified, ot the result should be a general
matrix, not a hermitean one, while multiplying with a real scalar
should return a hermitean matrix. Maybe the savings for dense
hermitean matrix is not worth the optimization, but for large
tri-diagonal hermitean matrices it makes a difference.

> Yes (although we're losing one of our rare users ;-).
Don't worry, I'll declare it as "user feedback" :).
 
> P.S.: Did you consider to use hermitean_adaptor<banded_matrix<> >?
Please excuse, currently I have a very limited knowledge of
the ublas library. I performed a cross-read of the documentation
only. But I will reread it.

Best wishes
Peter


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk