|[eigen] User defined reductions|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] User defined reductions
- From: Douglas Bates <bates@xxxxxxxxxxxxx>
- Date: Fri, 2 Mar 2012 08:41:53 -0600
- Authentication-results: mr.google.com; spf=pass (google.com: domain of dmbates@xxxxxxxxx designates 10.112.29.34 as permitted sender) smtp.mail=dmbates@xxxxxxxxx; dkim=pass header.i=dmbates@xxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=7Tm873hKcLpF5vLnk1O8mxvkyaNCOdkhmDR30U4J0l8=; b=pd6fn0n+o+BPYTw4YQ3F5pbLNbjnJkIxEIzzpdmx1VYOo9aH8nL9MRKkEpV+v/xzVs 7xbH9ZarjisKWU8ufB14CohxO0uj+nyN6GZFkfnokJODmy3UaJBw7DBkv8DY6l/uTLQa SMNOM7QOYx31EN7WgQLNzw7HMR7OQL0r3N7d5DAwKGpFqIwPe2Fx3DesyylRtQZAsb31 kpv9VKyrLacX4wcN05DuOmlJLgjcFLbxw8pzjwae8viBnRBe2C09hxeD6kRk21KLwDSo 2UlUkvnG+0sX35c/9R/1wPAI22CjCmC7S7kFqiDZW3duk3QePCo4RoSlDCDDC7DwHu9J BZ+Q==
In the documentation for Eigen 3.1, Tutorial page 7 on Reductions
makes a brief mention of user defined reductions and suggests looking
at the DenseBase::redux() function.
My immediate goal is to determine the column-wise medians of an array.
It would be convenient if I could write it as
but I suspect that won't be possible because the median cannot be
calculated sequentially and it appears that redux implies, well, a
reduction in the sense of MapReduce. (Evaluating the median requires
at least a partial sort of the vector.)
I can write the calculation in a loop over the columns - I just wanted
to confirm that there was not a more compact way of expressing this.