SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace > Class Template Reference#

DiFfRG: DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace > Class Template Reference
DiFfRG
DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace > Class Template Reference

A spline interpolator for 1D data, both on GPU and CPU. More...

#include <spline_interpolator_1d.hh>

Public Types

using memory_space = DefaultMemorySpace
 
using other_memory_space = other_memory_space_t<DefaultMemorySpace>
 
using ctype = typename Coordinates::ctype
 
using value_type = NT
 

Public Member Functions

 SplineInterpolator1D (const Coordinates &coordinates)
 Construct a SplineInterpolator1D with internal, zeroed data and a coordinate system.
 
KOKKOS_FUNCTION SplineInterpolator1D (const SplineInterpolator1D &other)
 Copy constructor for SplineInterpolator1D. This is ONLY for usage inside Kokkos parallel loops.
 
KOKKOS_FUNCTION ~SplineInterpolator1D ()
 
template<typename NT2 >
void update (const NT2 *in_data, const ctype lower_y1=std::numeric_limits< ctype >::max(), const ctype upper_y1=std::numeric_limits< ctype >::max())
 
template<typename View >
requires (Kokkos::is_view<View>::value && View::rank == 1)
void update (const View &view, const ctype lower_y1=std::numeric_limits< ctype >::max(), const ctype upper_y1=std::numeric_limits< ctype >::max())
 
NT operator[] (size_t i) const
 
NT KOKKOS_FUNCTION operator() (const typename Coordinates::ctype x) const
 Interpolate the data at a given point.
 
auto & CPU () const
 
auto & GPU () const
 
template<typename MemorySpace >
auto & get_on () const
 
const Coordinates & get_coordinates () const
 Get the coordinate system of the data.
 
NT * data ()
 

Static Public Attributes

static constexpr size_t dim = 1
 

Private Types

using ValueViewType = Kokkos::View<NT *, DefaultMemorySpace, Kokkos::MemoryTraits<Kokkos::RandomAccess>>
 
using CoeffViewType = Kokkos::View<NT *, DefaultMemorySpace, Kokkos::MemoryTraits<Kokkos::RandomAccess>>
 
using HostValueViewType = typename ValueViewType::host_mirror_type
 
using HostCoeffViewType = typename CoeffViewType::host_mirror_type
 

Private Member Functions

void build_y2 (const ctype lower_y1, const ctype upper_y1)
 

Private Attributes

const Coordinates coordinates
 
const size_t size
 
ValueViewType device_values
 
CoeffViewType device_coeffs
 
HostValueViewType host_values
 
HostCoeffViewType host_coeffs
 
SplineInterpolator1D< NT, Coordinates, other_memory_space > * other_instance = nullptr
 
bool owns_other_instance = false
 

Friends

class SplineInterpolator1D< NT, Coordinates, other_memory_space >
 

Detailed Description

template<typename NT, typename Coordinates, typename DefaultMemorySpace = CPU_memory>
class DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >

A spline interpolator for 1D data, both on GPU and CPU.

Template Parameters
NTinput data type
Coordinatescoordinate system of the input data

Member Typedef Documentation

◆ CoeffViewType

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::CoeffViewType = Kokkos::View<NT *, DefaultMemorySpace, Kokkos::MemoryTraits<Kokkos::RandomAccess>>
private

◆ ctype

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::ctype = typename Coordinates::ctype

◆ HostCoeffViewType

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::HostCoeffViewType = typename CoeffViewType::host_mirror_type
private

◆ HostValueViewType

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::HostValueViewType = typename ValueViewType::host_mirror_type
private

◆ memory_space

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::memory_space = DefaultMemorySpace

◆ other_memory_space

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::other_memory_space = other_memory_space_t<DefaultMemorySpace>

◆ value_type

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::value_type = NT

◆ ValueViewType

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
using DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::ValueViewType = Kokkos::View<NT *, DefaultMemorySpace, Kokkos::MemoryTraits<Kokkos::RandomAccess>>
private

Constructor & Destructor Documentation

◆ SplineInterpolator1D() [1/2]

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::SplineInterpolator1D ( const Coordinates & coordinates)
inline

Construct a SplineInterpolator1D with internal, zeroed data and a coordinate system.

Parameters
coordinatescoordinate system of the data

◆ SplineInterpolator1D() [2/2]

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
KOKKOS_FUNCTION DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::SplineInterpolator1D ( const SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace > & other)
inline

Copy constructor for SplineInterpolator1D. This is ONLY for usage inside Kokkos parallel loops.

◆ ~SplineInterpolator1D()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
KOKKOS_FUNCTION DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::~SplineInterpolator1D ( )
inline

Member Function Documentation

◆ build_y2()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
void DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::build_y2 ( const ctype lower_y1,
const ctype upper_y1 )
inlineprivate

◆ CPU()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
auto & DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::CPU ( ) const
inline

◆ data()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
NT * DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::data ( )
inline

◆ get_coordinates()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
const Coordinates & DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::get_coordinates ( ) const
inline

Get the coordinate system of the data.

Returns
const Coordinates& the coordinate system

◆ get_on()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
template<typename MemorySpace >
auto & DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::get_on ( ) const
inline

◆ GPU()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
auto & DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::GPU ( ) const
inline

◆ operator()()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
NT KOKKOS_FUNCTION DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::operator() ( const typename Coordinates::ctype x) const
inline

Interpolate the data at a given point.

Parameters
xthe point at which to interpolate
Returns
NT the interpolated value

◆ operator[]()

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
NT DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::operator[] ( size_t i) const
inline

◆ update() [1/2]

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
template<typename NT2 >
void DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::update ( const NT2 * in_data,
const ctype lower_y1 = std::numeric_limits<ctype>::max(),
const ctype upper_y1 = std::numeric_limits<ctype>::max() )
inline

◆ update() [2/2]

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
template<typename View >
requires (Kokkos::is_view<View>::value && View::rank == 1)
void DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::update ( const View & view,
const ctype lower_y1 = std::numeric_limits<ctype>::max(),
const ctype upper_y1 = std::numeric_limits<ctype>::max() )
inline

Friends And Related Symbol Documentation

◆ SplineInterpolator1D< NT, Coordinates, other_memory_space >

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
friend class SplineInterpolator1D< NT, Coordinates, other_memory_space >
friend

Member Data Documentation

◆ coordinates

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
const Coordinates DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::coordinates
private

◆ device_coeffs

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
CoeffViewType DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::device_coeffs
private

◆ device_values

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
ValueViewType DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::device_values
private

◆ dim

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
size_t DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::dim = 1
staticconstexpr

◆ host_coeffs

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
HostCoeffViewType DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::host_coeffs
private

◆ host_values

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
HostValueViewType DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::host_values
private

◆ other_instance

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
SplineInterpolator1D<NT, Coordinates, other_memory_space>* DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::other_instance = nullptr
mutableprivate

◆ owns_other_instance

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
bool DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::owns_other_instance = false
mutableprivate

◆ size

template<typename NT , typename Coordinates , typename DefaultMemorySpace = CPU_memory>
const size_t DiFfRG::SplineInterpolator1D< NT, Coordinates, DefaultMemorySpace >::size
private

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