Skip to content
Snippets Groups Projects
Commit 6b0774e0 authored by daverio's avatar daverio
Browse files

LATfield2_latticeVector.hpp

parent 0a54ff2b
No related branches found
No related tags found
No related merge requests found
#ifndef LATFIELD2_LATTICEVECTOR_HPP
#define LATFIELD2_LATTICEVECTOR_HPP
/*! \file LATfield2_Site.hpp
\brief LATfield2_Site.hpp contains the Site, rKSite, and cKSite definition.
\author David Daveio, Neil Bevis, with modifications by Wessel Valkenburg
*/
#include "LATfield2_latticeVector_decl.hpp"
latticeVector::latticeVector()
{
lattice_ = NULL;
}
latticeVector::latticeVector(Lattice& lattice)
{
lattice_ = &lattice;
}
latticeVector::jump()
{
return lattice_->jump(direction_);
}
inline latticeVector& latticeVector::operator=(const int dir)
{
direction_ = dir;
return *this;
}
inline latticeVector& latticeVector::operator++()
{
direction_++;
return *this;
}
inline latticeVector& latticeVector::operator--()
{
direction_--;
return *this;
}
inline bool operator< (const latticeVector& lhs, const int rhs)
{
return lhs.direction_ < rhs;
}
inline bool operator> (const latticeVector& lhs, const int rhs)
{
return lhs.direction_ > rhs;
}
inline long operator+ (const long& i, const latticeVector& v)
{
return i + v.jump();
}
inline long operator- (const long& i, const latticeVector& v)
{
return i - v.jump();
}
inline long operator+ (const Site& x, const latticeVector& v)
{
return x.index() + v.jump();
}
inline long operator- (const Site x, const latticeVector& v)
{
return x.index() - v.jump();
}
#endif
#ifndef LATFIELD2_LATTICEVECTOR_DECL_HPP
#define LATFIELD2_LATTICEVECTOR_DECL_HPP
#include "LATfield2_Lattice_decl.hpp"
class latticeVector
{
public:
latticeVector();
latticeVector(Lattice& lattice);
latticeVector& operator=(const int dir);
latticeVector& operator++();
latticeVector& operator--();
bool operator<(const int lim);
bool operator>(const int lim);
long jump();
int direction_;
protected:
Lattice* lattice_;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment