From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Varghese John" To: gsl-discuss@sources.redhat.com Subject: Eigen value problem Date: Wed, 19 Dec 2001 13:20:00 -0000 Message-id: X-SW-Source: 2001/msg00539.html Hi, I am having problems with the following program. trying to get eigen values for the 2x2 matrix, and the program hangs? --it works fine for a 3x3 matrix! thanks. vj ----------------------------------------------- #include #include #include #define TestSize 2 void GetEigen1(); void GetEigenvaluesForSymmMat( gsl_matrix * m, int mSize, gsl_vector * v); int main(){ GetEigen1(); return(0); } void GetEigen1(){ int i; int j; int x; gsl_matrix * m = gsl_matrix_alloc(TestSize, TestSize); gsl_matrix_set_zero(m); /* matrix = ((1, 2), (2, 1)) */ gsl_matrix_set(m, 0, 0, 1.0); gsl_matrix_set(m, 0, 1, 2.0); gsl_matrix_set(m, 1, 0, 2.0); gsl_matrix_set(m, 1, 1, 1.0); /* matrix = ((4, 1, 1), (1, 2, 2), (1, 2, 9)) */ /* gsl_matrix_set(m, 0, 0, 4.0); gsl_matrix_set(m, 0, 1, 1.0); gsl_matrix_set(m, 0, 2, 1.0); gsl_matrix_set(m, 1, 0, 1.0); gsl_matrix_set(m, 1, 1, 2.0); gsl_matrix_set(m, 1, 2, 2.0); gsl_matrix_set(m, 2, 0, 1.0); gsl_matrix_set(m, 2, 1, 2.0); gsl_matrix_set(m, 2, 2, 9.0); */ printf("The Input Matrix: \n"); for (i = 0; i < TestSize; i++){ for (j = 0; j