28 #ifndef SCIMATH_MATRIXMATHLA_H
29 #define SCIMATH_MATRIXMATHLA_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Arrays/Vector.h>
34 #include <casacore/casa/Arrays/Matrix.h>
35 #include <casacore/casa/BasicSL/Complex.h>
103 #if !defined(NEED_FORTRAN_UNDERSCORES)
104 #define NEED_FORTRAN_UNDERSCORES 1
107 #if NEED_FORTRAN_UNDERSCORES
108 #define sgetrf sgetrf_
109 #define dgetrf dgetrf_
110 #define cgetrf cgetrf_
111 #define zgetrf zgetrf_
112 #define sgetri sgetri_
113 #define dgetri dgetri_
114 #define cgetri cgetri_
115 #define zgetri zgetri_
120 #define spotri spotri_
121 #define dpotri dpotri_
122 #define cpotri cpotri_
123 #define zpotri zpotri_
127 void sgetrf(
const int *m,
const int *n,
float *a,
const int *lda,
128 int *ipiv,
int *info);
129 void dgetrf(
const int *m,
const int *n,
double *a,
const int *lda,
130 int *ipiv,
int *info);
132 int *ipiv,
int *info);
134 int *ipiv,
int *info);
135 void sgetri(
const int *m,
float *a,
const int *lda,
const int *ipiv,
136 float *work,
const int *lwork,
int *info);
137 void dgetri(
const int *m,
double *a,
const int *lda,
const int *ipiv,
138 double *work,
const int *lwork,
int *info);
140 Complex *work,
const int *lwork,
int *info);
142 DComplex *work,
const int *lwork,
int *info);
145 void sposv(
const char *uplo,
const int *n,
const int* nrhs,
float *a,
146 const int *lda,
float *b,
const int *ldb,
int *info);
147 void dposv(
const char *uplo,
const int *n,
const int* nrhs,
double *a,
148 const int *lda,
double *b,
const int *ldb,
int *info);
149 void cposv(
const char *uplo,
const int *n,
const int* nrhs,
Complex *a,
150 const int *lda,
Complex *b,
const int *ldb,
int *info);
152 const int *lda,
DComplex *b,
const int *ldb,
int *info);
155 void spotri(
const char *uplo,
const int *n,
float *a,
156 const int *lda,
int *info);
157 void dpotri(
const char *uplo,
const int *n,
double *a,
158 const int *lda,
int *info);
160 const int *lda,
int *info);
162 const int *lda,
int *info);
167 inline void getrf(
const int *m,
const int *n,
float *a,
const int *lda,
168 int *ipiv,
int *info)
169 {
sgetrf(m, n, a, lda, ipiv, info); }
170 inline void getrf(
const int *m,
const int *n,
double *a,
const int *lda,
171 int *ipiv,
int *info)
172 {
dgetrf(m, n, a, lda, ipiv, info); }
173 inline void getrf(
const int *m,
const int *n,
Complex *a,
const int *lda,
174 int *ipiv,
int *info)
175 {
cgetrf(m, n, a, lda, ipiv, info); }
177 int *ipiv,
int *info)
178 {
zgetrf(m, n, a, lda, ipiv, info); }
179 inline void getri(
const int *m,
float *a,
const int *lda,
const int *ipiv,
180 float *work,
const int *lwork,
int *info)
181 {
sgetri(m, a, lda, ipiv, work, lwork, info); }
182 inline void getri(
const int *m,
double *a,
const int *lda,
const int *ipiv,
183 double *work,
const int *lwork,
int *info)
184 {
dgetri(m, a, lda, ipiv, work, lwork, info); }
185 inline void getri(
const int *m,
Complex *a,
const int *lda,
const int *ipiv,
186 Complex *work,
const int *lwork,
int *info)
187 {
cgetri(m, a, lda, ipiv, work, lwork, info); }
188 inline void getri(
const int *m,
DComplex *a,
const int *lda,
const int *ipiv,
189 DComplex *work,
const int *lwork,
int *info)
190 {
zgetri(m, a, lda, ipiv, work, lwork, info); }
192 inline void posv(
const char *uplo,
const int *n,
const int* nrhs,
float *a,
193 const int *lda,
float *b,
const int *ldb,
int *info)
194 {
sposv(uplo, n, nrhs, a, lda, b, ldb, info); }
195 inline void posv(
const char *uplo,
const int *n,
const int* nrhs,
double *a,
196 const int *lda,
double *b,
const int *ldb,
int *info)
197 {
dposv(uplo, n, nrhs, a, lda, b, ldb, info); }
198 inline void posv(
const char *uplo,
const int *n,
const int* nrhs,
Complex *a,
199 const int *lda,
Complex *b,
const int *ldb,
int *info)
200 {
cposv(uplo, n, nrhs, a, lda, b, ldb, info); }
201 inline void posv(
const char *uplo,
const int *n,
const int* nrhs,
DComplex *a,
202 const int *lda,
DComplex *b,
const int *ldb,
int *info)
203 {
zposv(uplo, n, nrhs, a, lda, b, ldb, info); }
205 inline void potri(
const char *uplo,
const int *n,
float *a,
206 const int *lda,
int *info)
207 {
spotri(uplo, n, a, lda, info); }
208 inline void potri(
const char *uplo,
const int *n,
double *a,
209 const int *lda,
int *info)
210 {
dpotri(uplo, n, a, lda, info); }
212 const int *lda,
int *info)
213 {
cpotri(uplo, n, a, lda, info); }
215 const int *lda,
int *info)
216 {
zpotri(uplo, n, a, lda, info); }
222 #ifndef CASACORE_NO_AUTO_TEMPLATES
223 #include <casacore/scimath/Mathematics/MatrixMathLA.tcc>
std::complex< Float > Complex
std::complex< Double > DComplex
this file contains all the compiler specific defines
void zgetri(const int *m, DComplex *a, const int *lda, const int *ipiv, DComplex *work, const int *lwork, int *info)
void cpotri(const char *uplo, const int *n, Complex *a, const int *lda, int *info)
void spotri(const char *uplo, const int *n, float *a, const int *lda, int *info)
void sposv(const char *uplo, const int *n, const int *nrhs, float *a, const int *lda, float *b, const int *ldb, int *info)
void zgetrf(const int *m, const int *n, DComplex *a, const int *lda, int *ipiv, int *info)
void zpotri(const char *uplo, const int *n, DComplex *a, const int *lda, int *info)
void zposv(const char *uplo, const int *n, const int *nrhs, DComplex *a, const int *lda, DComplex *b, const int *ldb, int *info)
void CholeskySolve(Matrix< T > &A, Vector< T > &diag, Vector< T > &b, Vector< T > &x)
void sgetri(const int *m, float *a, const int *lda, const int *ipiv, float *work, const int *lwork, int *info)
void dposv(const char *uplo, const int *n, const int *nrhs, double *a, const int *lda, double *b, const int *ldb, int *info)
void dgetrf(const int *m, const int *n, double *a, const int *lda, int *ipiv, int *info)
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 cposv(const char *uplo, const int *n, const int *nrhs, Complex *a, const int *lda, Complex *b, const int *ldb, int *info)
void potri(const char *uplo, const int *n, float *a, const int *lda, int *info)
void cgetrf(const int *m, const int *n, Complex *a, const int *lda, int *ipiv, int *info)
void dpotri(const char *uplo, const int *n, double *a, const int *lda, int *info)
void sgetrf(const int *m, const int *n, float *a, const int *lda, int *ipiv, int *info)
void cgetri(const int *m, Complex *a, const int *lda, const int *ipiv, Complex *work, const int *lwork, 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)
void dgetri(const int *m, double *a, const int *lda, const int *ipiv, double *work, const int *lwork, int *info)
T determinate(const Matrix< T > &in)
Matrix< T > invertSymPosDef(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 > invert(const Matrix< T > &in)