/** * \file QuadContainerSet.h * \brief Store a set of QuadContainers * * This file is generated by a script (core/tools/make-container). * Do not edit directly. * * Copyright 2007-2010 IMP Inventors. All rights reserved. */ #ifndef IMPCONTAINER_QUAD_CONTAINER_SET_H #define IMPCONTAINER_QUAD_CONTAINER_SET_H #include "container_config.h" #include #include #include IMPCONTAINER_BEGIN_NAMESPACE //! Stores a set of QuadContainers /** The input sets must be disjoint. This can change if there is demand for it. \usesconstraint */ class IMPCONTAINEREXPORT QuadContainerSet : public QuadContainer { IMP_CONTAINER_DEPENDENCIES(QuadContainerSet, { ret.insert(ret.end(), back_->quad_containers_begin(), back_->quad_containers_end()); }); // to not have added and removed QuadContainerSet(); QuadContainerPair get_added_and_removed_containers() const { QuadContainerSet *added= create_untracked_container(); QuadContainerSet *removed=create_untracked_container(); for (unsigned int i=0; i< get_number_of_quad_containers(); ++i) { added->add_quad_container(get_quad_container(i) ->get_added_container()); removed->add_quad_container(get_quad_container(i) ->get_removed_container()); } return QuadContainerPair(added, removed); } public: //! Construct and empty set QuadContainerSet(Model *m, std::string name="QuadContainerSet %1%"); QuadContainerSet(const QuadContainersTemp &pc, std::string name="QuadContainerSet %1%"); bool get_contains_particle_quad(const ParticleQuad&) const; unsigned int get_number_of_particle_quads() const; ParticleQuad get_particle_quad(unsigned int i) const; void apply(const QuadModifier *sm); void apply(const QuadModifier *sm, DerivativeAccumulator &da); double evaluate(const QuadScore *s, DerivativeAccumulator *da) const; double evaluate_change(const QuadScore *s, DerivativeAccumulator *da) const; double evaluate_prechange(const QuadScore *s, DerivativeAccumulator *da) const; template void template_apply(const SM *sm, DerivativeAccumulator &da) { for (unsigned int i=0; i< get_number_of_quad_containers(); ++i) { get_quad_container(i)->apply(sm, da); } } template void template_apply(const SM *sm) { for (unsigned int i=0; i< get_number_of_quad_containers(); ++i) { get_quad_container(i)->apply(sm); } } template double template_evaluate(const SS *s, DerivativeAccumulator *da) const { double ret=0; for (unsigned int i=0; i< get_number_of_quad_containers(); ++i) { ret+=get_quad_container(i)->evaluate(s, da); } return ret; } template double template_evaluate_change(const SS *s, DerivativeAccumulator *da) const { double ret=0; for (unsigned int i=0; i< get_number_of_quad_containers(); ++i) { ret+=get_quad_container(i)->evaluate_change(s, da); } return ret; } template double template_evaluate_prechange(const SS *s, DerivativeAccumulator *da) const { double ret=0; for (unsigned int i=0; i< get_number_of_quad_containers(); ++i) { ret+=get_quad_container(i)->evaluate_prechange(s, da); } return ret; } ParticlesTemp get_contained_particles() const; bool get_contained_particles_changed() const; IMP_OBJECT(QuadContainerSet); /** @name Methods to control the nested container This container merges a set of nested containers. To add or remove nested containers, use the methods below. */ /**@{*/ IMP_LIST(public, QuadContainer, quad_container, QuadContainer*, QuadContainers); /**@}*/ static QuadContainerSet *create_untracked_container() { QuadContainerSet *lsc = new QuadContainerSet(); return lsc; } #ifndef IMP_DOXYGEN bool get_is_up_to_date() const { for (unsigned int i=0; i< get_number_of_quad_containers(); ++i) { if (!get_quad_container(i)->get_is_up_to_date()) return false; } return true; } #endif }; IMPCONTAINER_END_NAMESPACE #endif /* IMPCONTAINER_QUAD_CONTAINER_SET_H */