mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-09 23:45:36 +00:00
Remove code duplication: Iterating through vectors
This commit is contained in:
parent
5aabe074fe
commit
5e28fe56d2
@ -326,7 +326,10 @@ class GaugeGroup {
|
||||
|
||||
template <int N> // reunitarise, resimplectify...
|
||||
static void ProjectOnGaugeGroup(Lattice<iVector<iScalar<iMatrix<vComplexD, N> >, Nd> > &U) {
|
||||
ProjectOnGaugeGroup(U, group_name());
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
auto Umu = PeekIndex<LorentzIndex>(U, mu);
|
||||
ProjectOnGaugeGroup(Umu);
|
||||
}
|
||||
}
|
||||
|
||||
template <int N> // reunitarise, resimplectify...
|
||||
|
@ -508,19 +508,9 @@ static void testGenerators(GroupName::SU) {
|
||||
std::cout << GridLogMessage << std::endl;
|
||||
}
|
||||
|
||||
|
||||
template <int N>
|
||||
static void ProjectOnGaugeGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu, GroupName::SU) {
|
||||
Umu = ProjectOnGroup(Umu);
|
||||
}
|
||||
|
||||
template <int N>
|
||||
static void ProjectOnGaugeGroup(Lattice<iVector<iScalar<iMatrix<vComplexD, N> >, Nd> > &U, GroupName::SU) {
|
||||
// Reunitarise
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
auto Umu = PeekIndex<LorentzIndex>(U, mu);
|
||||
Umu = ProjectOnGroup(Umu);
|
||||
}
|
||||
}
|
||||
|
||||
template <class vtype>
|
||||
|
@ -256,15 +256,6 @@ static void testGenerators(GroupName::Sp) {
|
||||
template <int N>
|
||||
static void ProjectOnGaugeGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu, GroupName::Sp) {
|
||||
Umu = ProjectOnSpGroup(Umu);
|
||||
}
|
||||
|
||||
template <int N>
|
||||
static void ProjectOnGaugeGroup(Lattice<iVector<iScalar<iMatrix<vComplexD, N> >, Nd> > &U, GroupName::Sp) {
|
||||
// Reunitarise
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
auto Umu = PeekIndex<LorentzIndex>(U, mu);
|
||||
Umu = ProjectOnSpGroup(Umu);
|
||||
}
|
||||
}
|
||||
|
||||
template <class vtype>
|
||||
|
Loading…
Reference in New Issue
Block a user