|
Boost : |
From: Dan Mcleran (dan.mcleran_at_[hidden])
Date: 2002-10-22 12:16:49
"Martin Weiser" <weiser_at_[hidden]> wrote in message
news:200210221731.46867.weiser_at_zib.de...
On Dienstag, 22. Oktober 2002 16:56, Dan Mcleran wrote:
> "Neal D. Becker" <nbecker_at_[hidden]> wrote in message
> news:x88r8eiedu6.fsf_at_rpppc1.md.hns.com...
>
> > My main interest is integrate a function. I'm not sure about
> > integrating a set of pre-computed data. In that case, different
> > algorithms might be preferred, so there may be no real need to have a
> > common interface with the function integration.
> >
> > I don't understand what the parameters you refer to are.
>
> In the case of integrating over a function, f(x), vParams is a
> container containing the x values that you wish to pass into f(x). I
> was proposing that f(x) would be a functor, or function pointer that
> the user would provide along with a container of x values.
It appears to me that many users of such an interface do not have the
experience to select suitable integration points x. And even the
experienced ones may prefer the nodes selected by a carefully crafted
integration code - it's easier to use and the efficiency/accuracy is
probably not worse.
An easy to use interface would be something along the line of
area = integral(xmin,xmax,Func,tolerance)
with a user-specified accuracy in form of a relative or absolute
tolerance. Maybe a variant with user-specified number of function
evaluations could be useful. Behind this interface, an adaptive
integration code should do the work, in particular selecting integration
nodes and integration order. I'd suggest a Romberg algorithm.
More specific codes (like the trapezoidal rule, Simpson's rule, Gauß
formulae, ...) can be made available by expert interfaces.
What would definitely be useful is an input parameter that gets a
collection of known discontinuities. Using such a-priori information
tremendously improves accuracy and performance. Having such a parameter
in the interface at least serves as a massive documentation hint that
providing such a-priori knowledge would be a good idea.
> I also had a scenario where I was being fed the results of f(x) by a
> piece of hardware and I needed to do a numerical integration over these
> results. So, in this case, one has no idea what f(x) is, they only have
> a container of the results, vData. I was proposing that there be
> algorithms to perform numerical integration over the results of f(x)
> without having to know the parameters, i.e. x values.
Huh? What's the integral over (3.5,6.78,5.89,2.0) then? I figure you mean
summation instead of integration in this case, but I think this task is
sufficiently different from integration to justify an interface of its
own.
Yours
Martin
Martin,
What I mean in this case is I was being fed power numbers at specific
frequency increments. Knowing the delta-x, one can integrate over the range
of f(x) values via the trapezoidal rule, simpson's rule, others.
-- Dr. Martin Weiser Zuse Institute Berlin weiser_at_[hidden] Scientific Computing http://www.zib.de/weiser Numerical Analysis and Modelling _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk