commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <>
Subject [math] Solving equations without functions -- "bean equations"
Date Sat, 31 May 2003 06:31:48 GMT
It occurs to me now that we might be able to support an alternative 
"bean-oriented" interface for rootfinding by using bean introspection. 
Using BeanUtils' MethodUtils and PropertyUtils, we should be able to 
support solving "bean equations", roughly as as in the following example:

double breakEven = 

The idea here is that we solve the "bean equation"

    revenueBean.estimateRevenue(x) = costBean.getConstraint();

for x, using lower and upper as initial brackets.  We could of course 
allow just one initial value as well and expand it to a bracket.  I 
suppose that we could also solve

    revenueBean.estimateRevenue(x) = costBean.getConstraint(x);

but we would obviously need a way to distinguish these. I have not 
actually implemented any of this, so I might be missing something 
crucial; but it seems to me that we should be able to dynamically 
construct the equivalent of a RealUnivariateFunction to use in 
rootfinding by using method and property introspection on the beans.

The more I think about it, the more I think that Tim's idea of using 
BeanUtils to enable math functionality for beans without forcing the 
beans to implement special interfaces is going to be very important to us.

Just as I think we still need to provide the array-based Univariate 
implementations, along with BeanListUnivariateImpl, I think we still 
need to provide the RealUnivariateFunction interface as well for 
rootfinding, for the applications that fit more nicely into that 
structure or for the users who are squeamish about so much introspection 
(almost never an real issue, but often a religious one). I suspect that 
the bean-oriented interface would be more convenient to use, however, 
for many applications.

Thoughts? Does this make sense? Am I missing something obvious? I will 
play with it a little once we have the core rootfinding framework in place.


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

View raw message