On 4/15/08, Luc Maisonobe <Luc.Maisonobe@free.fr> wrote:
> Niall Pemberton wrote:
>
> > the current code requires Java 1.6 to build.
> >
>
> Yes, I missed that, thanks for reporting it.
>
> The reason is that several methods have been introduced in Math and
> StrictMath as of java 6 (nextAfter, nextUp, scalb, copysign) and I use some
> of them to implement their derivative.
>
> I have to find a way to either find a way to use an alternative
> implementation and support them regardless of the version of java used to
> build [nabla] itself, or use conditional compilation (using profiles
> activated by jdk version in maven2) to include support for these functions
> for derivatives only if they are available in the version of java used to
> build [nabla].
>
nextAfter is available in o.a.c.math.MathUtils and the others could
easily be implemented, but IIUC what is going on here, the use is only
required for manipulation of DifferentialPairs, not byte code analysis
or differentiation per se (do I have this right?). Assuming that is
correct, I would say the maven profile idea above should be OK.
I have a couple of comments / questions.
1. Some bigger picture documentation of how things work would make it
easier for people to jump in and contribute. An example or two from
the test classes in the xdocs would help with usage and an overview of
how the automatic package works in either package javadoc, a Wiki page
or xdoc somewhere would help.
2. This may be because I have not yet understood the big picture, but
I wonder what differentiability really means here. What I mean is
under what conditions do you know that nabla produces something that
approximates what can reasonably be called a derivative and what
happens at singularities or points where right and lefthand
derivatives both exist and are different. Looks like you made a
decision in NablaMath.abs, for example, that assigns the righthand
value at 0. Why is this "correct"? The statement "differentiation
can be computed even at domain boundaries" makes me worry about this.
This can probably be gleaned from the literature on symbolic diff and
I am just ignorant of it, but it would be good to get a recursive
definition of the nabla differentiation operator and some theorems
about its relationship to derivatives of recursive functions built
from floating point primitives. Mabye some references in the
overview?
3. I had a hard time keeping track of u0, u1 as property names in
DifferentialPair. I am not sure what better names would be, but it
might be good to think of better ones.
More to come. I will add myself and fix a few typos and help with
docs, etc. once I understand the code better.
Phil

To unsubscribe, email: devunsubscribe@commons.apache.org
For additional commands, email: devhelp@commons.apache.org
