From: jhrwalter (walter_at_[hidden])
Date: 2002-02-12 03:46:25
--- In boost_at_y..., Toon Knapen <toon.knapen_at_s...> wrote:
> Currently, real matrices can be assigned to complex matrices due to
> automatic conversion from double to complex. The other direction
> is not supported. To make following code work :
> numerics::matrix< std::complex< double > > complex_matrix(8,3);
> numerics::matrix< double > double_matrix(8,3);
> double_matrix = complex_matrix ;
Couldn't this be done with
double_matrix = complex_matrix.real() ;
double_matrix = numerics::detail::real(complex_matrix) ;
> I patched following files (2 patches follow):
Based on our earlier discussion
(http://groups.yahoo.com/group/boost/message/21527) we've recently
added expression templates for real(vector/matrix) and imag
(vector/matrix). You'll find the changes in boost CVS. If I've
understood your problem correctly, this should help also.
> I also noticed the use of the iterating_assign in vector_assign.
> you also consider a specialisation to use a memcpy when the
> are equal and POD types ?
This only would work if the rhs in vector_assign would be simple
(i.e. another vector). But such an assignment should be handled by
the corresponding assignment operator in the the vector class
already. IMO the first place to use memcpy as an optimization would
be in storage.h for example.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk