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 mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to