Re: [eigen] numerical differentiation |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] numerical differentiation*From*: Trevor Irons <trevorirons@xxxxxxxxx>*Date*: Sun, 27 Sep 2009 21:34:11 -0600*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=InRUfOGtMOKKi8kjvXx4DWyXYj1nXgPJVF5FAaCRpTE=; b=v6oZpdthz2RPnyFsJHwYqEgQSIDZ0/YAiC1PV9hv/aGdQwg71ltMA679twF/VqvqO+ s+EdJcoekbstXXjwMWaPTjIUHLra74qC1aDfqbDWRjAeLwn++XB3bbUbZlxzgGNYIO2I 2mLczMigBFCzevMhxYy8sT96f/kU9FWL3HOIs=*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=m190zP+0eKIipSK1XADPbRz9j1u0r5id1sZkfXcV2yfeSU81W6v1MH59Jri/FxSu7K RJfyJV8qbryz9ZFwzcYTJ3UdjmT9najYHed7+RcFp/ONAfhy0HTCvZE6nTqjMAaLh481 JCfeNV7eBk+wiJ9Ew/yTyuZLuEEJ7QQduPP4c=

Thomas: I am not much of an authority regarding Eigen, but I'll put in my two cents. Please don't construe this comment as a general Eigen comment. I've implemented second order, first and second differential operators for a 3D finite difference electromagnetic code on something sort of looking like a Yee grid. The problem is that these operators can easily become problem dependent and delivering a general differential operator seems, to me at least, impossible. The boundary conditions and dimensionality considerations should not be addressed at this level. Blitz++ has attempted to do this: http://www.oonumerics.org/blitz/manual/blitz04.html with 'stencils' but these assume 1D situations which are not general. Personally, I abandoned Blitz for this, and other reasons. I see Eigen as more of a pure math library. I see this as a strength, and I mean this in the most positive way. Implementing specific difference operators should be problem specific and honestly not too difficult. For most problems I imagine you will be working with Gael's Sparse implementation. Although this is considered a 'beta' part of Eigen I consider it a huge strength. It is beautiful and natural compared to the alternatives IMO. So I will reiterate. I consider the 'math' focused bent of Eigen a plus. Eigen should remain a ' lightweight C++ template library for linear algebra.' This is a beautiful place to stand. Trying to support every finite element/finite difference scheme that comes your way will obfuscate the goal of the project. Please correct me if I am wrong in my assumptions. By the way I have a Hankel transform algorithm that I would be willing to contribute if anyone is interested. -Trevor O__ ---- Trevor Irons, PhD Candidate c/ /'_ --- Dept. of Geophysics (*) \(*) -- Colorado School of Mines ~~~~~~~~~~~ Ph: (+01) 720.635.8218 ~~~~~~~~~~~ (tirons@xxxxxxxxx) 2009/9/27 Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>: > > > Well, anyway, i've put one in unsupported/NumericalDiff on my eigen fork, it > provides Forward and Central, with (quite basic) unit tests : > > http://bitbucket.org/orzel/eigen2- > cminpack/src/tip/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h > http://bitbucket.org/orzel/eigen2- > cminpack/src/tip/unsupported/test/NumericalDiff.cpp > > I use a template parameter 'mode' to select which one is used... and i have > two questions related to this: > > * in the code i use a switch(mode), in the hope that the compiler will > optimize this and only the relevant code will be compiled-in, and no test will > be made at run-time for the switch... can you confirm ? > > * i'm afraid that the enum for the mode is cluttering the namespace.. how > could i do better ? > > best regards, > Thomas > > > In data lunedì 28 settembre 2009 01:50:15, Thomas Capricelli ha scritto: >> Hello, >> >> Is anybody working on providing 'numerical differenciation' for eigen ? >> (http://en.wikipedia.org/wiki/Numerical_differentiation). >> >> libmv has something approaching (they use eigen) here: >> http://code.google.com/p/libmv/source/browse/trunk/src/libmv/numeric/functi >> on_derivative.h >> >> but i'm not sure how general it can be made. >> >> Ideally, there would be NumericalDifferenciation using forward difference, >> central difference, and some higher order formula >> >> Thomas >> > > -- > Thomas Capricelli <orzel@xxxxxxxxxxxxxxx> > http://www.freehackers.org/thomas > > >

**Follow-Ups**:**Re: [eigen] numerical differentiation***From:*Benoit Jacob

**Re: [eigen] numerical differentiation***From:*Rohit Garg

**Re: [eigen] numerical differentiation***From:*Thomas Capricelli

**References**:**[eigen] numerical differentiation***From:*Thomas Capricelli

**Re: [eigen] numerical differentiation***From:*Thomas Capricelli

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] numerical differentiation** - Next by Date:
**Re: [eigen] numerical differentiation** - Previous by thread:
**Re: [eigen] numerical differentiation** - Next by thread:
**Re: [eigen] numerical differentiation**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |