|Re: [eigen] Multi Dimensional Arrays|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Multi Dimensional Arrays
- From: Jim Bosch <talljimbo@xxxxxxxxx>
- Date: Tue, 08 Feb 2011 18:30:51 -0800
- Cc: Andy Somogyi <andy.somogyi@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=bUlo3ex9PHwqZKKt+VApT8j5ikg7G2rK8A6cKc8yKxQ=; b=jCeZ0E2jBg94Y28Wg/21mpXJ/ehAWQ46iicSUkypWUD+ILbPzUBohwIYV7WeAOhf0j daQc6ocrlpxW93iYO1sBCQeizbvw/jxsgh4Gmi9myhAID+ye2wjgyjnu8d4rBWiLtfmQ 8rfyT8JUpsMX6Siwlu+lPoSY1IHPvYgJbA5j4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=ThRkjoGiOQ+u8JI1n3xl4TwS32rz1e31ttQH1/MOV+N/ekanuA7tujLehS29iDfLPD e2qfJksIpw6eix/CKE1hNslzLVMNx2AbL1lkcjYOV/6/iWRt2692lmSdO77Oxu6wRvdn 3smG+PlXmVUdqJ1iPSNcPcpQO5xhlndE9opXE=
On 02/08/2011 05:13 PM, Andy Somogyi wrote:
From what I understand, the only way to handle multi dimensional
arrays with Eigen is something along the lines of
Array<Array<double,Dynamic,Dynamic> ,Dynamic, Dynamic> ...
This is really far from ideal as it really is an array of arrays
(separate memory blocks). Has there been any talk of merging in some
multi dimensional support to Array, say from the now defunct blitz++
code, or adding it a new?
That's not entirely true; while Eigen is limited to 2 dimensions,
Eigen::Matrix is not an array of arrays - they're allocated as a single
I really really really just want to use A SINGLE LIBRARY, and have to
rely on Eigen for linear algebra, and boost multi-array or blitz++
for multi-dimensional arrays. What would be nice is to have a
multi-dim array, be able to grab a dimension or sub-array out of it,
and use it directly as an Eigen Array / Matrix.
I feel your pain, and I've been working on a multidimensional array
library that's designed to let Eigen do all the matrix math:
While that isn't the complete solution solution you're looking for, at
least it's a clear division of labor.
Essentially, while you can make an ndarray::Array of any dimension, you
can view 1- or 2-dimensional subarrays of those as Eigen-conforming
objects, or construct ndarray views into Eigen::Matrix objects.
That won't get you all the way there if your main application is
multidimensional tensor contractions, but it does provide a nice
interface for interfacing with Python/Numpy and moving Eigen-compatible
objects around with reference counting instead of deep copies.