Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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,996
Registered: 11/28/09
Re: Efficiently computing large numbers of vector norms
Posted: Nov 13, 2012 1:45 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Harry Commin" wrote in message <k7u34n$7fs$1@newscl01ah.mathworks.com>...
> > It would be interesting to know the data dimensions you're working with.
>
> For my tests, I had:
>
> N1 = 3;
> N2 = 4;
> Q1 = 180;
> Q2 = 63;
>
> If I increase N1 and/or N2, the improvement (due to KronProd) decreases.

==============


I would definitely expect increasing improvement with increasing N1 and N2 and my tests below confirm this.

N1 = 100;
N2 = 100;
Q1 = 180;
Q2 = 63;


At1=rand(Q1,N1)+i*rand(Q1,N1);
At2=rand(Q2,N2)+i*rand(Q2,N2);

K=kron(At1,At2);
Kop=KronProd({At2,At1});

nx=size(K,2);
X2=rand(nx,nx);

tic;
result = sum( abs( K*X2 ).^2 , 2) ;
toc;
%Elapsed time is 124.422905 seconds.

tic;
result = sum( abs( Kop*X2 ).^2 , 2) ;
toc;
%Elapsed time is 10.947491 seconds.



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.