File Integrate.h¶
-
namespace
lsst
Class for a simple mapping implementing a generic AstrometryTransform.
Remove all non-astronomical counts from the Chunk Exposure’s pixels.
Forward declarations for lsst::utils::Cache
For details on the Cache class, see the Cache.h file.
It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.
A base class for image defects
Numeric constants used by the Integrate.h integrator routines.
Compute Image Statistics
- Note
Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.
- Note
The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.
-
namespace
afw
-
namespace
math
Functions
-
template<class
UF
>
UF::result_typeint1d
(UF const &func, IntRegion<typename UF::result_type> ®, typename UF::result_type const &abserr = DEFABSERR, typename UF::result_type const &relerr = DEFRELERR)¶ Front end for the 1d integrator
-
template<class
BF
, classYREG
>
BF::result_typeint2d
(BF const &func, IntRegion<typename BF::result_type> ®, YREG const &yreg, typename BF::result_type const &abserr = DEFABSERR, typename BF::result_type const &relerr = DEFRELERR)¶ Front end for the 2d integrator
-
template<class
TF
, classYREG
, classZREG
>
TF::result_typeint3d
(TF const &func, IntRegion<typename TF::result_type> ®, YREG const &yreg, ZREG const &zreg, typename TF::result_type const &abserr = DEFABSERR, typename TF::result_type const &relerr = DEFRELERR)¶ Front end for the 3d integrator
-
template<class
BF
>
BF::result_typeint2d
(BF const &func, IntRegion<typename BF::result_type> ®, IntRegion<typename BF::result_type> &yreg, typename BF::result_type const &abserr = DEFABSERR, typename BF::result_type const &relerr = DEFRELERR)¶ Front end for the 2d integrator
-
template<class
TF
>
TF::result_typeint3d
(TF const &func, IntRegion<typename TF::result_type> ®, IntRegion<typename TF::result_type> &yreg, IntRegion<typename TF::result_type> &zreg, typename TF::result_type const &abserr = DEFABSERR, typename TF::result_type const &relerr = DEFRELERR)¶ Front end for the 3d integrator
-
template<typename
UnaryFunctionT
>
UnaryFunctionT::result_typeintegrate
(UnaryFunctionT func, typename UnaryFunctionT::argument_type const a, typename UnaryFunctionT::argument_type const b, double eps = 1.0e-6)¶ The 1D integrator
- Note
This simply wraps the int1d function above and handles the instantiation of the intRegion.
-
template<typename
BinaryFunctionT
>
BinaryFunctionT::result_typeintegrate2d
(BinaryFunctionT func, typename BinaryFunctionT::first_argument_type const x1, typename BinaryFunctionT::first_argument_type const x2, typename BinaryFunctionT::second_argument_type const y1, typename BinaryFunctionT::second_argument_type const y2, double eps = 1.0e-6)¶ The 2D integrator
- Note
Adapted from RHL’s SDSS code
Variables
-
double const
MOCK_INF
= 1.e10¶
-
double const
DEFABSERR
= 1.e-15¶
-
double const
DEFRELERR
= 1.e-6¶
-
template<class
T
>
structIntRegion
¶ Public Functions
-
IntRegion &
operator=
(IntRegion const&)¶
-
IntRegion &
operator=
(IntRegion&&)¶
-
~IntRegion
()¶
-
bool
operator<
(IntRegion<T> const &r2) const¶
-
bool
operator>
(IntRegion<T> const &r2) const¶
-
void
Bisect
()¶
-
void
AddSplit
(const T x)¶
-
size_t
NSplit
() const¶
-
T const &
Left
() const¶
-
T const &
Right
() const¶
-
T const &
Err
() const¶
-
T const &
Area
() const¶
-
void
SetArea
(const T &a, const T &e)¶
-
IntRegion &
-
namespace
details
Functions
-
template<class
UF
>
boolintGKPNA
(UF const &func, IntRegion<typename UF::result_type> ®, typename UF::result_type const epsabs, typename UF::result_type const epsrel, std::map<typename UF::result_type, typename UF::result_type> *fxmap = 0)¶ Non-adaptive integration of the function f over the region ‘reg’.
- Note
The algorithm computes first a Gaussian quadrature value then successive Kronrod/Patterson extensions to this result. The functions terminates when the difference between successive approximations (rescaled according to rescale_error) is less than either epsabs or epsrel * I, where I is the latest estimate of the integral. The order of the Gauss/Kronron/Patterson scheme is determined by which file is included above. Currently schemes starting with order 1 and order 10 are calculated. There seems to be little practical difference in the integration times using the two schemes, so I haven’t bothered to calculate any more.
-
template<class
UF
>
voidintGKP
(UF const &func, IntRegion<typename UF::result_type> ®, typename UF::result_type const epsabs, typename UF::result_type const epsrel, std::map<typename UF::result_type, typename UF::result_type> *fxmap = 0)¶ An adaptive integration algorithm which computes the integral of f over the region reg.
The area and estimated error are returned as reg.Area() and reg.Err() If desired, *retx and *retf return std::vectors of x,f(x) respectively They only include the evaluations in the non-adaptive pass, so they do not give an accurate estimate of the number of function evaluations.
- Note
First the non-adaptive GKP algorithm is tried. If that is not accurate enough (according to the absolute and relative accuracies, epsabs and epsrel), the region is split in half, and each new region is integrated. The routine continues by successively splitting the subregion which gave the largest absolute error until the integral converges.
-
template<class
UF
>
structAuxFunc1
: public std::unary_function<UF::argument_type, UF::result_type>¶ - #include <Integrate.h>
Auxiliary struct 1
Public Functions
-
AuxFunc1
(const UF &f)¶
-
UF::result_type
operator()
(typename UF::argument_type x) const¶
Private Members
-
UF const &
_f
¶
-
-
template<class
UF
>
structAuxFunc2
: public std::unary_function<UF::argument_type, UF::result_type>¶ Public Functions
-
AuxFunc2
(UF const &f)¶
-
UF::result_type
operator()
(typename UF::argument_type x) const¶
Private Members
-
UF const &
_f
¶
-
-
template<class
BF
>
classbinder2_1
: public std::unary_function<BF::second_argument_type, BF::result_type> Public Functions
-
binder2_1
(const BF &oper, typename BF::first_argument_type val)
-
BF::result_type
operator()
(const typename BF::second_argument_type &x) const
Protected Attributes
-
BF
_oper
-
BF::first_argument_type
_value
-
-
template<class
TF
>
classbinder3_1
: public std::binary_function<TF::secondof3_argument_type, TF::thirdof3_argument_type, TF::result_type> Public Functions
-
binder3_1
(const TF &oper, typename TF::firstof3_argument_type val)
-
TF::result_type
operator()
(typename TF::secondof3_argument_type const &x1, typename TF::thirdof3_argument_type const &x2) const
Protected Attributes
-
TF
_oper
-
TF::firstof3_argument_type
_value
-
-
template<class
T
>
structConstantReg1
: public std::unary_function<T, IntRegion<T>>¶ - #include <Integrate.h>
Helpers for constant regions for int2d, int3d:
Public Functions
-
ConstantReg1
(T a, T b)¶
-
ConstantReg1
(IntRegion<T> const &r)¶
-
IntRegion<T>
operator()
(T) const¶
Public Members
-
IntRegion<T>
ir
¶
-
-
template<class
T
>
structConstantReg2
: public std::binary_function<T, T, IntRegion<T>>¶ Public Functions
-
ConstantReg2
(T a, T b)¶
-
ConstantReg2
(IntRegion<T> const &r)¶
-
IntRegion<T>
operator()
(T x, T y) const¶
Public Members
-
IntRegion<T>
ir
¶
-
-
template<typename
BinaryFunctionT
>
classFunctionWrapper
: public std::unary_function<BinaryFunctionT::second_argument_type, BinaryFunctionT::result_type> - #include <Integrate.h>
Wrap an integrand in a call to a 1D integrator: romberg()
When romberg2D() is called, it wraps the integrand it was given in a FunctionWrapper functor. This wrapper calls romberg() on the integrand to get a 1D (along the x-coord, for constant y) result . romberg2D() then calls romberg() with the FunctionWrapper functor as an integrand.
Public Functions
-
FunctionWrapper
(BinaryFunctionT func, typename BinaryFunctionT::first_argument_type const x1, typename BinaryFunctionT::first_argument_type const x2, double const eps = 1.0e-6)
-
BinaryFunctionT::result_type
operator()
(typename BinaryFunctionT::second_argument_type const y) const
-
-
template<class
BF
, classYREG
>
classInt2DAuxType
: public std::unary_function<BF::first_argument_type, BF::result_type> Public Functions
-
Int2DAuxType
(BF const &func, YREG const &yreg, typename BF::result_type const &abserr, typename BF::result_type const &relerr)
-
BF::result_type
operator()
(typename BF::first_argument_type x) const
-
-
template<class
TF
, classYREG
, classZREG
>
classInt3DAuxType
: public std::unary_function<TF::firstof3_argument_type, TF::result_type> Public Functions
-
Int3DAuxType
(const TF &func, const YREG &yreg, const ZREG &zreg, const typename TF::result_type &abserr, const typename TF::result_type &relerr)
-
TF::result_type
operator()
(typename TF::firstof3_argument_type x) const
-
-
template<class
-
template<class
-
namespace