Skip to content
Snippets Groups Projects

PolyItem: simplify; disambiguate fcts

Merged Wuttke, Joachim requested to merge j.0 into main
47 files
+ 112
118
Compare changes
  • Side-by-side
  • Inline
Files
47
@@ -22,7 +22,8 @@
#include <memory>
//! Alias template for member function with signature double f(double)
template <class T> using miser_integrand = double (T::*)(const double*, size_t, const void*) const;
template <typename T>
using miser_integrand = double (T::*)(const double*, size_t, const void*) const;
//! Template class to use Monte Carlo MISER integration of class member functions.
//!
@@ -33,7 +34,7 @@ template <class T> using miser_integrand = double (T::*)(const double*, size_t,
//! 'auto integrator = make_integrator_miser(this, mem_function, dimension)'
//! - Call: 'integrator.integrate(lmin, lmax, data, n_points)'
template <class T> class IntegratorMCMiser {
template <typename T> class IntegratorMCMiser {
public:
//! structure holding the object and possible extra parameters
struct CallBackHolder {
@@ -67,11 +68,11 @@ private:
};
//! Alias template for handle to a miser integrator
template <class T> using P_integrator_miser = std::unique_ptr<IntegratorMCMiser<T>>;
template <typename T> using P_integrator_miser = std::unique_ptr<IntegratorMCMiser<T>>;
//! Template function to create an integrator object
template <class T>
template <typename T>
P_integrator_miser<T> make_integrator_miser(const T* object, miser_integrand<T> mem_function,
size_t dim)
{
@@ -83,7 +84,7 @@ P_integrator_miser<T> make_integrator_miser(const T* object, miser_integrand<T>
// Implementation
// ************************************************************************************************
template <class T>
template <typename T>
IntegratorMCMiser<T>::IntegratorMCMiser(const T* p_object, miser_integrand<T> p_member_function,
size_t dim)
: m_object(p_object)
@@ -99,13 +100,13 @@ IntegratorMCMiser<T>::IntegratorMCMiser(const T* p_object, miser_integrand<T> p_
m_random_gen = gsl_rng_alloc(random_type);
}
template <class T> IntegratorMCMiser<T>::~IntegratorMCMiser()
template <typename T> IntegratorMCMiser<T>::~IntegratorMCMiser()
{
gsl_monte_miser_free(m_gsl_workspace);
gsl_rng_free(m_random_gen);
}
template <class T>
template <typename T>
double IntegratorMCMiser<T>::integrate(double* min_array, double* max_array, const void* params,
size_t n_points) const
{
Loading