/** * \file FittingSolutionRecord.cpp * \brief stored a multifit fitting solution * * Copyright 2007-2010 IMP Inventors. All rights reserved. * */ #include #include namespace { template void initialize(T &t) { if (std::numeric_limits::has_signaling_NaN) { t= std::numeric_limits::signaling_NaN(); } else if (std::numeric_limits::has_quiet_NaN) { t= std::numeric_limits::quiet_NaN(); } else if (std::numeric_limits::has_infinity) { t= std::numeric_limits::infinity(); } else { // numerical limits for int and double have completely // different meanings of max/min t= std::numeric_limits::max(); } } template bool is_initialized(T &t) { if (std::numeric_limits::has_signaling_NaN) { return !(t == std::numeric_limits::signaling_NaN()); } else if (std::numeric_limits::has_quiet_NaN) { return !(t == std::numeric_limits::quiet_NaN()); } else if (std::numeric_limits::has_infinity) { return !(t == std::numeric_limits::infinity()); } else { // numerical limits for int and double have completely // different meanings of max/min return !(t == (std::numeric_limits::max())); } } } IMPMULTIFIT_BEGIN_NAMESPACE FittingSolutionRecord::FittingSolutionRecord() { // initialize(index_); // initialize(sol_fn_); // initialize(match_size_); // initialize(match_avg_dist_); // initialize(fitting_score_); // initialize(rmsd_to_ref_); index_=0; sol_fn_=""; match_size_=0; match_avg_dist_=-1; fitting_score_=-1; rmsd_to_ref_=-1; } void FittingSolutionRecord::show(std::ostream& out) const { //if (is_initialized(index_)) out<