[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Vectorizing a summation
From: |
Bård Skaflestad |
Subject: |
Re: Vectorizing a summation |
Date: |
Tue, 29 Jan 2013 16:56:18 +0100 |
On Tue, 2013-01-29 at 07:33 -0800, rdelgado wrote:
> The final calculation is:
>
> Distance^2 = Sum (from i, j=1...MxN) [ exp(-|Pi-Pj|) * (Xi-Yi) * (Xj-Yj) ]
>
> As you can see, I am a little confused of the definition.
Okay, so you are actually computing a type of inner product.
Distance^2 = d' * E * d
in which
d = reshape(X - Y, [], 1);
Now your task (homework?) is to compute the entries of 'E' in a
vectorised manner.
Sincerely,
--
Bård Skaflestad <address@hidden>
- Vectorizing a summation, rdelgado, 2013/01/29
- Re: Vectorizing a summation, Michael Goffioul, 2013/01/29
- Re: Vectorizing a summation, Bård Skaflestad, 2013/01/29
- Re: Vectorizing a summation, rdelgado, 2013/01/29
- Re: Vectorizing a summation, rdelgado, 2013/01/29
- Re: Vectorizing a summation, Bård Skaflestad, 2013/01/29
- Re: Vectorizing a summation, rdelgado, 2013/01/29
- Re: Vectorizing a summation,
Bård Skaflestad <=
- Re: Vectorizing a summation, rdelgado, 2013/01/29
- Re: Vectorizing a summation, Jordi Gutiérrez Hermoso, 2013/01/29
- RE: Vectorizing a summation, Bård Skaflestad, 2013/01/29
- Re: Vectorizing a summation, Jordi Gutiérrez Hermoso, 2013/01/29