File lapack.hpp¶
-
namespace boosting
-
template<typename T>
class Lapack¶ - #include <lapack.hpp>
Allows to execute LAPACK routines.
- Template Parameters:
T – The type of the arrays on which the LAPACK routines should operate
Public Types
Public Functions
-
Lapack(const Routines &routines)¶
- Parameters:
routines – A reference to an object of type
Lapack::Routinesthat stores function pointers to all supported LAPACK routines
-
int querySysvLworkParameter(T *tmpArray1, T *output, int n) const¶
Determines and returns the optimal value for the parameter “lwork” as used by LAPACK’S SYSV routine.
This function must be run before attempting to solve a linear system using the function
sysvto determine the optimal value for the parameter “lwork”.- Parameters:
tmpArray1 – A pointer to an array of template type
T, shape(n, n)that will be used by the functionsysvto temporarily store values computed by the SYSV routine. May contain arbitrary valuesoutput – A pointer to an array of template type
T, shape(n), the solution of the system of linear equations should be written to by the functionsysv. May contain arbitrary valuesn – The number of equations in the linear system to be solved by the function
sysv
- Returns:
The optimal value for the parameter “lwork”
-
void sysv(T *tmpArray1, int *tmpArray2, T *tmpArray3, T *output, int n, int lwork) const¶
Computes and returns the solution to a linear system A * X = B using LAPACK’s DSYSV solver.
The function
querySysvLworkParametermust be run beforehand to determine the optimal value for the parameter “lwork” and to allocate a temporary array depending on this value.SYSV requires A to be a matrix with shape
(n, n), representing the coefficients, and B to be a matrix with shape(n, nrhs), representing the ordinates. X is a matrix of unknowns with shape(n, nrhs).SYSV will overwrite the matrices A and B. When terminated successfully, B will contain the solution to the system of linear equations. To retain their state, this function will copy the given arrays before invoking SYSV.
Furthermore, SYSV assumes the matrix of coefficients A to be symmetrical, i.e., it will only use the upper-right triangle of A, whereas the remaining elements are ignored. For reasons of space efficiency, this function expects the coefficients to be given as an array with shape
n * (n + 1) / 2, representing the elements of the upper-right triangle of A, where the columns are appended to each other and unspecified elements are omitted. This function will implicitly convert the given array into a matrix that is suited for SYSV.- Parameters:
tmpArray1 – A pointer to an array of template type
T, shape(n, n)that stores the coefficients in the matrix A. It will be used to temporarily store values computed by the SYSV routinetmpArray2 – A pointer to an array of type
int, shape(n)that will be used to temporarily store values computed by the SYSV routine. May contain arbitrary valuestmpArray3 – A pointer to an array of template type
T, shape(lwork)that will be used to temporarily store values computed by the SYSV routine. May contain arbitrary valuesoutput – A pointer to an array of template type
T, shape(n)that stores the ordinates in the matrix A. The solution of the system of linear equations will be written to this arrayn – The number of equations
lwork – The value for the parameter “lwork” to be used by the SYSV routine. Must have been determined using the function
querySysvLworkParameter
Private Members
-
const SysvFunction sysv_¶
-
struct Routines¶
- #include <lapack.hpp>
A struct that stores function pointers to all supported LAPACK routines.
Public Functions
-
inline explicit Routines(SysvFunction sysv)¶
- Parameters:
sysv – A function pointer to LAPACK’s SYSV routine
Public Members
-
const SysvFunction sysv¶
A function pointer to LAPACK’ SYSV routine.
-
inline explicit Routines(SysvFunction sysv)¶
-
class LapackFactory¶
- #include <lapack.hpp>
A factory that allows to create instances of type
Lapack.Public Functions
-
LapackFactory(const Lapack<float32>::Routines &float32Routines, const Lapack<float64>::Routines &float64Routines)¶
- Parameters:
float32Routines – A reference to an object of type
Lapack::Routinesthat stores function pointers to all supported LAPACK routines operating of 32-bit floating point valuesfloat64Routines – A reference to an object of type
Lapack::Routinesthat stores function pointers to all supported LAPACK routines operating of 64-bit floating point values
-
LapackFactory(const Lapack<float32>::Routines &float32Routines, const Lapack<float64>::Routines &float64Routines)¶
-
template<typename T>