26#ifndef SCIMATH_MATRIXMATHLA_H
27#define SCIMATH_MATRIXMATHLA_H
29#include <casacore/casa/aips.h>
30#include <casacore/casa/Arrays/Vector.h>
31#include <casacore/casa/Arrays/Matrix.h>
32#include <casacore/casa/BasicSL/Complex.h>
102#if !defined(NEED_FORTRAN_UNDERSCORES)
103#define NEED_FORTRAN_UNDERSCORES 1
106#if NEED_FORTRAN_UNDERSCORES
107#define sgetrf sgetrf_
108#define dgetrf dgetrf_
109#define cgetrf cgetrf_
110#define zgetrf zgetrf_
111#define sgetri sgetri_
112#define dgetri dgetri_
113#define cgetri cgetri_
114#define zgetri zgetri_
119#define spotri spotri_
120#define dpotri dpotri_
121#define cpotri cpotri_
122#define zpotri zpotri_
126void sgetrf(
const int *m,
const int *n,
float *a,
const int *lda,
int *ipiv,
int *info);
127void dgetrf(
const int *m,
const int *n,
double *a,
const int *lda,
int *ipiv,
int *info);
128void cgetrf(
const int *m,
const int *n, Complex *a,
const int *lda,
int *ipiv,
int *info);
129void zgetrf(
const int *m,
const int *n, DComplex *a,
const int *lda,
int *ipiv,
int *info);
130void sgetri(
const int *m,
float *a,
const int *lda,
const int *ipiv,
float *work,
const int *lwork,
132void dgetri(
const int *m,
double *a,
const int *lda,
const int *ipiv,
double *work,
133 const int *lwork,
int *info);
134void cgetri(
const int *m, Complex *a,
const int *lda,
const int *ipiv, Complex *work,
135 const int *lwork,
int *info);
136void zgetri(
const int *m, DComplex *a,
const int *lda,
const int *ipiv, DComplex *work,
137 const int *lwork,
int *info);
139void sposv(
const char *uplo,
const int *n,
const int *nrhs,
float *a,
const int *lda,
float *b,
140 const int *ldb,
int *info);
141void dposv(
const char *uplo,
const int *n,
const int *nrhs,
double *a,
const int *lda,
double *b,
142 const int *ldb,
int *info);
143void cposv(
const char *uplo,
const int *n,
const int *nrhs, Complex *a,
const int *lda, Complex *b,
144 const int *ldb,
int *info);
145void zposv(
const char *uplo,
const int *n,
const int *nrhs, DComplex *a,
const int *lda,
146 DComplex *b,
const int *ldb,
int *info);
148void spotri(
const char *uplo,
const int *n,
float *a,
const int *lda,
int *info);
149void dpotri(
const char *uplo,
const int *n,
double *a,
const int *lda,
int *info);
150void cpotri(
const char *uplo,
const int *n, Complex *a,
const int *lda,
int *info);
151void zpotri(
const char *uplo,
const int *n, DComplex *a,
const int *lda,
int *info);
155inline void getrf(
const int *m,
const int *n,
float *a,
const int *lda,
int *ipiv,
int *info) {
156 sgetrf(m, n, a, lda, ipiv, info);
158inline void getrf(
const int *m,
const int *n,
double *a,
const int *lda,
int *ipiv,
int *info) {
159 dgetrf(m, n, a, lda, ipiv, info);
161inline void getrf(
const int *m,
const int *n, Complex *a,
const int *lda,
int *ipiv,
int *info) {
162 cgetrf(m, n, a, lda, ipiv, info);
164inline void getrf(
const int *m,
const int *n, DComplex *a,
const int *lda,
int *ipiv,
int *info) {
165 zgetrf(m, n, a, lda, ipiv, info);
167inline void getri(
const int *m,
float *a,
const int *lda,
const int *ipiv,
float *work,
168 const int *lwork,
int *info) {
169 sgetri(m, a, lda, ipiv, work, lwork, info);
171inline void getri(
const int *m,
double *a,
const int *lda,
const int *ipiv,
double *work,
172 const int *lwork,
int *info) {
173 dgetri(m, a, lda, ipiv, work, lwork, info);
175inline void getri(
const int *m, Complex *a,
const int *lda,
const int *ipiv, Complex *work,
176 const int *lwork,
int *info) {
177 cgetri(m, a, lda, ipiv, work, lwork, info);
179inline void getri(
const int *m, DComplex *a,
const int *lda,
const int *ipiv, DComplex *work,
180 const int *lwork,
int *info) {
181 zgetri(m, a, lda, ipiv, work, lwork, info);
184inline void posv(
const char *uplo,
const int *n,
const int *nrhs,
float *a,
const int *lda,
185 float *b,
const int *ldb,
int *info) {
186 sposv(uplo, n, nrhs, a, lda, b, ldb, info);
188inline void posv(
const char *uplo,
const int *n,
const int *nrhs,
double *a,
const int *lda,
189 double *b,
const int *ldb,
int *info) {
190 dposv(uplo, n, nrhs, a, lda, b, ldb, info);
192inline void posv(
const char *uplo,
const int *n,
const int *nrhs, Complex *a,
const int *lda,
193 Complex *b,
const int *ldb,
int *info) {
194 cposv(uplo, n, nrhs, a, lda, b, ldb, info);
196inline void posv(
const char *uplo,
const int *n,
const int *nrhs, DComplex *a,
const int *lda,
197 DComplex *b,
const int *ldb,
int *info) {
198 zposv(uplo, n, nrhs, a, lda, b, ldb, info);
201inline void potri(
const char *uplo,
const int *n,
float *a,
const int *lda,
int *info) {
202 spotri(uplo, n, a, lda, info);
204inline void potri(
const char *uplo,
const int *n,
double *a,
const int *lda,
int *info) {
205 dpotri(uplo, n, a, lda, info);
207inline void potri(
const char *uplo,
const int *n, Complex *a,
const int *lda,
int *info) {
208 cpotri(uplo, n, a, lda, info);
210inline void potri(
const char *uplo,
const int *n, DComplex *a,
const int *lda,
int *info) {
211 zpotri(uplo, n, a, lda, info);
216#ifndef CASACORE_NO_AUTO_TEMPLATES
217#include <casacore/scimath/Mathematics/MatrixMathLA.tcc>
For temporary backward namespace compatibility, use casa as alias for casacore.
void CholeskySolve(Matrix< T > &A, Vector< T > &diag, Vector< T > &b, Vector< T > &x)
void CholeskyDecomp(Matrix< T > &A, Vector< T > &diag)
void getri(const int *m, float *a, const int *lda, const int *ipiv, float *work, const int *lwork, int *info)
void potri(const char *uplo, const int *n, float *a, const int *lda, int *info)
void posv(const char *uplo, const int *n, const int *nrhs, float *a, const int *lda, float *b, const int *ldb, int *info)
void getrf(const int *m, const int *n, float *a, const int *lda, int *ipiv, int *info)
T determinate(const Matrix< T > &in)
void invert(Matrix< T > &out, T &determinate, const Matrix< T > &in)
Routines which calculate the inverse of a matrix.
void invertSymPosDef(Matrix< T > &out, T &determinate, const Matrix< T > &in)
This function inverts a symmetric positive definite matrix.
Matrix< T > invertSymPosDef(const Matrix< T > &in)
Matrix< T > invert(const Matrix< T > &in)