Re: [uBlas] Fastest way to change sing of matrix

dariomt <[email protected]>
Newsgroups gmane.comp.lib.boost.ublas
Message-ID <[email protected]>
oswin krause <oswin.krause <at> ruhr-uni-bochum.de> writes:
>     Hi,
>       there is unfortunately only little information about A (e.g. is A
>       big? is it dense? sparse? is it a matrix, bounded_matrix or 
>       c_matrixr?).

I didn't say anything about the type, I would expect a single way to be
fastest for all matrix types.


>       As i assume A to be a small matrix:

I did say it is very large.


>       noalias(A)=-A
>       fixes everything.

Doesn't that suggestion break the assumptions of noalias? From the docs: "If
you know for sure that the left hand expression and the right hand
expression have no common storage". Well, the lhs and the rhs both reference
the same matrix object!

How is that guaranteed to work?
     
>           
>             Hi list,
>               I need to change the sign of each element in a (very
>               large) matrix.
> 
>             I know a way that is very slow
> 
>             A = -A;
> 
>           What is the fastest way to do this?
> 
>         Thanks in Advance
> 


_______________________________________________
ublas mailing list
[email protected]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.