Re: [eigen] Qt's container support |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Qt's container support
- From: "Gael Guennebaud" <gael.guennebaud@xxxxxxxxx>
- Date: Tue, 20 Jan 2009 13:12:48 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=+0fDGyys4FjQJ9DRtgGJrrKyjRUBhbxSPiHra7ojPDs=; b=ELBHDCpP/ZkpTzFPNWiOl+E2QR9dz5B8lSJk3ZbcwgGTwvdKNoXbQcdhxCiLruDGjR d0VTbE2kYtxcGOql5JxG/lLUAzw0ceDA8X74voa9bxOcdsNCV4K1S8iUKa4O6g2zYOMm Px0oUkMEwwV4JhMt99H9KojLxB1mBUrDuXA9c=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=n4nJR0euWF/B2sNK69lCBhaIbI72Jmd9n0KqaOXhI9M4WFqJGSURzYh7Tn7JBRoSy0 C22kIClu8C7OOV2TC/YwilSH1qU0JL0zMF8mf13GLxTCg8JNL9TiNGaASVMGVIg1wLkc esItJ9wRMCFUr4IUyyboyD0TtDZdEaqZFiZt4=
On Tue, Jan 20, 2009 at 12:46 PM, Alex Stapleton
<alex.stapleton@xxxxxxxxxxxxx> wrote:
> 2009/1/20 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
>> Hi all,
>>
>> I think that being able to store Eigen's matrices in Qt's containers
>> is very important (especially QVector<>), and just like std::vector,
>> there are a couple of issues:
>
>> Issue 2:
>> the second problem is to enforce QVector to allocate aligned memory
>> buffers. Fortunately, Qt's developers had the good idea to define
>> wrapper functions around malloc/free/realloc called qMalloc, qFree
>> etc.
>> So the workaround is simply to redefine these functions to call
>> ei_align_malloc. I added a Eigen/QtAlignedMalloc header which exactly
>> does that (I'll commit it once the next issue will be solved).
>> => PROBLEM SOLVED
>
> I am not a Qt person in general so please correct me if I am wrong but
> wont this will result in *all* QVectors using aligned allocation?
yes you are right, but I think that's harmless, several platforms
already have an aligned malloc anyway...
another possibility: since Qt is going to be LGPL, we can pick QVector
implementation code to make a complete specialization of
QVector<Eigen::Matrix>, and then we can elegantly fix all the three
issues right away (and perhaps more, I have not checked all methods
!). The obvious drawback is code duplication and so we'd have to watch
the patches made to qvector.h which are very unlikely to happen
anyway, so why not ?