The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Efficiently computing large numbers of vector norms
Replies: 16   Last Post: Nov 15, 2012 8:32 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Matt J

Posts: 4,997
Registered: 11/28/09
Re: Efficiently computing large numbers of vector norms
Posted: Nov 9, 2012 9:49 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Matt J" wrote in message <k7hksg$etp$>...
> In your case, this would lead to
> result = sum( abs( KronProd(A2',A1')*X2 ).^2 , 2) ;

Make that

result = sum( abs( KronProd({A2',A1'})*X2 ).^2 , 2) ;

> then the whole thing gets even simpler/faster
> rownorms = @(M) sum(abs(M).^2);
> result=kron(rownorms(A2'*XX2) , rownorms(A1'*XX1));

And make that

rownorms = @(M) sum(abs(M).^2 , 2);

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.