commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <>
Subject Re: [math] Numerical integration proposal and Linear system solving suggestion
Date Sun, 06 Nov 2005 18:25:46 GMT
Hi Vanessa,

Thanks for your interest and comments and thanks in advance for your
contributions.  See responses interspersed below.

On 11/5/05, Vanessa Sabino <> wrote:
> Hi,
> I've read in the Numerical Analysis section of the Commons Math
> documentation that numerical integration was a possible future addition, so
> I've decided to adapt my Simpson's Rule implementation to follow the same
> structure I've seen in the rest of the code of the
> org.apache.commons.math.analysis package, so that it could be added to the
> commons math if you like it.
> It can be found at

This looks good; but we have actually already implemented this and
some other numerical integration algorithms.  These have just not been
released and - sigh - we have not gotten round to updating the site
docs to reflect the progress.  Have a look in the analysis package in
svn trunk (see
for information on how to view / checkout the latest sources and don't
hesitate to ask questions if you have problems getting set up).  If
you can improve the code, documentation or test cases for these
classes, please have at it, posting any questions or comments that you
have here.
> Actually, this code was part of a whole program to find solutions for
> differential equations using the Galerkin minimization method and there is
> one more thing I've implemented in it that I think might be useful:
> I've noticed that RealMatrix in the org.apache.commons.math.linear package
> uses LU decomposition to solve the system. Although LU is good in the
> general case, there are better algorithms for specific cases, so it might be
> a good idea to have an overloaded version of solve which receives an int
> indicating which method to use.
> We could have the constants:
> CHOLESKY (much faster and more precise, but only works with Symmetric
> Positive-Definite systems - we could automatically switch to LU if it isn't
> symmetric positive-definite)
> QR_HOUSEHOLDER (QR has the advantages of orthogonal matrices and retains the
> condition number of the system, one method is better when there are a lot of
> zeros in the matrix)
> ans so on...
> What do you think?

Definitely something we would like to have and where we could use some
help, but not sure using flags / overloaded methods in RealMatrixImpl
is the way to go.  If you can figure out a way to have the "default"
impl in RealMatrixImpl adaptively determine the best (among pluggable)
algorithm(s), then that would be a good modification to make; but
otherwise, we have been thinking about separating out the
decomposition into separate classes.  If you have ideas and/or code
implementing other decompositions, this would make a good addition to
[math].  If you are interested in contributing this, the first thing
to do is discuss design options.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message