Re: [eigen] array functionality... |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: Eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] array functionality...
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Tue, 9 Mar 2010 12:08:46 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=wQdZKenKC4/yBNLJrR3ljBqnoCWI4S2d+k0Rx38H7TU=; b=pSCn3BfNvgo1rYz+H50I/OX207b9TT+zO2Z3EuQiEDJEdAVnqrQP7y5exXx3u0AVyE 5SiA23hQAc3izR+Vll0vqvRFqZj1FWVC1rDSC+6XPwFsrM6wz+krtVrtHBrDn5/AACH5 w9i/dymC+VtHswSdmkZBnQkL9kVsSbSe/IqWw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=IS8SaiAJvFUAVN4X1dujhIpcjrKFQnkr/7dXJtMAXMe9fBiYeaFrHuhcI4qPhGoPxP iUSIm4ratWNlojnEcziUoVpHHbnggU58nl2qcv195EqjJd+BPI7c2BlFg4nOoYX2H1+F XuHE18S2oKy6YPg3TezXcU69+/Z/Tgrtlt4dU=
On Tue, Mar 9, 2010 at 12:05 PM, Hauke Heibel
<hauke.heibel@xxxxxxxxxxxxxx> wrote:
> I need to verify this, but it feels as if the replicate implementation
> is currently (at least on MSVC) slower than a hand crafted for loop
> like:
>
> for (int i=0; i<size; ++i)
> norms(i) = (x - y.col()).matrix().squaredNorm();
Just did that and the Eigen-fied version
norms = (x.replicate(1,y.cols()) - y).matrix().squaredNorm()
is way slower...
I probably need to look at the assembly.
- Hauke