HMLP: High-performance Machine Learning Primitives
hmlp::kernel_s< T, TP > Struct Template Reference

Public Member Functions

operator() (const void *param, const TP *x, const TP *y, size_t d) const
 
void operator() (const void *param, const TP *X, const TP *Y, size_t d, T *K, size_t m, size_t n) const
 

Static Public Member Functions

static T innerProduct (const TP *x, const TP *y, size_t d)
 
static void innerProducts (const TP *X, const TP *Y, size_t d, T *K, size_t m, size_t n)
 
static T squaredDistance (const TP *x, const TP *y, size_t d)
 
static void squaredDistances (const TP *X, const TP *Y, size_t d, T *K, size_t m, size_t n)
 

Public Attributes

kernel_type type
 
powe = 1
 
scal = 1
 
cons = 0
 
T * hi
 
T * hj
 
T * h
 
T(* user_element_function )(const void *param, const TP *x, const TP *y, size_t d) = nullptr
 
void(* user_matrix_function )(const void *param, const T *X, const T *Y, size_t d, T *K, size_t m, size_t n) = nullptr
 

Member Function Documentation

template<typename T, typename TP>
static T hmlp::kernel_s< T, TP >::innerProduct ( const TP *  x,
const TP *  y,
size_t  d 
)
inlinestatic

Compute a single inner product.

template<typename T, typename TP>
static void hmlp::kernel_s< T, TP >::innerProducts ( const TP *  X,
const TP *  Y,
size_t  d,
T *  K,
size_t  m,
size_t  n 
)
inlinestatic

Compute all pairwise inner products using GEMM_TN( 1.0, X, Y, 0.0, K ).

This BLAS function is defined in frame/base/blas_lapack.hpp.

template<typename T, typename TP>
T hmlp::kernel_s< T, TP >::operator() ( const void *  param,
const TP *  x,
const TP *  y,
size_t  d 
) const
inline

end switch ( type )

template<typename T, typename TP>
void hmlp::kernel_s< T, TP >::operator() ( const void *  param,
const TP *  X,
const TP *  Y,
size_t  d,
T *  K,
size_t  m,
size_t  n 
) const
inline

X should be at least d-by-m, and Y should be at least d-by-n.

end switch ( type )

template<typename T, typename TP>
static T hmlp::kernel_s< T, TP >::squaredDistance ( const TP *  x,
const TP *  y,
size_t  d 
)
inlinestatic

Compute a single squared distance.

template<typename T, typename TP>
static void hmlp::kernel_s< T, TP >::squaredDistances ( const TP *  X,
const TP *  Y,
size_t  d,
T *  K,
size_t  m,
size_t  n 
)
inlinestatic

Compute all pairwise squared distances.

This BLAS function is defined in frame/base/blas_lapack.hpp.

Member Data Documentation

template<typename T, typename TP>
T(* hmlp::kernel_s< T, TP >::user_element_function) (const void *param, const TP *x, const TP *y, size_t d) = nullptr

User-defined kernel functions.


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