Looking for integrator that supports evaluating integrand at multiple points in batch mode?

  • Follow


Hi all,

I am looking for a numerical integrator in C/C++, which works with
semi-infinite interval, and supports evaluating the integrand function
at multiple points at a time in batch mode...

This is essentially a equivalent of Matlab "quadl", which based on
Gauss-Lobatto algorithm. It evaluates the integrand function at
multiple points at a time in batch mode. That's to say, f(x), where x
is a vector, and the function operates on x element-wise, returning

[f(x1)  f(x2)  f(x3) ... f(xn)] as a vector in one batch for the
elements x1, x2, ..., xn in x.

I haven't found anywhere such a vector integrand implementation in C/C+
+.

I've found it in Fortran but then it involves Fortran calling C/C++
and/or C/C++ calling Fortran, etc.

Please give me some pointers! Thanks a lot!

0
Reply lunamoonmoon (258) 8/12/2007 12:10:09 AM

In article <1186877409.580389.39510@e9g2000prf.googlegroups.com>,
	Luna Moon <lunamoonmoon@gmail.com> writes:
> Hi all,
> 
> I am looking for a numerical integrator in C/C++, which works with
> semi-infinite interval, and supports evaluating the integrand function
> at multiple points at a time in batch mode...

If you're looking for C/C++, why are you posting in a Fortran forum.
This is off-topic.


-- 
Steve
http://troutmask.apl.washington.edu/~kargl/
0
Reply kargl (773) 8/12/2007 12:29:08 AM


Steven G. Kargl wrote:
> In article <1186877409.580389.39510@e9g2000prf.googlegroups.com>,
> 	Luna Moon <lunamoonmoon@gmail.com> writes:
>> Hi all,
>>
>> I am looking for a numerical integrator in C/C++, which works with
>> semi-infinite interval, and supports evaluating the integrand function
>> at multiple points at a time in batch mode...
> 
> If you're looking for C/C++, why are you posting in a Fortran forum.
> This is off-topic.
> 
> 
Try google
0
Reply bogle (300) 8/12/2007 7:54:00 AM

On Aug 11, 8:10 pm, Luna Moon <lunamoonm...@gmail.com> wrote:
> Hi all,
>
> I am looking for a numerical integrator in C/C++, which works with
> semi-infinite interval, and supports evaluating the integrand function
> at multiple points at a time in batch mode...
>
> This is essentially a equivalent of Matlab "quadl", which based on
> Gauss-Lobatto algorithm. It evaluates the integrand function at
> multiple points at a time in batch mode. That's to say, f(x), where x
> is a vector, and the function operates on x element-wise, returning
>
> [f(x1)  f(x2)  f(x3) ... f(xn)] as a vector in one batch for the
> elements x1, x2, ..., xn in x.
>
> I haven't found anywhere such a vector integrand implementation in C/C+
> +.
>
> I've found it in Fortran but then it involves Fortran calling C/C++
> and/or C/C++ calling Fortran, etc.
>
> Please give me some pointers! Thanks a lot!

I have to withdraw a little bit here. Even for Fortran, I was unable
to find an integrator that works for integrand function supporting
vector-in-vector-out. I mistakenly thought QUADPACK has such
capability, but I was wrong. QUADPACK still works on scalar integrand
function with a scalar argument...

Any pointers? Thanks!

0
Reply Luna 8/12/2007 3:10:23 PM

 Luna Moon <lunamoonmoon@gmail.com> wrote in message 
<1186931423.769867.45800@o61g2000hsh.googlegroups.com>...
> On Aug 11, 8:10 pm, Luna Moon <lunamoonm...@gmail.com> wrote:
> > Hi all,
> >
> > I am looking for a numerical integrator in C/C++, which works with
> > semi-infinite interval, and supports evaluating the integrand function
> > at multiple points at a time in batch mode...
> >
> > This is essentially a equivalent of Matlab "quadl", which based on
> > Gauss-Lobatto algorithm. It evaluates the integrand function at
> > multiple points at a time in batch mode. That's to say, f(x), where x
> > is a vector, and the function operates on x element-wise, returning
> >
> > [f(x1)  f(x2)  f(x3) ... f(xn)] as a vector in one batch for the
> > elements x1, x2, ..., xn in x.
> >
> > I haven't found anywhere such a vector integrand implementation in C/
C+
> > +.
> >
> > I've found it in Fortran but then it involves Fortran calling C/C++
> > and/or C/C++ calling Fortran, etc.
> >
> > Please give me some pointers! Thanks a lot!
> 
> I have to withdraw a little bit here. Even for Fortran, I was unable
> to find an integrator that works for integrand function supporting
> vector-in-vector-out. I mistakenly thought QUADPACK has such
> capability, but I was wrong. QUADPACK still works on scalar integrand
> function with a scalar argument...
> 
> Any pointers? Thanks!

An adaptive integration tool like quad or any
of its cousins relies on the ability to sample
the function. Its efficiency will arise from
intelligently sampling in only those regions
where it needs to do so.

If each element of the vector integrand has
differing behaviors, then no single sampling
will be efficient. You might as well use a basic
Simpson's rule (or some other simple class
of Newton-Cotes rule), gaining because you
avoid all the overhead of choosing where to
look. You will just generate a whole lot of
function evals, but then the integration itself
will be fast.

John
0
Reply woodchips (7921) 8/12/2007 3:42:10 PM

On Aug 11, 8:29 pm, ka...@troutmask.apl.washington.edu (Steven G.
Kargl) wrote:
> In article <1186877409.580389.39...@e9g2000prf.googlegroups.com>,
>         Luna Moon <lunamoonm...@gmail.com> writes:
>
> > Hi all,
>
> > I am looking for a numerical integrator in C/C++, which works with
> > semi-infinite interval, and supports evaluating the integrand function
> > at multiple points at a time in batch mode...
>
> If you're looking for C/C++, why are you posting in a Fortran forum.
> This is off-topic.
>
> --
> Stevehttp://troutmask.apl.washington.edu/~kargl/

This is the reason:

-------------


I have to withdraw a little bit here. Even for Fortran, I was unable
to find an integrator that works for integrand function supporting
vector-in-vector-out. I mistakenly thought QUADPACK has such
capability, but I was wrong. QUADPACK still works on scalar integrand
function with a scalar argument...

Any pointers? Thanks!

0
Reply lunamoonmoon (258) 8/12/2007 6:00:04 PM

On Aug 12, 3:54 am, Gib Bogle <bo...@ihug.too.much.spam.co.nz> wrote:
> Steven G. Kargl wrote:
> > In article <1186877409.580389.39...@e9g2000prf.googlegroups.com>,
> >    Luna Moon <lunamoonm...@gmail.com> writes:
> >> Hi all,
>
> >> I am looking for a numerical integrator in C/C++, which works with
> >> semi-infinite interval, and supports evaluating the integrand function
> >> at multiple points at a time in batch mode...
>
> > If you're looking for C/C++, why are you posting in a Fortran forum.
> > This is off-topic.
>
> Try google

I have been googling for this for many days...

0
Reply lunamoonmoon (258) 8/12/2007 6:00:26 PM

On Aug 12, 11:42 am, "John D'Errico" <woodch...@rochester.rr.com>
wrote:
>  Luna Moon <lunamoonm...@gmail.com> wrote in message
> <1186931423.769867.45...@o61g2000hsh.googlegroups.com>...
>
>
>
> > On Aug 11, 8:10 pm, Luna Moon <lunamoonm...@gmail.com> wrote:
> > > Hi all,
>
> > > I am looking for a numerical integrator in C/C++, which works with
> > > semi-infinite interval, and supports evaluating the integrand function
> > > at multiple points at a time in batch mode...
>
> > > This is essentially a equivalent of Matlab "quadl", which based on
> > > Gauss-Lobatto algorithm. It evaluates the integrand function at
> > > multiple points at a time in batch mode. That's to say, f(x), where x
> > > is a vector, and the function operates on x element-wise, returning
>
> > > [f(x1)  f(x2)  f(x3) ... f(xn)] as a vector in one batch for the
> > > elements x1, x2, ..., xn in x.
>
> > > I haven't found anywhere such a vector integrand implementation in C/
> C+
> > > +.
>
> > > I've found it in Fortran but then it involves Fortran calling C/C++
> > > and/or C/C++ calling Fortran, etc.
>
> > > Please give me some pointers! Thanks a lot!
>
> > I have to withdraw a little bit here. Even for Fortran, I was unable
> > to find an integrator that works for integrand function supporting
> > vector-in-vector-out. I mistakenly thought QUADPACK has such
> > capability, but I was wrong. QUADPACK still works on scalar integrand
> > function with a scalar argument...
>
> > Any pointers? Thanks!
>
> An adaptive integration tool like quad or any
> of its cousins relies on the ability to sample
> the function. Its efficiency will arise from
> intelligently sampling in only those regions
> where it needs to do so.
>
> If each element of the vector integrand has
> differing behaviors, then no single sampling
> will be efficient. You might as well use a basic
> Simpson's rule (or some other simple class
> of Newton-Cotes rule), gaining because you
> avoid all the overhead of choosing where to
> look. You will just generate a whole lot of
> function evals, but then the integration itself
> will be fast.
>
> John

You are right John. However there are still programs that are both
adaptive and vectorized.

For example, Matlab's quadl is such a program. On one hand, it is
still adaptive Gaussian Lobatto; on the other hand, it samples at
multiple points at a time, accepting a vector of x's as its input.

What do you think about it? I am looking for a C/C++ implementation of
it... Thanks!

0
Reply lunamoonmoon (258) 8/12/2007 7:17:18 PM

On Aug 12, 11:10 am, Luna Moon <lunamoonm...@gmail.com> wrote:
> On Aug 11, 8:10 pm, Luna Moon <lunamoonm...@gmail.com> wrote:
>
>
>
>
>
> > Hi all,
>
> > I am looking for a numerical integrator in C/C++, which works with
> > semi-infinite interval, and supports evaluating the integrand function
> > at multiple points at a time in batch mode...
>
> > This is essentially a equivalent of Matlab "quadl", which based on
> > Gauss-Lobatto algorithm. It evaluates the integrand function at
> > multiple points at a time in batch mode. That's to say, f(x), where x
> > is a vector, and the function operates on x element-wise, returning
>
> > [f(x1)  f(x2)  f(x3) ... f(xn)] as a vector in one batch for the
> > elements x1, x2, ..., xn in x.
>
> > I haven't found anywhere such a vector integrand implementation in C/C+
> > +.
>
> > I've found it in Fortran but then it involves Fortran calling C/C++
> > and/or C/C++ calling Fortran, etc.
>
> > Please give me some pointers! Thanks a lot!
>
> I have to withdraw a little bit here. Even for Fortran, I was unable
> to find an integrator that works for integrand function supporting
> vector-in-vector-out. I mistakenly thought QUADPACK has such
> capability, but I was wrong. QUADPACK still works on scalar integrand
> function with a scalar argument...
>
> Any pointers? Thanks!- Hide quoted text -
>
> - Show quoted text -

Do a google search in this newsgroup on "integrable singularity
beliavsky" or find Allan Miller's web site.


0
Reply e 8/12/2007 11:55:56 PM

8 Replies
83 Views

(page loaded in 0.181 seconds)


Reply: