File blas.hpp¶
-
namespace boosting¶
-
template<typename T>
class Blas¶ - #include <blas.hpp>
Allows to execute BLAS routines.
- Template Parameters:
T – The type of the arrays on which the BLAS routines should operate
Public Types
Public Functions
-
Blas(const Routines &routines)¶
- Parameters:
routines – A reference to an object of type
Blas::Routinesthat stores function pointers to all supported BLAS routines
-
T dot(T *x, T *y, int n) const¶
Computes and returns the dot product x * y of two vectors x and y using BLAS’ DDOT routine.
- Parameters:
x – A pointer to an array of template type
T, shape(n), representing the first vector xy – A pointer to an array of template type
T, shape(n), representing the second vector yn – The number of elements in the arrays
xandy
- Returns:
A scalar of template type
T, representing the result of the dot product x * y
-
void spmv(T *a, T *x, T *output, int n) const¶
Computes and returns the solution to the matrix-vector operation A * x using BLAS’ DSPMV routine.
SPMV expects the matrix A to be a symmetric matrix with shape
(n, n)and x to be an array with shape(n). The matrix A must be supplied in packed form, i.e., as an array with shape(n * (n + 1) / 2 )that consists of the columns of A appended to each other and omitting all unspecified elements.- Parameters:
a – A pointer to an array of template type
T, shape(n * (n + 1) / 2), representing the elements in the upper-right triangle of the matrix A in a packed formx – A pointer to an array of template type
T, shape(n), representing the elements in the array xoutput – A pointer to an array of template type
T, shape(n), the result of the matrix-vector operation A * x should be written to. May contain arbitrary valuesn – The number of elements in the arrays
aandx
-
struct Routines¶
- #include <blas.hpp>
A struct that stores function pointers to all supported BLAS routines.
Public Functions
-
inline Routines(DotFunction dot, SpmvFunction spmv)¶
- Parameters:
dot – A function pointer to BLAS’ DOT routine
spmv – A function pointer to BLAS’ SPMV routine
Public Members
-
const DotFunction dot¶
A function pointer to BLAS’ DOT routine.
-
const SpmvFunction spmv¶
A function pointer to BLAS’ SPMV routine.
-
inline Routines(DotFunction dot, SpmvFunction spmv)¶
-
class BlasFactory¶
- #include <blas.hpp>
A factory that allows to create instances of type
Blas.Public Functions
-
BlasFactory(const Blas<float32>::Routines &float32Routines, const Blas<float64>::Routines &float64Routines)¶
- Parameters:
float32Routines – A reference to an object of type
Blas::Routinesthat stores function pointers to all supported BLAS routines operating of 32-bit floating point valuesfloat64Routines – A reference to an object of type
Blas::Routinesthat stores function pointers to all supported BLAS routines operating of 64-bit floating point values
-
BlasFactory(const Blas<float32>::Routines &float32Routines, const Blas<float64>::Routines &float64Routines)¶
-
template<typename T>