BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ComplexIntegrator Class Reference
Collaboration diagram for ComplexIntegrator:

Public Member Functions

complex_t integrate (const std::function< complex_t(double)> &f, double lmin, double lmax)
 

Private Attributes

RealIntegrator realPart
 
RealIntegrator imagPart
 

Detailed Description

To integrate a complex function of a real variable.

Definition at line 40 of file Integrator.h.

Member Function Documentation

◆ integrate()

complex_t ComplexIntegrator::integrate ( const std::function< complex_t(double)> &  f,
double  lmin,
double  lmax 
)

Definition at line 36 of file Integrator.cpp.

38 {
39  return {realPart.integrate([f](double x) { return f(x).real(); }, lmin, lmax),
40  imagPart.integrate([f](double x) { return f(x).imag(); }, lmin, lmax)};
41 }
RealIntegrator realPart
Definition: Integrator.h:46
RealIntegrator imagPart
Definition: Integrator.h:47
double integrate(const std::function< double(double)> &f, double lmin, double lmax)
Definition: Integrator.cpp:27

References imagPart, RealIntegrator::integrate(), and realPart.

Referenced by FormFactorCone::evaluate_for_q(), FormFactorHemiEllipsoid::evaluate_for_q(), FormFactorTruncatedSphere::evaluate_for_q(), FormFactorTruncatedSpheroid::evaluate_for_q(), and ripples::profile_yz_cosine().

Here is the call graph for this function:

Member Data Documentation

◆ realPart

RealIntegrator ComplexIntegrator::realPart
private

Definition at line 46 of file Integrator.h.

Referenced by integrate().

◆ imagPart

RealIntegrator ComplexIntegrator::imagPart
private

Definition at line 47 of file Integrator.h.

Referenced by integrate().


The documentation for this class was generated from the following files: