This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Return Values from gsl_linalg_LU_decomp() and gsl_linalg_LU_solve()


Folks,

I have the singular matrix

[ 1, 0, 1 ]
[ 0, 1, 0 ]
[ 1, 0, 1 ]


I then use gsl_linalg_LU_decomp() and get

[ 1, 0, 1 ]
[ 0, 1, 0 ]
[ 1, 0, 0 ]

for the LU factorization. (U is, of course, singular.)

However, the return value from gsl_linalg_LU_decomp() is 0, indicating to
me that "everything is all right."

Then I call gsl_linalg_LU_solve() to solve a linear system, get
NaN's in the solution vector, but once again, gsl_linalg_LU_solve() 
returns 0, which my code interprets as "everything is all right." 

Obviously, I should not interpret a 0 return value as "everything is 
all right." (The reason I look at the return values is to use my own
error handling code. I did turn off the GSL error handler.)
I suppose I could use gsl_finite() on all the elements of the solution
vector, but is there a better way? When would gsl_linalg_LU_decomp() or
gsl_linalg_LU_solve() return non-zero values? How should the return value 
be interpreted?

Thanks.

-- 

K. Banerjee


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]