14 #ifndef VEC_SU_N_INCLUDED
15 #define VEC_SU_N_INCLUDED
27 std::valarray<double>
va;
45 inline double norm()
const;
65 inline double r(
const int c)
const
67 inline double i(
const int c)
const
68 {
return va[2 * c + 1]; }
70 inline void set_r(
const int c,
const double re)
72 inline void set_i(
const int c,
const double im)
73 {
va[2 * c + 1] = im; }
74 inline void set(
const int c,
const double re,
const double im)
83 std::valarray<double> tmp =
va *
va;
91 std::valarray<double> tmp =
va * rhs.
va;
99 for (
int c = 0; c <
Nc; ++c) {
100 va[2 * c + 1] = -
va[2 * c + 1];
115 for (
unsigned int c = 0; c <
va.size() / 2; ++c) {
116 double tmp =
va[2 * c];
117 va[2 * c] = -
va[2 * c + 1];
154 std::valarray<double> tmp =
va;
156 for (
unsigned int c = 0; c <
va.size() / 2; ++c) {
157 va[2 * c] = (tmp[2 * c] * real(rhs) - tmp[2 * c + 1] * imag(rhs));
158 va[2 * c + 1] = (tmp[2 * c] * imag(rhs) + tmp[2 * c + 1] * real(rhs));
173 std::valarray<double> tmp =
va;
175 for (
unsigned int c = 0; c <
va.size() / 2; ++c) {
176 va[2 * c] = (tmp[2 * c] * real(rhs) + tmp[2 * c + 1] * imag(rhs)) / abs(rhs);
177 va[2 * c + 1] = (-tmp[2 * c] * imag(rhs) - tmp[2 * c + 1] * real(rhs)) / abs(rhs);
188 for (
int c = 0; c < u.
size() / 2; ++c) {
189 tmp.
set(c, -u.
i(c), u.
r(c));
231 for (
int a = 0; a < Nc; ++a) {
234 for (
int b = 0; b < Nc; ++b) {
235 re += m.
r(a, b) * v.
r(b) - m.
i(a, b) * v.
i(b);
236 im += m.
r(a, b) * v.
i(b) + m.
i(a, b) * v.
r(b);
double r(const int c) const
Mat_SU_N operator+(const Mat_SU_N &m1, const Mat_SU_N &m2)
Vec_SU_N & operator*=(const double &)
Vec_SU_N & operator/=(const double &)
const Vec_SU_N operator/(const Vec_SU_N &v, const double &r)
Vec_SU_N & operator+=(const Vec_SU_N &)
void set(const int c, const double re, const double im)
Vec_SU_N(const Vec_SU_N &v)
double i(const int c) const
Vec_SU_N(int Nci=CommonParameters::Nc(), double r=0.0)
Mat_SU_N operator-(const Mat_SU_N &m1, const Mat_SU_N &m2)
Vec_SU_N & operator=(const Vec_SU_N &v)
Vec_SU_N & operator-=(const Vec_SU_N &)
Mat_SU_N operator*(const Mat_SU_N &m1, const Mat_SU_N &m2)
void set_r(const int c, const double re)
void set_i(const int c, const double im)
std::valarray< double > va
const Vec_SU_N Ix(const Vec_SU_N &u)
double operator*(const Vec_SU_N &) const