bugGNU Scientific Library - Bugs: bug #21837, gsl_linalg_solve_symm_tridiag...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #21837: gsl_linalg_solve_symm_tridiag requires positive definite matrix

Submitted by:  -Deleted Account- <bjg>
Submitted on:  Tue 18 Dec 2007 06:52:57 PM UTC  
 
Category: Runtime errorSeverity: 2 - Minor
Operating System: Status: Confirmed
Assigned to: NoneOpen/Closed: Open
Release: 1.10

Tue 18 Dec 2007 06:52:57 PM UTC, original submission:

A zero on the diagonal will cause NaNs even though a reasonable
solution could be computed in principle.

#include <gsl/gsl_linalg.h>

int main (void)
{
double d[] = { 0.00, 1.21, 0.80, 1.55, 0.76 } ;
double e[] = { 0.82, 0.39, 0.09, 0.68 } ;
double b[] = { 0.07, 0.62, 0.81, 0.11, 0.65} ;
double x[] = { 0.00, 0.00, 0.00, 0.00, 0.00} ;

gsl_vector_view dv = gsl_vector_view_array(d, 5);
gsl_vector_view ev = gsl_vector_view_array(e, 4);
gsl_vector_view bv = gsl_vector_view_array(b, 5);
gsl_vector_view xv = gsl_vector_view_array(x, 5);

gsl_linalg_solve_symm_tridiag(&dv.vector, &ev.vector, &bv.vector, &xv.vector);
gsl_vector_fprintf(stdout, &xv.vector, "% .5f");

d[0] += 1e-5;
gsl_linalg_solve_symm_tridiag(&dv.vector, &ev.vector, &bv.vector, &xv.vector);
gsl_vector_fprintf(stdout, &xv.vector, "% .5f");
}

$ ./a.out
nan
nan
nan
nan
nan
0.13626
0.08536
1.03840
-0.60009
1.39219

AUG 2007: We now return an error code for this case. To return a solution
we would need to do a permutation, see slatec/dgtsl.f

-Deleted Account- <bjg>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sun 10 Feb 2008 10:29:07 AM UTCbjgSeverity3 - Normal=>2 - Minor
  StatusNone=>Confirmed

Back to the top


Powered by Savane 3.1-cleanup