Macaulay2 Engine
Loading...
Searching...
No Matches
lapack.hpp File Reference

Engine bridge into LAPACK for RR / CC dense linear algebra. More...

#include "aring-RR.hpp"
#include "aring-CC.hpp"
#include "aring-RRR.hpp"
#include "aring-CCC.hpp"
#include "dmat.hpp"

Go to the source code of this file.

Classes

class  Lapack
 Static-method namespace bridging the engine's RR / CC / RRR / CCC dense matrices and LAPACK / BLAS routines. More...

Typedefs

typedef DMat< M2::ARingRRRDMatRRR
typedef DMat< M2::ARingCCCDMatCCC
typedef DMat< M2::ARingRRDMatRR
typedef DMat< M2::ARingCCDMatCC

Functions

int dgesv_ (int *n, int *nrhs, double *a, int *lda, int *ipiv, double *b, int *ldb, int *info)
int dgeev_ (char *n, char *n2, int *size, double *M, int *size1, double *E, double *E2, double *, int *, double *, int *, double *, int *, int *)
int dsyev_ (char *n, char *n2, int *size, double *M, int *lda, double *eig, double *work, int *wsize, int *info)
void dgetrf_ (const int *rows, const int *cols, double *A, const int *ld, int *ipiv, int *info)
int dgesvd_ (char *jobU, char *jobV, int *rows, int *cols, double *A, int *ldA, double *Sigma, double *U, int *ldU, double *VT, int *ldVT, double *work, int *lwork, int *info)
int dgesdd_ (char *jobU, int *rows, int *cols, double *A, int *ldA, double *Sigma, double *U, int *ldU, double *VT, int *ldVT, double *work, int *lwork, int *iwork, int *info)
int dgels_ (char *job, int *rows, int *cols, int *nhrs, double *A, int *ldA, double *b, int *ldb, double *work, int *lwork, int *info)
int dgelss_ (int *rows, int *cols, int *nhrs, double *A, int *ldA, double *b, int *ldb, double *Sigma, double *rcond, int *rank, double *work, int *lwork, int *info)
int dgeqrf_ (int *m, int *n, double *A, int *lda, double *tau, double *work, int *lwork, int *info)
int dorgqr_ (int *m, int *n, int *k, double *A, int *lda, double *tau, double *work, int *lwork, int *info)
int zgeqrf_ (int *m, int *n, double *A, int *lda, double *tau, double *work, int *lwork, int *info)
int zungqr_ (int *m, int *n, int *k, double *A, int *lda, double *tau, double *work, int *lwork, int *info)
void cblas_daxpy (const int n, const double a, const double *x, const int incx, double *y, const int incy)
void cblas_dgemm (const int Order, const int TransA, const int TransB, const int M, const int N, const int K, const double alpha, const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc)
void cblas_dscal (const int n, const double a, double *x, const int incx)
int zgesv_ (int *n, int *nrhs, double *a, int *lda, int *ipiv, double *b, int *ldb, int *info)
int zgeev_ (char *n, char *n2, int *size, double *M, int *size1, double *E, double *l, int *lsize, double *r, int *rsize, double *w, int *wsize, double *rwork, int *info)
int zheev_ (char *n, char *n2, int *size, double *M, int *lda, double *eig, double *w, int *wsize, double *rwork, int *info)
int zgetrf_ (int *rows, int *cols, double *M, int *ld, int *ipiv, int *info)
int zgesvd_ (char *jobU, char *jobV, int *rows, int *cols, double *A, int *ldA, double *Sigma, double *U, int *ldU, double *VT, int *ldVT, double *w, int *lwork, double *rwork, int *info)
int zgesdd_ (char *jobU, int *rows, int *cols, double *A, int *ldA, double *Sigma, double *U, int *ldU, double *VT, int *ldVT, double *w, int *lwork, double *rwork, int *iwork, int *info)
int zgels_ (char *job, int *rows, int *cols, int *nhrs, double *A, int *ldA, double *b, int *ldb, double *work, int *lwork, int *info)
int zgelss_ (int *rows, int *cols, int *nhrs, double *A, int *ldA, double *b, int *ldb, double *Sigma, double *rcond, int *rank, double *work, int *lwork, double *rwork, int *info)
void cblas_zgemm (const int Order, const int TransA, const int TransB, const int M, const int N, const int K, const void *alpha, const void *A, const int lda, const void *B, const int ldb, const void *beta, void *C, const int ldc)

Detailed Description

Engine bridge into LAPACK for RR / CC dense linear algebra.

Note
AI-generated documentation. Verify against the source before relying on it.

Defines the four DMat<R> aliases the LAPACK path uses (DMatRR, DMatCC, DMatRRR, DMatCCC) and declares the Fortran ABI prototypes (dgesv_, dgeev_, dsyev_, dgetrf_, dgesvd_, zgesv_, zgeev_, ...) that the implementation forwards into for linear solve, LU, QR, SVD, eigenvalue, and least-squares work. Engine callers reach those routines through the static Lapack class declared further down: LU, solve, solve_triangular (real only), eigenvalues / eigenvectors, the real-symmetric eigenvalues_symmetric / eigenvectors_symmetric, the complex-hermitian eigenvalues_hermitian / eigenvectors_hermitian (separate methods, not a unified suffix), SVD / SVD_divide_conquer, least_squares / least_squares_deficient, and QR, each overloaded once for the hardware-precision aliases (DMatRR / DMatCC) and once for the MPFR-precision aliases (DMatRRR / DMatCCC); the MPFR overloads copy through double / complex<double> element by element, so the answer carries hardware precision regardless of the input ring.

The library is detected at configure time — the autotools macro M2/m4/ax_lapack.m4 resolves to whatever LAPACK build is available (system reference LAPACK, Apple Accelerate, OpenBLAS, ...). The neighbouring eigen.hpp covers the Eigen3-backed path used for the genuine MPFR-precision computations and as the #ifdef NO_LAPACK fallback for the hardware-precision aliases.

See also
dmat.hpp
eigen.hpp
aring-RR.hpp
aring-CC.hpp

Definition in file lapack.hpp.