[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gsl] problem in using LU decomp
From: |
Serle Shuman |
Subject: |
[Help-gsl] problem in using LU decomp |
Date: |
Wed, 20 May 2009 22:38:01 +0200 |
Hi
Can anyone see what I am doing wrong. I seem to get and infinite v[0] value
when it should be -0.0000015531.
int perm_sign = 0;
gsl_matrix* C = gsl_matrix_calloc(2, 2);
gsl_vector* b = gsl_vector_calloc(2);
gsl_vector* v = gsl_vector_calloc(2);
gsl_permutation* p = gsl_permutation_calloc(2);
gsl_matrix_set(C, 0, 0, 1.0);
gsl_vector_set(b, 0, -0.0000015531);
gsl_linalg_LU_decomp(C, p, &perm_sign);
gsl_linalg_LU_solve(C, p, b, v);
for (int l = 0; l < n; l++) {
if (!gsl_finite(gsl_vector_get(v, l))) {
// we have a problem with v
break;
}
}
Also can one use LU decomposition solver on a non-square matrix or does one
need to pad it up with zeros.
Thanks in advance
Serle
- [Help-gsl] problem in using LU decomp,
Serle Shuman <=