PACMAN 0.1.0
Portable Algorithms for Coupling, Mapping, and Adaptive iNterpolation
Loading...
Searching...
No Matches
PACMAN::RbfPum Namespace Reference

Classes

struct  DistanceToKNearest
 Support struct for an ArborX predicate. More...
 
struct  DistanceToKNearestCallback
 Custom ArborX callback which returns the squared distance between a cluster center and its nearest points. More...
 
struct  GetClustersPoints
 Support struct for an ArborX predicate. More...
 
struct  GetClustersPointsCallback
 A custon ArborX callback which returns the indices of the points inside of each region (according to the position of source/target points in the transfer views) More...
 
struct  OffsetsScan
 Struct used to build multiple matrices access offsets with one scan loop only, during the systems solver step. More...
 
struct  OffsetsScanPair
 
struct  Projection
 Support struct for an ArborX predicate. More...
 
struct  ProjectionCallback
 A custom ArborX callback which returns the nearest mesh point of a given value (the nearest projection of it) More...
 
struct  RemoveTaggedCenters
 A functor which returns true is a given point is tagged for removal (=> if its first dimension coordinate is NaN) More...
 
struct  TagEmptyCenters
 Support struct for an ArborX predicate. More...
 
struct  TagEmptyCentersCallback
 A custon ArborX callback which tags empty regions centers, by setting the x axis value of the center to NAN More...
 
struct  TransformToNearest
 Support struct for an ArborX predicate. More...
 
struct  TransformToNearestCallback
 A custom ArborX callback which performs a nearest point projection for all the ArborX::Point in the given view. More...
 
class  WendlandC0
 A functor which computes a RBF function: WendlandC0 Each RBF function must have a host device method fp_t Eval(const fp_t) const which computes an image of the RBF function And a method SetRadiusInv which is a setter for the function support radius. More...
 
class  WendlandC2
 A functor which computes a RBF function: WendlandC2 Each RBF function must have a host device method fp_t Eval(const fp_t) const which computes an image of the RBF function And a method SetRadiusInv which is a setter for the function support radius. More...
 
class  WendlandC4
 A functor which computes a RBF function: WendlandC4 Each RBF function must have a host device method fp_t Eval(const fp_t) const which computes an image of the RBF function And a method SetRadiusInv which is a setter for the function support radius. More...
 
class  WendlandC6
 A functor which computes a RBF function: WendlandC6 Each RBF function must have a host device method fp_t Eval(const fp_t) const which computes an image of the RBF function And a method SetRadiusInv which is a setter for the function support radius. More...
 
class  WendlandC8
 A functor which computes a RBF function: WendlandC8 Each RBF function must have a host device method fp_t Eval(const fp_t) const which computes an image of the RBF function And a method SetRadiusInv which is a setter for the function support radius. More...
 

Typedefs

template<typename T >
using base_type = typename std::remove_cv< typename std::remove_reference< T >::type >::type
 Returns a type without reference or const/volatile modifiers.
 

Functions

template<int_t X, int_t N>
constexpr index_t CompileTimePow (void)
 A pow function computed at compile time.
 
template<int_t Dim>
constexpr auto ZCurveNeighborOffsets (int_t shape[Dim])
 Return the indices offsets of the spatial neighbors given the shape of the space.
 
template<>
constexpr auto ZCurveNeighborOffsets< 2 > (int_t shape[2])
 : 2D specialization of ZCurveNeighborOffsets for faster computations
 
template<>
constexpr auto ZCurveNeighborOffsets< 3 > (int_t shape[3])
 : 3D specialization of ZCurveNeighborOffsets for faster computations
 
template<KokkosViewRank< 2 > SourceType, KokkosViewRank< 1 > TargetType, int_t Dim>
static void FillTarget (const SourceType &sourceView, TargetType &targetView)
 
template<KokkosViewRank< 1 > AsViewType, KokkosViewRank< 1 > OffsViewType>
KOKKOS_FORCEINLINE_FUNCTION auto GetRbfMatrix (const index_t &k, const AsViewType &As, const OffsViewType &offs, const int_t &n, const int_t &m)
 Returns a matrix of rank 2, shaped as (n, m), using the given data view, team rank, and offsets.
 
template<KokkosViewRank< 1 > PsViewType, KokkosViewRank< 1 > OffsViewType, KokkosArray AxisType>
KOKKOS_FORCEINLINE_FUNCTION auto GetPolyMatrix (const index_t &k, const PsViewType &Ps, const OffsViewType &offs, const int_t &n, const AxisType &activeAxis)
 Returns a matrix of rank 2, shaped as (n, m), using the given data view, team rank, and offsets.
 
template<KokkosViewRank< 1 > BsViewType, KokkosViewRank< 1 > OffsViewType>
KOKKOS_FORCEINLINE_FUNCTION auto GetRbfVector (const index_t &k, const BsViewType &Bs, const OffsViewType &offs, const int_t &n)
 Returns a vector view of rank 1, of length n, using the given data view, team rank, and offsets.
 
template<KokkosViewRank< 1 > SourceType, KokkosViewRank< 1 > OffsType, KokkosArray AxisType, int_t dim = AxisType::size()>
KOKKOS_INLINE_FUNCTION int_t SerialDeactivateOneAxis (const SourceType &src, const OffsType &offs, AxisType &activeAxis)
 Deactivate one axis, the one with the smallest range of values and returns the index of this deactivated axis.
 
template<KokkosViewRank< 2 > PViewType, KokkosViewRank< 1 > XViewType, KokkosViewRank< 1 > OffsViewType, KokkosArray AxisType, int_t dim = AxisType::size()>
KOKKOS_FUNCTION void SerialFillPoly (PViewType &P, const XViewType &X, const OffsViewType &XOffs, AxisType &activeAxis)
 Fill the polynomial augmentation matrix accordingly to the activated axis in activeAxis
 
template<KokkosViewRank< 2 > QViewType, KokkosViewRank< 1 > XViewType, KokkosViewRank< 1 > XOffsType, KokkosViewRank< 1 > WViewType, KokkosArray AxisType, int_t dim = AxisType::size()>
KOKKOS_FORCEINLINE_FUNCTION int_t SerialFillQ (QViewType &Q, const XViewType &X, const XOffsType &XOffs, WViewType &W, AxisType &activeAxis)
 Fill the polynomial augmentation matrix Q and sets activeAxis accordingly to the deactivated axis in SerialDeactivateOneAxis
 
template<KokkosViewRank< 2 > AViewType, KokkosViewRank< 1 > BViewType, KokkosViewRank< 1 > OutViewType>
KOKKOS_FORCEINLINE_FUNCTION void SerialMulMatVec (const AViewType &A, const BViewType &B, OutViewType &out)
 Perform: out = Ab.
 
template<KokkosViewRank< 1 > UViewType, KokkosViewRank< 1 > VViewType>
KOKKOS_FORCEINLINE_FUNCTION void SerialVecVecAdd (UViewType &U, const VViewType &V)
 Perform an inplace addition of 2 vectors such as U = U + V.
 
template<KokkosViewRank< 1 > UViewType, KokkosViewRank< 1 > VViewType>
KOKKOS_FORCEINLINE_FUNCTION void SerialVecVecSub (UViewType &U, const VViewType &V)
 Perform an inplace difference of 2 vectors such as U = U - V.
 
template<KokkosViewRank< 2 > AViewType, KokkosViewRank< 2 > BViewType, KokkosViewRank< 1 > TViewType, KokkosViewRank< 2 > XViewType, KokkosViewRank< 1 > WViewType>
KOKKOS_FORCEINLINE_FUNCTION auto SerialSolveQR (AViewType &A, const BViewType &B, TViewType &T, XViewType &X, WViewType &W)
 Solves AX=B for X using a QR factorization on A.
 
template<KokkosViewRank< 2 > AViewType, KokkosViewRank< 1 > BViewType>
KOKKOS_FORCEINLINE_FUNCTION void SerialSolveLU (AViewType &A, BViewType &B)
 Solves AX=B for X using a LU factorization on A.
 
template<KokkosViewRank< 2 > AViewType, KokkosViewRank< 1 > SViewType, KokkosViewRank< 1 > WViewType>
KOKKOS_FORCEINLINE_FUNCTION void SerialSVD (AViewType &A, SViewType &S, WViewType &W)
 Perform a partial SVD decomposition, to fetch only the singular values of A.
 
template<typename TeamHandleType , KokkosViewRank< 2 > AViewType, KokkosViewRank< 1 > XType, KokkosViewRank< 1 > XOffsType, RBFFunction RbfFuncType>
KOKKOS_FORCEINLINE_FUNCTION void TeamFillA (const TeamHandleType &teamHandle, const AViewType &A, const XType &X, const XOffsType &XOffs, const RbfFuncType &func)
 Fills the RBF matrix A in parallel.
 
template<typename TeamHandleType , KokkosViewRank< 2 > AViewType, KokkosViewRank< 1 > XType, KokkosViewRank< 1 > XOffsType, KokkosViewRank< 1 > YType, KokkosViewRank< 1 > YOffsType, RBFFunction RbfFuncType>
KOKKOS_FORCEINLINE_FUNCTION void TeamFillE (const TeamHandleType &teamHandle, AViewType &A, const XType &X, const XOffsType &XOffs, const YType &Y, const YOffsType &YOffs, const RbfFuncType &func)
 Fills the RBF evaluation matrix E in parallel.
 
template<typename TeamHandleType , KokkosViewRank< 1 > BViewType, KokkosViewRank< 1 > XType, KokkosViewRank< 1 > XOffsType>
KOKKOS_FORCEINLINE_FUNCTION void TeamFillB (const TeamHandleType &teamHandle, BViewType &B, const XType &X, const XOffsType &XOffs)
 Fills the vector of known source values B in parallel.
 
template<int_t Dim>
KOKKOS_INLINE_FUNCTION fp_t SquaredDifference (const ::ArborX::Point< Dim, coordinates_t > &lhs, const ::ArborX::Point< Dim, coordinates_t > &rhs) noexcept
 Returns the squared distance between two points, and check for NaN values.
 
template<int_t Dim>
KOKKOS_INLINE_FUNCTION fp_t Distance (const ::ArborX::Point< Dim, coordinates_t > &lhs, const ::ArborX::Point< Dim, coordinates_t > &rhs)
 Returns the euclidian norm between two points by performing a square root operation on the SquaredDifference result.
 
template<int_t Dim>
KOKKOS_INLINE_FUNCTION fp_t SquaredDifferenceNoCheck (const ::ArborX::Point< Dim, coordinates_t > &lhs, const ::ArborX::Point< Dim, coordinates_t > &rhs)
 Returns the squared distance between two points, and don't check for NaN values.
 
template<int_t Dim>
KOKKOS_INLINE_FUNCTION fp_t DistanceNoCheck (const ::ArborX::Point< Dim, coordinates_t > &lhs, const ::ArborX::Point< Dim, coordinates_t > &rhs)
 Returns the euclidian norm between two points by performing a square root operation on the SquaredDifferenceNoCheck result.
 
template<typename ExecSpace >
KOKKOS_FORCEINLINE_FUNCTION constexpr bool IsHostAccessible (void)
 
static void PrintCudaMemoryUsage ()
 If Cuda is activated, prints the used Nvidia device memory, else do nothing.
 
template<typename ViewType >
void PrintSizeOfView (ViewType &v)
 Prints the memory usage of a Kokkos::View
 
template<typename ViewType >
void PrintView (ViewType &v, std::string sep=" ")
 
template<typename DataView >
void ExportMatView (const DataView &data, const index_t rows, const index_t cols, std::fstream &file)
 
template<typename ViewType , typename Comparator >
KOKKOS_INLINE_FUNCTION auto RbfPumMinMax (const ViewType &v, const Comparator &op)
 A reimplementation of Kokkos::MinMax which works on any backend.
 

Typedef Documentation

◆ base_type

template<typename T >
using PACMAN::RbfPum::base_type = typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type

Returns a type without reference or const/volatile modifiers.

Template Parameters
TAny type

Definition at line 41 of file utils.hpp.

Function Documentation

◆ CompileTimePow()

template<int_t X, int_t N>
constexpr index_t PACMAN::RbfPum::CompileTimePow ( void  )
constexpr

A pow function computed at compile time.

Template Parameters
XThe value X of $X^N$
NThe value N of $X^N$
Returns
The value $X^N$ at compile time

Definition at line 20 of file clustering.hpp.

◆ Distance()

template<int_t Dim>
KOKKOS_INLINE_FUNCTION fp_t PACMAN::RbfPum::Distance ( const ::ArborX::Point< Dim, coordinates_t > &  lhs,
const ::ArborX::Point< Dim, coordinates_t > &  rhs 
)

Returns the euclidian norm between two points by performing a square root operation on the SquaredDifference result.

Template Parameters
DimThe space dimension of both points
Parameters
lhsSource ArborX::Point
rhsTarget ArborX::Point
Note
see SquaredDifference, if SquaredDifference returns -1.0, this function returns -1.0 as well

Definition at line 148 of file operators.hpp.

