Commit 3c3ca555 authored by Doak, Peter W.'s avatar Doak, Peter W.
Browse files

relax assertion for b1 != b2 cases add better error for image->real

parent 6dfe7898
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -42,9 +42,11 @@ auto real(const function<std::complex<Scalartype>, Dmn>& f, const bool check_ima
  function<Scalartype, Dmn> f_real;

  for (int i = 0; i < f_real.size(); ++i) {
    if (check_imaginary && std::abs(f(i).imag()) > 500 * std::numeric_limits<Scalartype>::epsilon())
      throw(std::logic_error("The function is not purely real."));

    if (check_imaginary && std::abs(f(i).imag()) > 500 * std::numeric_limits<Scalartype>::epsilon()) {
      std::ostringstream err_msg;
      err_msg << "Element: " << i << "of the function has value " << f(i) << "which is not purely real.";
      throw(std::logic_error(err_msg.str()));
    }
    f_real(i) = f(i).real();
  }

+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ Real DMatrixBuilder<CPU, Real>::computeD(const int i, const int j, const Sector&
  const int p_index = label(b1, b2, delta_r);
  const Real delta_tau = configuration.getTau(i) - configuration.getTau(j);
  const Real g0_val = g0_ref_(delta_tau, p_index);
  assert(b1 == b2);
  // This needs to be considered assert(b1 == b2);
  if (i == j)
    return g0_val - computeAlpha(configuration.getAuxFieldType(i), b1);
  else