bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] bug in SVD


From: Darren Wilkinson
Subject: [Bug-gsl] bug in SVD
Date: Sun, 09 Nov 2003 13:18:53 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1

There is a bug in the SVD routine in the linalg section of the library which causes the SVD routine to hang when given certain matrices as input. The attached short program illustrates the problem.

I'm not certain which version of the library I'm using (sorry), but it is the binary version in the current stable release of Debian, so it's certainly not ancient - I think it is 1.1.1.

Cheers,
--
Darren Wilkinson   Email:  address@hidden
                     WWW:  www.darrenjwilkinson.btinternet.co.uk
/*
svd-test.c

test out GSL SVD code

gcc -lgsl -lgslcblas svd-test.c -o svd-test

*/

#include <gsl/gsl_matrix.h>
#include <gsl/gsl_linalg.h>

int main(void)
{
  gsl_matrix *A,*V;
  gsl_vector *S,*work;

  A=gsl_matrix_calloc(3,3);
  V=gsl_matrix_calloc(3,3);
  S=gsl_vector_calloc(3);
  work=gsl_vector_calloc(3);

  gsl_matrix_set(A,0,0,0);
  gsl_matrix_set(A,0,1,1);
  gsl_matrix_set(A,0,2,0);

  gsl_matrix_set(A,1,0,0);
  gsl_matrix_set(A,1,1,0);
  gsl_matrix_set(A,1,2,1);

  gsl_matrix_set(A,2,0,0);
  gsl_matrix_set(A,2,1,-1);
  gsl_matrix_set(A,2,2,-1);

  printf("gets to here\n");
  gsl_linalg_SV_decomp(A,V,S,work);
  printf("doesn't get to here\n");

  return(0);
}

/* eof */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]