References PACMAN::fp_consts::one(), SquaredDifference(), and PACMAN::fp_consts::zero().

◆ DistanceNoCheck()

template<int_t Dim>
KOKKOS_INLINE_FUNCTION fp_t PACMAN::RbfPum::DistanceNoCheck ( const ::ArborX::Point< Dim, coordinates_t > &  lhs,
const ::ArborX::Point< Dim, coordinates_t > &  rhs 
)

Returns the euclidian norm between two points by performing a square root operation on the SquaredDifferenceNoCheck result.

Template Parameters
DimThe space dimension of both points
Parameters
lhsSource ArborX::Point
rhsTarget ArborX::Point
Note
see SquaredDifferenceNoCheck

Definition at line 182 of file operators.hpp.

References SquaredDifferenceNoCheck().

Referenced by TeamFillA(), and TeamFillE().

◆ ExportMatView()

template<typename DataView >
void PACMAN::RbfPum::ExportMatView ( const DataView data,
const index_t  rows,
const index_t  cols,
std::fstream &  file 
)

Definition at line 88 of file utils.hpp.

◆ FillTarget()

template<KokkosViewRank< 2 > SourceType, KokkosViewRank< 1 > TargetType, int_t Dim>
static void PACMAN::RbfPum::FillTarget ( const SourceType sourceView,
TargetType targetView 
)
inlinestatic

Definition at line 29 of file rbf_pum/interpolator.hpp.

◆ GetPolyMatrix()

template<KokkosViewRank< 1 > PsViewType, KokkosViewRank< 1 > OffsViewType, KokkosArray AxisType>
KOKKOS_FORCEINLINE_FUNCTION auto PACMAN::RbfPum::GetPolyMatrix ( const index_t k,
const PsViewType Ps,
const OffsViewType offs,
const int_t n,
const AxisType activeAxis 
)

Returns a matrix of rank 2, shaped as (n, m), using the given data view, team rank, and offsets.

This function basically reinterprets a 1D vector into a 2D matrix accordingly to the given dimension and active axis.

Template Parameters
PsViewTypeMatrices data view type.
OffsViewTypeAccess offsets type for the given data view.
AxisTypeActive axis Kokkos::Array type
Parameters
kThe index of the current team in the league
PsThe matrices data view
offsThe access offsets of the matrices data view
nThe number of lines in the reshaped matrix which is returned
activeAxisThe number of active axis is the number of columns in the reshaped matrix which is returned
Returns
A non owning data Kokkos::View (unmanaged) which represents the polynomial matrix.

Definition at line 59 of file getters.hpp.

◆ GetRbfMatrix()

template<KokkosViewRank< 1 > AsViewType, KokkosViewRank< 1 > OffsViewType>
KOKKOS_FORCEINLINE_FUNCTION auto PACMAN::RbfPum::GetRbfMatrix ( const index_t k,
const AsViewType As,
const OffsViewType offs,
const int_t n,
const int_t m 
)

Returns a matrix of rank 2, shaped as (n, m), using the given data view, team rank, and offsets.

This function basically reinterprets a 1D vector into a 2D matrix accordingly to the given dimensions.

Template Parameters
AsViewTypeMatrices data view type.
OffsViewTypeAccess offsets type for the given data view.
Parameters
kThe index of the current team in the league
AsThe matrices data view
offsThe access offsets of the matrices data view
nThe number of lines in the reshaped matrix which is returned
mThe number of columns in the reshaped matrix which is returned
Returns
A non owning data Kokkos::View (unmanaged) which represents the RBF matrix.

Definition at line 31 of file getters.hpp.

◆ GetRbfVector()

template<KokkosViewRank< 1 > BsViewType, KokkosViewRank< 1 > OffsViewType>
KOKKOS_FORCEINLINE_FUNCTION auto PACMAN::RbfPum::GetRbfVector ( const index_t k,
const BsViewType Bs,
const OffsViewType offs,
const int_t n 
)

Returns a vector view of rank 1, of length n, using the given data view, team rank, and offsets.

This function wraps a slice of Bs into an unmanaged view.

Template Parameters
BsViewTypeVectors data view type.
OffsViewTypeAccess offsets type for the given data view.
Parameters
kThe index of the current team in the league
BsThe vectors data view
offsThe access offsets of the vectors data view
nThe length of the returned vector
Returns
A non owning data Kokkos::View (unmanaged) which represents the source values vector.

Definition at line 92 of file getters.hpp.

◆ IsHostAccessible()

template<typename ExecSpace >
KOKKOS_FORCEINLINE_FUNCTION constexpr bool PACMAN::RbfPum::IsHostAccessible ( void  )
constexpr

Definition at line 32 of file utils.hpp.

◆ PrintCudaMemoryUsage()

static void PACMAN::RbfPum::PrintCudaMemoryUsage ( )
inlinestatic

If Cuda is activated, prints the used Nvidia device memory, else do nothing.

Definition at line 46 of file utils.hpp.

◆ PrintSizeOfView()

template<typename ViewType >
void PACMAN::RbfPum::PrintSizeOfView ( ViewType &  v)

Prints the memory usage of a Kokkos::View

Template Parameters
ViewTypeAny Kokkos::View type specialization
Parameters
vThe view to print the size of

Definition at line 60 of file utils.hpp.

◆ PrintView()

template<typename ViewType >
void PACMAN::RbfPum::PrintView ( ViewType &  v,
std::string  sep = " " 
)

Definition at line 77 of file utils.hpp.

References PACMAN::fp_consts::set_precision().

◆ RbfPumMinMax()

template<typename ViewType , typename Comparator >
KOKKOS_INLINE_FUNCTION auto PACMAN::RbfPum::RbfPumMinMax ( const ViewType &  v,
const Comparator op 
)

A reimplementation of Kokkos::MinMax which works on any backend.

Template Parameters
ViewTypeAny Kokkos::View type specialization
ComparatorType of the comparison functor
Parameters
vThe view we want the min max of
opThe comparison functor, must define operator(a, b) to compare values

Definition at line 110 of file utils.hpp.

Referenced by SerialDeactivateOneAxis().

◆ SerialDeactivateOneAxis()

template<KokkosViewRank< 1 > SourceType, KokkosViewRank< 1 > OffsType, KokkosArray AxisType, int_t dim = AxisType::size()>
KOKKOS_INLINE_FUNCTION int_t PACMAN::RbfPum::SerialDeactivateOneAxis ( const SourceType src,
const OffsType offs,
AxisType activeAxis 
)

Deactivate one axis, the one with the smallest range of values and returns the index of this deactivated axis.

Template Parameters
SourceTypeSource points view type
OffsTypeAccess offsets view
AxisTypeA Kokkos::Array<Dim>
Parameters
srcSource points view
offsAccess offsets for the source points views, to access the points of this local cluster
activeAxisA Kokkos::Array which holds the axis status
Returns
The index of the deactivated axis

Definition at line 30 of file serial_ops.hpp.

References PACMAN::fp_consts::max(), and RbfPumMinMax().

Referenced by SerialFillQ().

◆ SerialFillPoly()

template<KokkosViewRank< 2 > PViewType, KokkosViewRank< 1 > XViewType, KokkosViewRank< 1 > OffsViewType, KokkosArray AxisType, int_t dim = AxisType::size()>
KOKKOS_FUNCTION void PACMAN::RbfPum::SerialFillPoly ( PViewType P,
const XViewType X,
const OffsViewType XOffs,
AxisType activeAxis 
)

Fill the polynomial augmentation matrix accordingly to the activated axis in activeAxis

Template Parameters
PViewTypeThe polynomial matrix type
XViewTypeSource point view type
OffsViewTypeAccess offsets for the source view type
AxisTypeA Kokkos::Array<Dim>
Parameters
PPolynomial augmentation matrix (Q or V)
XSource points view
XOffsAccess offsets for the source points views, to access the points of this local cluster
activeAxisA Kokkos::Array which holds the axis status

Definition at line 73 of file serial_ops.hpp.

References PACMAN::fp_consts::one().

Referenced by SerialFillQ().

◆ SerialFillQ()

template<KokkosViewRank< 2 > QViewType, KokkosViewRank< 1 > XViewType, KokkosViewRank< 1 > XOffsType, KokkosViewRank< 1 > WViewType, KokkosArray AxisType, int_t dim = AxisType::size()>
KOKKOS_FORCEINLINE_FUNCTION int_t PACMAN::RbfPum::SerialFillQ ( QViewType Q,
const XViewType X,
const XOffsType XOffs,
WViewType W,
AxisType activeAxis 
)

Fill the polynomial augmentation matrix Q and sets activeAxis accordingly to the deactivated axis in SerialDeactivateOneAxis

