00001 #ifndef _INC_SU2_H
00002 #define _INC_SU2_H
00003
00004 #include "matrix.h"
00005 #include "complex"
00006
00007 typedef std::complex<double> cdouble;
00008
00010
00023 namespace su2
00024 {
00025
00027 struct polar { double r, t1, t2, t3; };
00028
00030 void mat_to_cart3(const Matrix<cdouble>& U, double* c);
00031
00033 void cart3_to_mat(double* c, Matrix<cdouble>& U);
00034
00036 void mat_to_polar3(const Matrix<cdouble>& U, double* p);
00037
00039 void polar3_to_mat(double* p, Matrix<cdouble>& U);
00040
00042 void polar_to_cart3(double* p, double* c);
00043
00045 void cart_to_polar3(double* c, double* p);
00046
00048 void x_factor(double *z, double *x, double *y);
00049
00051 void mat_to_cart4(const Matrix<cdouble>& U, double* a);
00052
00054 void cart4_to_mat(double *a, Matrix<cdouble>& U);
00055
00057 void mat_to_polar4(const Matrix<cdouble>&, double *);
00058
00060 void polar4_to_mat(double*, Matrix<cdouble>&);
00061
00063 void polar_to_cart4(double*, double*);
00064
00066 void cart_to_polar4(double*, double*);
00067
00069 void polar_to_cart4(polar& p, double* r);
00070
00072 void polar4_to_mat(polar&, Matrix<cdouble>&);
00073
00075 void eig_vals(Matrix<cdouble>& U, cdouble *evals);
00076
00078 void eig_vecs(Matrix<cdouble>& U, cdouble *evecs);
00079
00081 double trace_dist(const Matrix<cdouble>& U, const Matrix<cdouble>& V);
00082
00084
00085 double trace_dist(const Matrix<cdouble>& U, double* coord4);
00086
00088 double proj_trace_dist(const Matrix<cdouble>& U, const Matrix<cdouble>& V);
00089
00091
00092 double proj_trace_dist(const Matrix<cdouble>& U, double* coord4);
00093
00095 void group_factor(const Matrix<cdouble>& U, Matrix<cdouble>& V, Matrix<cdouble>& W);
00096
00098 void x_group_factor(const Matrix<cdouble>&, Matrix<cdouble>&, Matrix<cdouble>&);
00099
00101
00102 void similarity_matrix(const Matrix<cdouble>& V, Matrix<cdouble>& W, Matrix<cdouble>&);
00103
00105 double norm(double* v, int n);
00106
00107 };
00108
00109 #endif