SyTen

◆ closeThreshold()

template<typename Scalar , typename ThresholdType , typename std::enable_if< std::is_same< Scalar, typename ScalarBase< Scalar >::type >::value, int >::type = 0>
bool syten::closeThreshold ( Scalar const &  x,
typename IdentityType< Scalar >::type const &  y,
ThresholdType const &  threshold 
)

Returns true if the two arguments are within threshold distance to each other relative to their magnitude.

Returns true if the two arguments are within threshold distance to each other relative to their magnitude (std::complex<> specialisation).

Using the standard formulation from reals would call abs(), which requires sqrt(), the latter being rather expensive on Boost multiprecision scalars.

References abs(), and syten::Caching::threshold.

Referenced by syten::IPEPS::FullUpdate::apply_op(), checkedAddParallel(), syten::T3N::RDMs::OrbRDM::checkValidity(), syten::MPS::RDMs::OrbRDM::checkValidity(), syten::Krylov::Evolution::Conf::Conf(), syten::T3N::BasisTransformation::entropy(), entropy(), syten::Krylov::Evolution::Evolver< Solver >::evolve(), syten::MPS::SwappableTEBD::exponentiate_factor_mpo(), syten::IPEPSv2::full_update_apply_gate(), syten::Krylov::Evolution::Evolver< Solver >::loop_evolve(), syten::Krylov::ClassicImpl::OrthoMat< Lanczos >::newOverlapsOK(), operator==(), syten::SparseTensor< rank, Scalar >::operator==(), syten::STensorImpl::operator==(), syten::Delinearise::postprocess_coefficient(), syten::SparseTensor< rank, Scalar >::regularise(), syten::Krylov::Evolution::run_evolution(), syten::Krylov::ClassicImpl::ExponentialSolver< Solver >::solveForConvergence(), syten::Krylov::SolverPolicies::Exponential::sp_convergence(), syten::Krylov::SolverPolicies::Exponential::sp_result(), and validateCGCContraction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: