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]

eigen values and vectors problem


    with the GSL1.1.1 with windows and Visual C++6 , this program don't
work :

int main (void)
{
  double data[] = {1,4,5,
                   4,2,6,
                    5,6,3};

  gsl_matrix_view m = gsl_matrix_view_array(data, 3, 3);

  gsl_vector *eval = gsl_vector_alloc (3);
  gsl_matrix *evec = gsl_matrix_alloc (3, 3);

  gsl_eigen_symmv_workspace * w = gsl_eigen_symmv_alloc (3);

  gsl_eigen_symmv (&m.matrix, eval, evec, w);

  gsl_eigen_symmv_free(w);

  gsl_eigen_symmv_sort (eval, evec, GSL_EIGEN_SORT_ABS_ASC);

    int i;

    for (i = 0; i < 3; i++)
      {
        double eval_i  = gsl_vector_get(eval, i);
        gsl_vector_view evec_i = gsl_matrix_column(evec, i);

        printf("eigenvalue = %g\n", eval_i);
        printf("eigenvector = \n");
       gsl_vector_fprintf(stdout, &evec_i.vector,"%g" );
    }

return 0;
}

the fonction "gsl_vector_fprintf(stdout, &evec_i.vector,"%g" )" make
error.
Can you help me!
reply to my adress
thanks



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