Hi,

I experience the following problem. With the following elementary code :

void Quadriques::dir_courb_principal(gsl_vector *courb, gsl_matrix *dir)
{
  gsl_matrix * M = gsl_matrix_alloc(2,2) ;
  gsl_matrix_set(M, 0, 0, 2. * this->coef[0]) ;
  gsl_matrix_set(M, 0, 1, this->coef[1]) ;
  gsl_matrix_set(M, 1, 0, this->coef[1]) ;
  gsl_matrix_set(M, 1, 1, 2. * this->coef[2]) ;

  gsl_eigen_symmv_workspace * w = gsl_eigen_symmv_alloc (2) ;

  // Compute eigenvectors and eigenvalues
  gsl_eigen_symmv (M, courb, dir, w) ;
  //gsl_eigen_gensymmv_sort (courb, dir, GSL_EIGEN_SORT_VAL_DESC) ;

  gsl_matrix_free(M) ;
}

called with the following coefs array : [5, -7, 2] (that is, I compute the eigenvalues/
vectors of the following matrix :
        10      -7
        -7      2

I get the following eigenvectors :
0.834841        0.550491
-0.550491       0.834841


whereas Maple (and my hand computations) give :



Of cours, the sign does not matter, but ...... x and y's are exchanged !!!!!!

How is it that such problem occurs ?

Thanks in advance.

Alexandra Bac
_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl

Reply via email to