Template Parameters
QViewTypeThe polynomial matrix Q type
XViewTypeSource point view type
OffsViewTypeAccess offsets for the source view type
WViewTypeAdditional workspace view type
AxisTypeA Kokkos::Array<Dim>
Parameters
QPolynomial augmentation matrix Q
XSource points view
XOffsAccess offsets for the source points views, to access the points of this local cluster
WAdditional workspace view
activeAxisA Kokkos::Array which holds the axis status
Returns
The number of active axis at the end of the function

Definition at line 111 of file serial_ops.hpp.

References PACMAN::fp_consts::epsilon(), SerialDeactivateOneAxis(), SerialFillPoly(), SerialSVD(), and PACMAN::fp_consts::zero().

◆ SerialMulMatVec()

template<KokkosViewRank< 2 > AViewType, KokkosViewRank< 1 > BViewType, KokkosViewRank< 1 > OutViewType>
KOKKOS_FORCEINLINE_FUNCTION void PACMAN::RbfPum::SerialMulMatVec ( const AViewType A,
const BViewType B,
OutViewType out 
)

Perform: out = Ab.

This function is a wrapper on KB::SerialGemv

Template Parameters
AViewTypeThe matrix A type
BViewTypeThe vector B type
OutViewTypeThe output view type
Parameters
AThe matrix A
BThe vector B
outThe output vector of out = Ab
Returns
The number of active axis at the end of the function

Definition at line 152 of file serial_ops.hpp.

References PACMAN::fp_consts::one(), and PACMAN::fp_consts::zero().

◆ SerialSolveLU()

template<KokkosViewRank< 2 > AViewType, KokkosViewRank< 1 > BViewType>
KOKKOS_FORCEINLINE_FUNCTION void PACMAN::RbfPum::SerialSolveLU ( AViewType A,
BViewType B 
)

Solves AX=B for X using a LU factorization on A.

Template Parameters
AViewTypeType of the matrix A (a concept enforces a Kokkos::View of rank 2)
BViewTypeType of the vector B (a concept enforces a Kokkos::View of rank 1).
Parameters
[in]AA rank 2 view of scalars, with the extents (N, M).
[in,out]BA rank 1 view of scalars, with the extents (N, 1).

Definition at line 77 of file serial_solve.hpp.

◆ SerialSolveQR()

template<KokkosViewRank< 2 > AViewType, KokkosViewRank< 2 > BViewType, KokkosViewRank< 1 > TViewType, KokkosViewRank< 2 > XViewType, KokkosViewRank< 1 > WViewType>
KOKKOS_FORCEINLINE_FUNCTION auto PACMAN::RbfPum::SerialSolveQR ( AViewType A,
const BViewType B,
TViewType T,
XViewType X,
WViewType W 
)

Solves AX=B for X using a QR factorization on A.

Template Parameters
AViewTypeType of the matrix A (a concept enforces a Kokkos::View of rank 2)
BViewTypeType of the vector B (a concept enforces a Kokkos::View of rank 2). The rank 2 is necessary for KB::ApplyQ.
TViewTypeType of the vector T (a concept enforces a Kokkos::View of rank 1).
XViewTypeType of the vector X (a concept enforces a Kokkos::View of rank 2). The rank 2 is necessary for KB::ApplyQ.
WViewTypeType of the vector W (a concept enforces a Kokkos::View of rank 1).
Parameters
[in]AA rank 2 view of scalars, with the extents (N, M).
[in]BA rank 2 view of scalars, with the extents (N, 1).
TA rank 1 (non-initialized) view of scalars, of length M.
[out]XA rank 2 (non-initialized) view of scalars, of length (N, 1), it is the output parameter (only the M first values are relevant as an output).
WA rank 1 (non-initialized) view of scalars, of length max(N, M), it must be created with the LayoutRight view argument.
Note
B is the only parameter which is guaranteed to not be modified. Caps variables are matrices, others are vectors.

Definition at line 49 of file serial_solve.hpp.

References PACMAN::fp_consts::one().

◆ SerialSVD()

template<KokkosViewRank< 2 > AViewType, KokkosViewRank< 1 > SViewType, KokkosViewRank< 1 > WViewType>
KOKKOS_FORCEINLINE_FUNCTION void PACMAN::RbfPum::SerialSVD ( AViewType A,
SViewType S,
WViewType W 
)

Perform a partial SVD decomposition, to fetch only the singular values of A.

