/** * \file PairRestraint.cpp * \brief Implementation * * This file is generated by a script (core/tools/make-container). * Do not edit directly. * * Copyright 2007-2010 IMP Inventors. All rights reserved. * */ #include "IMP/core/PairRestraint.h" #include #include IMPCORE_BEGIN_NAMESPACE PairRestraint ::PairRestraint(PairScore *ss, const ParticlePair& vt, std::string name): PairScoreRestraint(name), ss_(ss), v_(vt), score_(std::numeric_limits::quiet_NaN()) { IMP_IF_CHECK(USAGE) { // check the arguments are OK ss_->evaluate(v_, NULL); } } double PairRestraint ::unprotected_evaluate(DerivativeAccumulator *accum) const { IMP_OBJECT_LOG; IMP_CHECK_OBJECT(ss_); score_ = ss_->evaluate(v_, accum); return score_; } double PairRestraint ::unprotected_incremental_evaluate(DerivativeAccumulator *accum) const { if (ss_->get_is_changed(v_)) { score_+=ss_->evaluate_change(v_, accum); } return score_; } ParticlesTemp PairRestraint::get_input_particles() const { return IMP::internal::get_input_particles(ss_.get(), v_); } ContainersTemp PairRestraint::get_input_containers() const { return IMP::internal::get_input_containers(ss_.get(), v_); } void PairRestraint::do_show(std::ostream& out) const { out << "score " << ss_->get_name() << std::endl; out << "data " << IMP::internal::streamable(v_) << std::endl; } IMPCORE_END_NAMESPACE