|Re: [eigen] AutoDiffScalar|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] AutoDiffScalar
- From: Björn Piltz <bjornpiltz@xxxxxxxxxxxxxx>
- Date: Tue, 20 Oct 2009 13:58:59 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=pFmmhcdY3Tl3xJE+z+K1e7nQXGS19P7qH4teCs8il7g=; b=WEIUxlu/ASwfLRP9VYacwc0CAPoRPs//JE4aetD01v7z3N09yvLJ9AiMIYOWRMPzT7 jidplcwBaLJdVU1aLVPnaNGMz8m98oOLytdBH1E4KpVEZ4gfCQpPv997N704fPR9QnzU +uRFGbHbJ6ocXfAjOhXqlHIyP1OLhdqo7XNKE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=GTY7SzseDzEBoDxsZeUkf/E0HKrxMcaxTr/cNBT76lS43s9zD3kWeIOXpNmHQ8IiGT +3HMqahumrLs4l3+SP7f6z9yQKDY2Knrc4QWxL/xJ324AhbxlY0YScxgJtkiDsGtuoCn KablKCJfjmZrkbMQ0zMSd/VxkM4FGZlIu/5WE=
I've done some more testing and got the class to work for
fixed/dynamic/sparse cases 1st and 2nd derivatives.
There are some minor bugs in the code and I had to rewrite
CompressedStorage to handle non-POD data types(evil memcpy's).
You are obviously still working on the code, so I was wondering how I
should submit any fixes.
Clone the repository and submit a patch queue/pull request?
There is also the question of performance. For second and higher order
derivatives There is a need to differentiate the type Scalar from the
underlying primitive type. let's call it Real for now.
typedef AutoDiffScalar<Matrix<double, Dynamic, 1> > D1;
typedef AutoDiffScalar<Matrix<Fad1 , Dynamic, 1> > D2;
D1::Scalar == double
D1::Real == double
D2::Scalar == D1
D2::Real == double
Then the overloads should be
AutoDiffScalar OP AutoDiffScalar::Real
AutoDiffScalar OP AutoDiffScalar::Scalar
That should lead to resize()/zero() being called significantly less often.