Re: [eigen] (vec1*vec2.transpose())*vec3 on 2.0.5/6 |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] (vec1*vec2.transpose())*vec3 on 2.0.5/6
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 30 Sep 2009 10:35:37 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=dqYRghcNHz4g7qDfmxOtXlLg8pxP/nR81gaKYGeLoAc=; b=gvHbX7Pi1f8AwMAu1BjSHnN7BO9zJ/yZP3r3ZrN/Y66ylb/utO7BCEXrP0qq+3nzZp ht1YxARs0WyGJ2POZz8TYBkQh5sGFHA7OweBzbLlefbqLc76CaLaHH4gQa2A6Mjm9I3s MvrdWZz35egDJKDk8+bAUVXjmfA+h9cSfxrZw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ew5zAQdPfvxaCSN5zCOJ24sNmgxxgN5OXOvb5MWEdIYkNEWKTjLnumt2ZPr81eshJh 22h7kY+FFusxhivu6x/di9n1fk5eN3BU7pfK7AEdZt+e50DMRl2rtMBmFElBP9rMILFe /6TDPOL2MU9eIHhlfsUDRqx/Z4kAoZ2g2qvXU=
2009/9/30 Márton Danóczy <marton78@xxxxxxxxx>:
> 2009/9/30 Rhys Ulerich <rhys.ulerich@xxxxxxxxx>:
>> When you're investigating, would you please also check that it behaves
>> correctly for
>> (vec1*vec1.transpose())*vec2
>
> Just out of curiosity: why would anyone need to compute this kind of
> product? The scalar product in vec1*(vec1.dot(vec2)) would be much
> faster than forming the rank-1 matrix.
That's correct actually!
Notice that the rank 1 matrix isn't actually formed, only the abstract
expression. Still: doing
(vec1*vec1.transpose())*vec2
takes 3n^2-n operations, while doing
vec1*(vec1.dot(vec2))
takes 3n-1 operations.
So you're right it's much faster ;)
I guess that we still had to make sure that the other compiled... but
as you suggest,
> Or does Eigen automatically
> compute products the fastest way, no matter how bracketing is done?
It wouldn't be a bad idea to reorder this automatically so that one
can seamlessly write
vec1*vec1.transpose()*vec2
Benoit