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 ]
Harry Commin

Posts: 11
Registered: 10/8/10
Efficiently computing large numbers of vector norms
Posted: Nov 7, 2012 4:58 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I am frequently faced with problems where I need to find the norm (squared) of row vectors having the following structure:


where A is (N x Q) complex, and solutions must be found for all i = 1,2,...,Q. Doing this efficiently turns out to be extraordinarily important in my code. In this simple case, I find the following to be pretty swift (compared to a for loop):


However, I become stumped with a slightly more complicated case:


where now a fast solution is needed for all i = 1,2,...,Q1 and j = 1,2,...,Q2. Here, I resort to:

Z = zeros(Q1,Q2);
for j = 1:Q2
Z(:,j) = sum(abs(kron(A1,A2(:,j))'*X2).^2,2);

Is there a neat way to speed this up? Is there a way to further speed up my sum(abs(A'*X).^2,2)? Efficiency really is critical here!

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.