Re: [eigen] numerical differentiation

[ Thread Index | Date Index | More Archives ]


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: 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.


   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 :
> cminpack/src/tip/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h
> 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 ?
>> (
>> libmv has something approaching (they use eigen) here:
>> 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>

Mail converted by MHonArc 2.6.19+