00001 #ifndef __GSLMATRIX_H__
00002 #define __GSLMATRIX_H__
00003
00004 #include <cmath>
00005 #include <complex>
00006 #include <gsl/gsl_linalg.h>
00007 #include <gsl/gsl_math.h>
00008 #include <gsl/gsl_eigen.h>
00009 #include <gsl/gsl_complex.h>
00010
00011 using namespace std;
00012
00013
00014
00015 class CGSLMatrix_Real{
00016 public:
00017 int dim;
00018
00019 void SolveLinearEqs(double *y,double **A,double *x);
00020 void EigenFind(double **A,double **eigenvec,
00021 double *eigenval);
00022 void Invert(double **A,double **Ainv);
00023 CGSLMatrix_Real(int dimset);
00024 ~CGSLMatrix_Real();
00025 private:
00026 gsl_eigen_symmv_workspace *w;
00027 gsl_vector *eval;
00028 gsl_matrix *evec;
00029 gsl_vector *g;
00030 gsl_permutation *p;
00031 gsl_matrix *m;
00032 gsl_vector *v;
00033 double **U;
00034 };
00035
00036
00037
00038 class CGSLMatrix_Complex{
00039 public:
00040 int dim;
00041 void SolveLinearEqs(complex<double> *y,complex<double> **A,
00042 complex<double> *x);
00043 void EigenFind(complex<double> **A,complex<double> **eigenvec,
00044 double *eigenval);
00045 void Invert(complex<double> **A,complex<double> **Ainv);
00046 CGSLMatrix_Complex(int dimset);
00047 ~CGSLMatrix_Complex();
00048 private:
00049 gsl_vector *eval;
00050 gsl_matrix_complex *evec;
00051 gsl_vector_complex *g;
00052 gsl_eigen_hermv_workspace *w;
00053 gsl_permutation *p;
00054 complex<double> **U;
00055 gsl_matrix_complex *m;
00056 gsl_vector_complex *v;
00057 };
00058
00059 #endif