mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Hadrons: diluted noise polish
This commit is contained in:
parent
830168ec37
commit
2962123cba
@ -19,14 +19,15 @@ public:
|
|||||||
DilutedNoise(GridCartesian *g, const unsigned int nNoise);
|
DilutedNoise(GridCartesian *g, const unsigned int nNoise);
|
||||||
virtual ~DilutedNoise(void) = default;
|
virtual ~DilutedNoise(void) = default;
|
||||||
// access
|
// access
|
||||||
const FermionField & operator[](const unsigned int i) const;
|
std::vector<FermionField> & getNoise(void);
|
||||||
FermionField & operator[](const unsigned int i);
|
const std::vector<FermionField> & getNoise(void) const;
|
||||||
void resize(const unsigned int nNoise);
|
const FermionField & operator[](const unsigned int i) const;
|
||||||
unsigned int size(void) const;
|
FermionField & operator[](const unsigned int i);
|
||||||
unsigned int getNNoise(void) const;
|
void resize(const unsigned int nNoise);
|
||||||
GridCartesian *getGrid(void) const;
|
unsigned int size(void) const;
|
||||||
|
GridCartesian *getGrid(void) const;
|
||||||
// generate noise (pure virtual)
|
// generate noise (pure virtual)
|
||||||
virtual void generateNoise(GridParallelRNG &rng) = 0;
|
virtual void generateNoise(GridParallelRNG &rng) = 0;
|
||||||
private:
|
private:
|
||||||
std::vector<FermionField> noise_;
|
std::vector<FermionField> noise_;
|
||||||
GridCartesian *grid_;
|
GridCartesian *grid_;
|
||||||
@ -65,28 +66,17 @@ DilutedNoise<FImpl>::DilutedNoise(GridCartesian *g,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
void DilutedNoise<FImpl>::resize(const unsigned int nNoise)
|
std::vector<typename DilutedNoise<FImpl>::FermionField> & DilutedNoise<FImpl>::
|
||||||
|
getNoise(void)
|
||||||
{
|
{
|
||||||
nNoise_ = nNoise;
|
return noise_;
|
||||||
noise_.resize(nNoise, grid_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
unsigned int DilutedNoise<FImpl>::size(void) const
|
const std::vector<typename DilutedNoise<FImpl>::FermionField> & DilutedNoise<FImpl>::
|
||||||
{
|
getNoise(void) const
|
||||||
return noise_.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename FImpl>
|
|
||||||
unsigned int DilutedNoise<FImpl>::getNNoise(void) const
|
|
||||||
{
|
{
|
||||||
return nNoise_;
|
return noise_;
|
||||||
}
|
|
||||||
|
|
||||||
template <typename FImpl>
|
|
||||||
GridCartesian * DilutedNoise<FImpl>::getGrid(void) const
|
|
||||||
{
|
|
||||||
return grid_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
@ -103,6 +93,25 @@ DilutedNoise<FImpl>::operator[](const unsigned int i)
|
|||||||
return noise_[i];
|
return noise_[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename FImpl>
|
||||||
|
void DilutedNoise<FImpl>::resize(const unsigned int nNoise)
|
||||||
|
{
|
||||||
|
nNoise_ = nNoise;
|
||||||
|
noise_.resize(nNoise, grid_);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename FImpl>
|
||||||
|
unsigned int DilutedNoise<FImpl>::size(void) const
|
||||||
|
{
|
||||||
|
return noise_.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename FImpl>
|
||||||
|
GridCartesian * DilutedNoise<FImpl>::getGrid(void) const
|
||||||
|
{
|
||||||
|
return grid_;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* TimeDilutedSpinColorDiagonalNoise template implementation *
|
* TimeDilutedSpinColorDiagonalNoise template implementation *
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
@ -33,7 +33,7 @@ public:
|
|||||||
MODULE_REGISTER_TMP(TimeDilutedSpinColorDiagonal, TTimeDilutedSpinColorDiagonal<FIMPL>, MNoise);
|
MODULE_REGISTER_TMP(TimeDilutedSpinColorDiagonal, TTimeDilutedSpinColorDiagonal<FIMPL>, MNoise);
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* TTimeDilutedSpinColorDiagonal implementation *
|
* TTimeDilutedSpinColorDiagonal implementation *
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
// constructor /////////////////////////////////////////////////////////////////
|
// constructor /////////////////////////////////////////////////////////////////
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user