Template Parameters
AViewTypeType of the matrix A (a concept enforces a Kokkos::View of rank 2)
SViewTypeType of the vector S (a concept enforces a Kokkos::View of rank 1).
WViewTypeType of the vector W (a concept enforces a Kokkos::View of rank 1).
Parameters
[in]AA rank 2 view of scalars, with the extents (N, M).
[out]SA rank 1 view of scalars, which contains the singular values of A, in decreasing order, of length M.
WA rank 1 (non-initialized) view of scalars, of length max(N, M).
Note
A is modified by the SVD, and contains undefined values when this function returns.

Definition at line 102 of file serial_solve.hpp.

References PACMAN::fp_consts::epsilon().

Referenced by SerialFillQ().

◆ SerialVecVecAdd()

template<KokkosViewRank< 1 > UViewType, KokkosViewRank< 1 > VViewType>
KOKKOS_FORCEINLINE_FUNCTION void PACMAN::RbfPum::SerialVecVecAdd ( UViewType U,
const VViewType V 
)

Perform an inplace addition of 2 vectors such as U = U + V.

Template Parameters
UViewTypeThe vector U view type
VViewTypeThe vector V view type
Parameters
[in,out]UThe vector U view
[in]VThe vector V view

Definition at line 165 of file serial_ops.hpp.

◆ SerialVecVecSub()

template<KokkosViewRank< 1 > UViewType, KokkosViewRank< 1 > VViewType>
KOKKOS_FORCEINLINE_FUNCTION void PACMAN::RbfPum::SerialVecVecSub ( UViewType U,
const VViewType V 
)

Perform an inplace difference of 2 vectors such as U = U - V.

Template Parameters
UViewTypeThe vector U view type
VViewTypeThe vector V view type
Parameters
[in,out]UThe vector U view
[in]VThe vector V view

Definition at line 179 of file serial_ops.hpp.

◆ SquaredDifference()

template<int_t Dim>
KOKKOS_INLINE_FUNCTION fp_t PACMAN::RbfPum::SquaredDifference ( const ::ArborX::Point< Dim, coordinates_t > &  lhs,
const ::ArborX::Point< Dim, coordinates_t > &  rhs 
)
noexcept

Returns the squared distance between two points, and check for NaN values.

Template Parameters
DimThe space dimension of both points
Parameters
lhsSource ArborX::Point
rhsTarget ArborX::Point
Returns
$\sigma_{i=0}^{Dim}\left(rhs_i - lhs_i)^2\right)$ if both lhs and rhs are valid (no NaN value) else returns -1.0

Definition at line 127 of file operators.hpp.

References PACMAN::fp_consts::one(), and PACMAN::fp_consts::zero().

Referenced by Distance(), PACMAN::RbfPum::TagEmptyCentersCallback< ViewType >::operator()(), and PACMAN::RbfPum::DistanceToKNearestCallback::operator()().

◆ SquaredDifferenceNoCheck()

template<int_t Dim>
KOKKOS_INLINE_FUNCTION fp_t PACMAN::RbfPum::SquaredDifferenceNoCheck ( const ::ArborX::Point< Dim, coordinates_t > &  lhs,
const ::ArborX::Point< Dim, coordinates_t > &  rhs 
)

Returns the squared distance between two points, and don't check for NaN values.

Template Parameters
DimThe space dimension of both points
Parameters
lhsSource ArborX::Point
rhsTarget ArborX::Point
Returns
$\sigma_{i=0}^{Dim}\left(rhs_i - lhs_i)^2\right)$

Definition at line 165 of file operators.hpp.

References PACMAN::fp_consts::zero().

Referenced by DistanceNoCheck().

◆ TeamFillA()

template<typename TeamHandleType , KokkosViewRank< 2 > AViewType, KokkosViewRank< 1 > XType, KokkosViewRank< 1 > XOffsType, RBFFunction RbfFuncType>
KOKKOS_FORCEINLINE_FUNCTION void PACMAN::RbfPum::TeamFillA ( const TeamHandleType teamHandle,
const AViewType A,
const XType X,
const XOffsType XOffs,
const RbfFuncType func 
)

Fills the RBF matrix A in parallel.

This function must not be called in a nested parallel loop

