Convolutional Kernels

Provides the kernel classes for the convolution done when computing the weighted density of the points.

Authors

Simone Balducci, Felice Pantaleo, Marco Rovere, Wahid Redjeb, Aurora Perego, Francesco Giacomini

namespace clue
template<std::floating_point TData = float>
class ExponentialKernel
#include <ConvolutionalKernel.hpp>

The ExponentialKernel class implements an exponential kernel for convolution. It computes the kernel value based on the exponential function, which is defined by its average and amplitude.

Template Parameters:
std::floating_point TData = float

The data type for the kernel values

Public Types

using value_type = std::remove_cv_t<std::remove_reference_t<TData>>

Public Functions

ExponentialKernel(value_type exp_avg, value_type exp_amplitude)

Construct an ExponentialKernel object.

Parameters:
value_type exp_avg

The average value for the exponential kernel

value_type exp_amplitude

The amplitude for the exponential kernel

template<typename TAcc>
ALPAKA_FN_ACC auto operator()(const TAcc &acc, value_type dist_ij, int point_id, int j) const

Computes the kernel value between two points.

Parameters:
const TAcc &acc

The accelerator to use for the computation

value_type dist_ij

The distance between the two points

int point_id

The index of the first point

int j

The index of the second point

Returns:

The computed kernel value

Private Members

value_type m_exp_avg
value_type m_exp_amplitude
template<std::floating_point TData = float>
class FlatKernel
#include <ConvolutionalKernel.hpp>

The FlatKernel class implements a flat kernel for convolution. It returns a constant value for the kernel, regardless of the distance between points.

Template Parameters:
std::floating_point TData = float

The data type for the kernel values

Public Types

using value_type = std::remove_cv_t<std::remove_reference_t<TData>>

Public Functions

FlatKernel(value_type flat)

Construct a FlatKernel object.

Parameters:
value_type flat

The flat value for the kernel

template<typename TAcc>
ALPAKA_FN_ACC auto operator()(const TAcc &acc, value_type dist_ij, int point_id, int j) const

Computes the kernel value between two points.

Parameters:
const TAcc &acc

The accelerator to use for the computation

value_type dist_ij

The distance between the two points

int point_id

The index of the first point

int j

The index of the second point

Returns:

The computed kernel value

Private Members

value_type m_flat
template<std::floating_point TData = float>
class GaussianKernel
#include <ConvolutionalKernel.hpp>

The GaussianKernel class implements a Gaussian kernel for convolution. It computes the kernel value based on the Gaussian function, which is defined by its average, standard deviation, and amplitude.

Template Parameters:
std::floating_point TData = float

The data type for the kernel values

Public Types

using value_type = std::remove_cv_t<std::remove_reference_t<TData>>

Public Functions

GaussianKernel(value_type gaus_avg, value_type gaus_std, value_type gaus_amplitude)

Construct a GaussianKernel object.

Parameters:
value_type gaus_avg

The average value for the Gaussian kernel

value_type gaus_std

The standard deviation for the Gaussian kernel

value_type gaus_amplitude

The amplitude for the Gaussian kernel

template<typename TAcc>
ALPAKA_FN_ACC auto operator()(const TAcc &acc, value_type dist_ij, int point_id, int j) const

Computes the kernel value between two points.

Parameters:
const TAcc &acc

The accelerator to use for the computation

value_type dist_ij

The distance between the two points

int point_id

The index of the first point

int j

The index of the second point

Returns:

The computed kernel value

Private Members

value_type m_gaus_avg
value_type m_gaus_std
value_type m_gaus_amplitude
namespace concepts