18#ifndef OPAL_GSL_LINALG_HH
19#define OPAL_GSL_LINALG_HH
43 p->
data =
new size_t[n];
44 for (
size_t i = 0; i < n; ++i) {
75 for (
size_t i = 0; i < n; ++i) {
80 for (
size_t k = 0; k < n - 1; ++k) {
84 for (
size_t i = k + 1; i < n; ++i) {
95 std::swap(p->
data[k], p->
data[max_row]);
96 for (
size_t j = 0; j < n; ++j) {
107 for (
size_t i = k + 1; i < n; ++i) {
110 for (
size_t j = k + 1; j < n; ++j) {
125 size_t n = LU->
size1;
126 double det =
static_cast<double>(signum);
127 for (
size_t i = 0; i < n; ++i) {
141 size_t n = LU->
size1;
142 if (inverse->
size1 != n || inverse->
size2 != n) {
147 for (
size_t j = 0; j < n; ++j) {
148 for (
size_t i = 0; i < n; ++i) {
155 for (
size_t j = 0; j < n; ++j) {
156 for (
size_t i = 0; i < n; ++i) {
158 for (
size_t k = 0; k < i; ++k) {
167 for (
int i =
static_cast<int>(n) - 1; i >= 0; --i) {
168 for (
size_t j = 0; j < n; ++j) {
170 for (
size_t k = i + 1; k < n; ++k) {
196 for (
size_t i = 0; i < n; ++i) {
201 for (
size_t k = 0; k < n - 1; ++k) {
205 for (
size_t i = k + 1; i < n; ++i) {
216 std::swap(p->
data[k], p->
data[max_row]);
217 for (
size_t j = 0; j < n; ++j) {
228 for (
size_t i = k + 1; i < n; ++i) {
232 for (
size_t j = k + 1; j < n; ++j) {
249 size_t n = LU->
size1;
251 for (
size_t i = 0; i < n; ++i) {
265 size_t n = LU->
size1;
266 if (inverse->
size1 != n || inverse->
size2 != n) {
271 for (
size_t j = 0; j < n; ++j) {
272 for (
size_t i = 0; i < n; ++i) {
280 for (
size_t j = 0; j < n; ++j) {
281 for (
size_t i = 0; i < n; ++i) {
283 for (
size_t k = 0; k < i; ++k) {
296 for (
int i =
static_cast<int>(n) - 1; i >= 0; --i) {
297 for (
size_t j = 0; j < n; ++j) {
299 for (
size_t k = i + 1; k < n; ++k) {
gsl_complex gsl_complex_div(gsl_complex a, gsl_complex b)
Quotient .
gsl_complex gsl_complex_mul(gsl_complex a, gsl_complex b)
Product .
double gsl_complex_abs(gsl_complex z)
Magnitude .
gsl_complex gsl_complex_add(gsl_complex a, gsl_complex b)
Sum .
gsl_complex gsl_complex_sub(gsl_complex a, gsl_complex b)
Difference .
int gsl_linalg_LU_decomp_complex(gsl_matrix_complex *A, gsl_permutation *p, int *signum)
Alias for gsl_linalg_complex_LU_decomp.
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.
gsl_complex gsl_linalg_complex_LU_det(const gsl_matrix_complex *LU, int signum)
Determinant from LU decomposition (complex).
void gsl_permutation_free(gsl_permutation *p)
Free a permutation allocated by gsl_permutation_alloc.
int gsl_linalg_LU_invert(const gsl_matrix *LU, const gsl_permutation *p, gsl_matrix *inverse)
Invert a matrix from its LU decomposition (real).
gsl_permutation * gsl_permutation_alloc(size_t n)
Allocate an identity permutation of size .
gsl_complex gsl_linalg_LU_det_complex(const gsl_matrix_complex *LU, int signum)
Alias for gsl_linalg_complex_LU_det.
int gsl_linalg_complex_LU_decomp(gsl_matrix_complex *A, gsl_permutation *p, int *signum)
In-place LU decomposition with partial pivoting (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).
double gsl_linalg_LU_det(const gsl_matrix *LU, int signum)
Determinant from LU decomposition (real).
int gsl_linalg_LU_decomp(gsl_matrix *A, gsl_permutation *p, int *signum)
In-place LU decomposition with partial pivoting (real).
double * gsl_matrix_ptr(gsl_matrix *m, size_t i, size_t j)
Return pointer to element in a real matrix.
gsl_complex * gsl_matrix_complex_ptr(gsl_matrix_complex *m, size_t i, size_t j)
Return pointer to element in a complex matrix.
Complex number stored as .
Dense complex matrix in row-major storage.
Dense real matrix in row-major storage.
Permutation vector for LU decomposition.