Template Parameters
TeamHandleTypeType of the team of threads
AViewTypeType of the matrix A (a concept enforces Kokkos::View of rank 2)
XTypeType of the source points view (a concept enforces Kokkos::View of rank 1)
XOffsTypeType of the access offsets associated to the source points (a concept enforces Kokkos::View of rank 1)
RbfFuncTypeA RBF function (for instance: Wendland functions), a concept enforces that function.Eval exists
Parameters
teamHandleThe Kokkos object which represents the team of threads
AThe RBF matrix we are filling
XThe source points contained in the local cluster
XOffsThe access offsets of the local cluster points in the source points view
funcThe RBF function we use to compute values to assign to A
Note
A is symmetric, and is filled 2 values by 2 values using this property

Definition at line 39 of file team_ops.hpp.

References DistanceNoCheck().

◆ TeamFillB()

template<typename TeamHandleType , KokkosViewRank< 1 > BViewType, KokkosViewRank< 1 > XType, KokkosViewRank< 1 > XOffsType>
KOKKOS_FORCEINLINE_FUNCTION void PACMAN::RbfPum::TeamFillB ( const TeamHandleType teamHandle,
BViewType B,
const XType X,
const XOffsType XOffs 
)

Fills the vector of known source values B in parallel.

This function must not be called in a nested parallel loop

Template Parameters
TeamHandleTypeType of the team of threads
BViewTypeType of the vector B (a concept enforces Kokkos::View of rank 1)
XTypeType of the source points view (a concept enforces Kokkos::View of rank 1)
XOffsTypeType of the access offsets associated to the source points (a concept enforces Kokkos::View of rank 1)
Parameters
teamHandleThe Kokkos object which represents the team of threads
BThe known source values vector B we are filling
XThe source points contained in the local cluster
XOffsThe access offsets of the local cluster points in the source points view

Definition at line 115 of file team_ops.hpp.

◆ TeamFillE()

template<typename TeamHandleType , KokkosViewRank< 2 > AViewType, KokkosViewRank< 1 > XType, KokkosViewRank< 1 > XOffsType, KokkosViewRank< 1 > YType, KokkosViewRank< 1 > YOffsType, RBFFunction RbfFuncType>
KOKKOS_FORCEINLINE_FUNCTION void PACMAN::RbfPum::TeamFillE ( const TeamHandleType teamHandle,
AViewType A,
const XType X,
const XOffsType XOffs,
const YType Y,
const YOffsType YOffs,
const RbfFuncType func 
)

Fills the RBF evaluation matrix E in parallel.

This function must not be called in a nested parallel loop

Template Parameters
TeamHandleTypeType of the team of threads
AViewTypeType of the matrix E (a concept enforces Kokkos::View of rank 2)
XTypeType of the source points view (a concept enforces Kokkos::View of rank 1)
XOffsTypeType of the access offsets associated to the source points (a concept enforces Kokkos::View of rank 1)
YTypeType of the target points view (a concept enforces Kokkos::View of rank 1)
YOffsTypeType of the access offsets associated to the target points (a concept enforces Kokkos::View of rank 1)
RbfFuncTypeA RBF function (for instance: Wendland functions), a concept enforces that function.Eval exists
Parameters
teamHandleThe Kokkos object which represents the team of threads
AThe RBF evaluation matrix we are filling
XThe source points contained in the local cluster
XOffsThe access offsets of the local cluster points in the source points view
YThe target points contained in the local cluster
YOffsThe access offsets of the local cluster points in the target points view
funcThe RBF function we use to compute values to assign to A

Definition at line 83 of file team_ops.hpp.

References DistanceNoCheck().

◆ ZCurveNeighborOffsets()

template<int_t Dim>
constexpr auto PACMAN::RbfPum::ZCurveNeighborOffsets ( int_t  shape[Dim])
constexpr

Return the indices offsets of the spatial neighbors given the shape of the space.

Template Parameters
DimThe dimension of the space.
Parameters
shapeThe number of regions in each direction (each axis).
Returns
An std::array of size 3^{Dim} - 1 which contains the offset to apply to each point to get its neighbors.

Definition at line 34 of file clustering.hpp.

◆ ZCurveNeighborOffsets< 2 >()

template<>
constexpr auto PACMAN::RbfPum::ZCurveNeighborOffsets< 2 > ( int_t  shape[2])
constexpr

: 2D specialization of ZCurveNeighborOffsets for faster computations

Definition at line 72 of file clustering.hpp.

◆ ZCurveNeighborOffsets< 3 >()

template<>
constexpr auto PACMAN::RbfPum::ZCurveNeighborOffsets< 3 > ( int_t  shape[3])
constexpr

: 3D specialization of ZCurveNeighborOffsets for faster computations

Definition at line 93 of file clustering.hpp.