OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
GSLLinalg.h File Reference
#include <algorithm>
#include <cmath>
#include <vector>
#include "Utilities/GSLComplex.h"
#include "Utilities/GSLMatrix.h"
Include dependency graph for GSLLinalg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gsl_permutation
 Permutation vector for LU decomposition. More...
 

Functions

gsl_permutationgsl_permutation_alloc (size_t n)
 Allocate an identity permutation of size \(n\).
 
void gsl_permutation_free (gsl_permutation *p)
 Free a permutation allocated by gsl_permutation_alloc.
 
int gsl_linalg_LU_decomp (gsl_matrix *A, gsl_permutation *p, int *signum)
 In-place LU decomposition with partial pivoting (real).
 
double gsl_linalg_LU_det (const gsl_matrix *LU, int signum)
 Determinant from LU decomposition (real).
 
int gsl_linalg_LU_invert (const gsl_matrix *LU, const gsl_permutation *p, gsl_matrix *inverse)
 Invert a matrix from its LU decomposition (real).
 
int gsl_linalg_complex_LU_decomp (gsl_matrix_complex *A, gsl_permutation *p, int *signum)
 In-place LU decomposition with partial pivoting (complex).
 
gsl_complex gsl_linalg_complex_LU_det (const gsl_matrix_complex *LU, int signum)
 Determinant from LU decomposition (complex).
 
int gsl_linalg_complex_LU_invert (const gsl_matrix_complex *LU, const gsl_permutation *p, gsl_matrix_complex *inverse)
 Invert a matrix from its LU decomposition (complex).
 
int gsl_linalg_LU_decomp_complex (gsl_matrix_complex *A, gsl_permutation *p, int *signum)
 Alias for gsl_linalg_complex_LU_decomp.
 
gsl_complex gsl_linalg_LU_det_complex (const gsl_matrix_complex *LU, int signum)
 Alias for gsl_linalg_complex_LU_det.
 
int gsl_linalg_LU_invert_complex (const gsl_matrix_complex *LU, const gsl_permutation *p, gsl_matrix_complex *inverse)
 Alias for gsl_linalg_complex_LU_invert.
 

Function Documentation

◆ gsl_linalg_complex_LU_decomp()

int gsl_linalg_complex_LU_decomp ( gsl_matrix_complex A,
gsl_permutation p,
int *  signum 
)
inline

In-place LU decomposition with partial pivoting (complex).

Computes \(P A = L U\), storing \(L\) and \(U\) in A.

Parameters
AInput/Output: matrix overwritten with LU factors.
pOutput: permutation encoding row swaps.
signumOutput: sign of the permutation ( \(\pm 1\)).
Returns
Output: 0 on success, -1 on failure (e.g. non-square or singular).

Definition at line 187 of file GSLLinalg.h.

References gsl_permutation::data, gsl_complex_abs(), gsl_complex_div(), gsl_complex_mul(), gsl_complex_sub(), gsl_matrix_complex_ptr(), gsl_matrix_complex::size1, and gsl_matrix_complex::size2.

Referenced by interpolation::MMatrix< Tmplt >::determinant(), gsl_linalg_LU_decomp_complex(), and interpolation::MMatrix< Tmplt >::invert().

Here is the call graph for this function:

◆ gsl_linalg_complex_LU_det()

gsl_complex gsl_linalg_complex_LU_det ( const gsl_matrix_complex LU,
int  signum 
)
inline

Determinant from LU decomposition (complex).

Computes \(\det(A) = \mathrm{signum} \prod_i U_{ii}\).

Parameters
LUInput: LU-decomposed matrix.
signumInput: sign from gsl_linalg_complex_LU_decomp.
Returns
Output: determinant value.

Definition at line 248 of file GSLLinalg.h.

References gsl_complex_mul(), gsl_matrix_complex_ptr(), and gsl_matrix_complex::size1.

Referenced by interpolation::MMatrix< Tmplt >::determinant(), and gsl_linalg_LU_det_complex().

Here is the call graph for this function:

◆ gsl_linalg_complex_LU_invert()

int gsl_linalg_complex_LU_invert ( const gsl_matrix_complex LU,
const gsl_permutation p,
gsl_matrix_complex inverse 
)
inline

Invert a matrix from its LU decomposition (complex).

Computes \(A^{-1}\) using the stored \(L,U\) factors and permutation.

Parameters
LUInput: LU-decomposed matrix.
pInput: permutation from gsl_linalg_complex_LU_decomp.
inverseOutput: matrix to receive \(A^{-1}\).
Returns
Output: 0 on success, -1 on size mismatch.

Definition at line 263 of file GSLLinalg.h.

References gsl_permutation::data, gsl_complex_add(), gsl_complex_div(), gsl_complex_mul(), gsl_complex_sub(), gsl_matrix_complex_ptr(), gsl_matrix_complex::size1, and gsl_matrix_complex::size2.

Referenced by gsl_linalg_LU_invert_complex(), and interpolation::MMatrix< Tmplt >::invert().

Here is the call graph for this function:

◆ gsl_linalg_LU_decomp()

int gsl_linalg_LU_decomp ( gsl_matrix A,
gsl_permutation p,
int *  signum 
)
inline

In-place LU decomposition with partial pivoting (real).

Computes \(P A = L U\), storing \(L\) (unit lower) and \(U\) in A. The permutation p encodes \(P\).

Parameters
AInput/Output: matrix overwritten with LU factors.
pOutput: permutation encoding row swaps.
signumOutput: sign of the permutation ( \(\pm 1\)).
Returns
Output: 0 on success, -1 on failure (e.g. non-square or singular).

Definition at line 66 of file GSLLinalg.h.

References gsl_permutation::data, gsl_matrix_ptr(), gsl_matrix::size1, and gsl_matrix::size2.

Referenced by interpolation::MMatrix< Tmplt >::determinant(), interpolation::MMatrix< Tmplt >::invert(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

Here is the call graph for this function:

◆ gsl_linalg_LU_decomp_complex()

int gsl_linalg_LU_decomp_complex ( gsl_matrix_complex A,
gsl_permutation p,
int *  signum 
)
inline

Alias for gsl_linalg_complex_LU_decomp.

Parameters
AInput/Output: matrix overwritten with LU factors.
pOutput: permutation encoding row swaps.
signumOutput: sign of the permutation ( \(\pm 1\)).
Returns
Output: 0 on success, -1 on failure.

Definition at line 319 of file GSLLinalg.h.

References gsl_linalg_complex_LU_decomp().

Referenced by TEST_F(), TEST_F(), and TEST_F().

Here is the call graph for this function:

◆ gsl_linalg_LU_det()

double gsl_linalg_LU_det ( const gsl_matrix LU,
int  signum 
)
inline

Determinant from LU decomposition (real).

Computes \(\det(A) = \mathrm{signum} \prod_i U_{ii}\).

Parameters
LUInput: LU-decomposed matrix.
signumInput: sign from gsl_linalg_LU_decomp.
Returns
Output: determinant value.

Definition at line 124 of file GSLLinalg.h.

References gsl_matrix_ptr(), and gsl_matrix::size1.

Referenced by interpolation::MMatrix< Tmplt >::determinant(), and TEST_F().

Here is the call graph for this function:

◆ gsl_linalg_LU_det_complex()

gsl_complex gsl_linalg_LU_det_complex ( const gsl_matrix_complex LU,
int  signum 
)
inline

Alias for gsl_linalg_complex_LU_det.

Parameters
LUInput: LU-decomposed matrix.
signumInput: sign from decomposition.
Returns
Output: determinant value.

Definition at line 327 of file GSLLinalg.h.

References gsl_linalg_complex_LU_det().

Referenced by TEST_F().

Here is the call graph for this function:

◆ gsl_linalg_LU_invert()

int gsl_linalg_LU_invert ( const gsl_matrix LU,
const gsl_permutation p,
gsl_matrix inverse 
)
inline

Invert a matrix from its LU decomposition (real).

Computes \(A^{-1}\) using the stored \(L,U\) factors and permutation.

Parameters
LUInput: LU-decomposed matrix.
pInput: permutation from gsl_linalg_LU_decomp.
inverseOutput: matrix to receive \(A^{-1}\).
Returns
Output: 0 on success, -1 on size mismatch.

Definition at line 139 of file GSLLinalg.h.

References gsl_permutation::data, gsl_matrix_ptr(), gsl_matrix::size1, and gsl_matrix::size2.

Referenced by interpolation::MMatrix< Tmplt >::invert(), TEST_F(), and TEST_F().

Here is the call graph for this function:

◆ gsl_linalg_LU_invert_complex()

int gsl_linalg_LU_invert_complex ( const gsl_matrix_complex LU,
const gsl_permutation p,
gsl_matrix_complex inverse 
)
inline

Alias for gsl_linalg_complex_LU_invert.

Parameters
LUInput: LU-decomposed matrix.
pInput: permutation from decomposition.
inverseOutput: matrix to receive \(A^{-1}\).
Returns
Output: 0 on success, -1 on size mismatch.

Definition at line 336 of file GSLLinalg.h.

References gsl_linalg_complex_LU_invert().

Referenced by TEST_F().

Here is the call graph for this function:

◆ gsl_permutation_alloc()

gsl_permutation * gsl_permutation_alloc ( size_t  n)
inline

Allocate an identity permutation of size \(n\).

Parameters
nInput: permutation size.
Returns
Output: pointer to newly allocated permutation.

Definition at line 40 of file GSLLinalg.h.

References gsl_permutation::data, and gsl_permutation::size.

Referenced by interpolation::MMatrix< Tmplt >::determinant(), interpolation::MMatrix< Tmplt >::invert(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ gsl_permutation_free()

void gsl_permutation_free ( gsl_permutation p)
inline

Free a permutation allocated by gsl_permutation_alloc.

Parameters
pInput: permutation to release (can be null).

Definition at line 52 of file GSLLinalg.h.

References gsl_permutation::data.

Referenced by interpolation::MMatrix< Tmplt >::determinant(), interpolation::MMatrix< Tmplt >::invert(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().