Commit 727f88b2 authored by gbalduzz's avatar gbalduzz
Browse files

Updated MatrixConfiguration assignment operator.

parent e2148379
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ struct ConfigRef {
  ConfigRef(unsigned _config_id, std::uint8_t _leg_id) : config_id(_config_id), leg_id(_leg_id) {}

  unsigned config_id;  // Index of the interaction in the SolverConfiguration.
  std::uint8_t leg_id;  // Stores if this is the first or second leg of the interaction.
  std::uint8_t leg_id;  // In {0, 1}. Stores if this is the first or second leg of an interaction vertex.
};

class MatrixConfiguration {
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ public:
  template <class RngType>
  void insertRandom(RngType& rng);

  // Returns at most two candidates. -1 stands for a missing candidate.
  // Returns the indices of the removal candidates. -1 stands for a missing candidate.
  template <class RngType>
  std::array<int, 2> randomRemovalCandidate(RngType& rng, double removal_rand);
  template <class RngType>
+4 −0
Original line number Diff line number Diff line
@@ -21,11 +21,15 @@ MatrixConfiguration::MatrixConfiguration(const InteractionVertices* H_int, const
    : H_int_(H_int), n_bands_(bands), sectors_{Sector(), Sector()} {}

MatrixConfiguration& MatrixConfiguration::operator=(const MatrixConfiguration& rhs) {
  assert(n_bands_ == rhs.n_bands_);
  H_int_ = rhs.H_int_;
  sectors_ = rhs.sectors_;
  return *this;
}

MatrixConfiguration& MatrixConfiguration::operator=(MatrixConfiguration&& rhs) {
  assert(n_bands_ == rhs.n_bands_);
  H_int_ = rhs.H_int_;
  sectors_ = std::move(rhs.sectors_);
  return *this;
}