Commit c2f0a124 authored by Tobias WEBER's avatar Tobias WEBER

cleanups

parent ec07f2fd
......@@ -79,7 +79,7 @@ std::pair<bool, std::shared_ptr<T[]>> get_file_mem(std::basic_istream<t_char>& i
istr.seekg(offs, std::ios_base::beg);
istr.read((char*)ptr.get(), len*sizeof(T));
if(istr.gcount() != len*sizeof(T))
if(istr.gcount() != std::streamsize(len*sizeof(T)))
ok = false;
// move back to original position
......
......@@ -48,6 +48,8 @@ class Lattice
Lattice(T a, T b, T c, T alpha, T beta, T gamma);
Lattice(const t_vec& vec0, const t_vec& vec1, const t_vec& vec2);
Lattice(const Lattice<T>& lattice);
const Lattice<T>& operator=(const Lattice<T>& lattice);
Lattice() = default;
~Lattice() = default;
......@@ -121,10 +123,18 @@ Lattice<T>::Lattice(const t_vec& vec0, const t_vec& vec1, const t_vec& vec2)
template<typename T>
Lattice<T>::Lattice(const Lattice<T>& lattice)
{
this->operator=(lattice);
}
template<typename T>
const Lattice<T>& Lattice<T>::operator=(const Lattice<T>& lattice)
{
this->m_vecs[0] = lattice.m_vecs[0];
this->m_vecs[1] = lattice.m_vecs[1];
this->m_vecs[2] = lattice.m_vecs[2];
return *this;
}
......
......@@ -281,7 +281,7 @@ void metrop(
// calculate energy
auto calcE = [dJ](const t_arr& arr,
const t_dim& idxSpin, const std::vector<t_dim>& vecNN,
bool bFlip=0) -> t_real
bool bFlip) -> t_real
{
t_real dE = t_real(0);
bool bSpin = arr(idxSpin);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment