IMP logo
IMP Reference Guide  develop.27926d84dc,2024/04/16
The Integrative Modeling Platform
DistributeQuadsScoreState.h
Go to the documentation of this file.
1 // Autogenerated by ../../../../tmp/nightly-build-32337/imp-20240416.develop.27926d84dc/tools/build/make_containers.py
2 // from ../../../../tmp/nightly-build-32337/imp-20240416.develop.27926d84dc/tools/build/container_templates/container/DistributeClassnamesScoreState.h
3 // Do not edit - any changes will be lost!
4 
5 /**
6  * \file IMP/container/DistributeQuadsScoreState.h
7  * \brief Apply a QuadScore to each Quad in a list.
8  *
9  * Copyright 2007-2022 IMP Inventors. All rights reserved.
10  *
11  */
12 
13 #ifndef IMPCONTAINER_DISTRIBUTE_QUADS_SCORE_STATE_H
14 #define IMPCONTAINER_DISTRIBUTE_QUADS_SCORE_STATE_H
15 
16 #include <IMP/container/container_config.h>
17 
19 #include <IMP/QuadPredicate.h>
20 #include <IMP/QuadContainer.h>
21 #include <IMP/Vector.h>
22 #include <IMP/quad_macros.h>
23 #include <boost/tuple/tuple.hpp>
24 
25 #include <iostream>
26 
27 IMPCONTAINER_BEGIN_NAMESPACE
28 
29 //! Distribute contents of one container into several based on predicates
30 /** This ScoreState takes a list of predicates and values. For
31  each tuple in the input container, it is placed in a given output container
32  if the predicate, when applied, has the passed value.
33 
34  \note The output containers contents are not necessarily disjoint.
35 */
36 class IMPCONTAINEREXPORT DistributeQuadsScoreState : public ScoreState {
38  typedef boost::tuple<Pointer<DynamicListQuadContainer>,
40  Vector<Data> data_;
41  mutable std::size_t input_version_;
42  void update_lists_if_necessary() const;
43 
44  public:
46  std::string name =
47  "DistributeQuadsScoreState %1%");
48 
49  /** A given tuple will go into the returned container if \c predicate
50  returns \c value when applied to it.*/
52  int value) {
54  (input_, predicate->get_name() + " output"));
55  data_.push_back(Data(c, predicate, value));
56  return c;
57  }
58  virtual void do_before_evaluate() override;
59  virtual void do_after_evaluate(DerivativeAccumulator *da) override;
60  virtual ModelObjectsTemp do_get_inputs() const override;
61  virtual ModelObjectsTemp do_get_outputs() const override;
63 };
64 
65 IMPCONTAINER_END_NAMESPACE
66 
67 #endif /* IMPCONTAINER_DISTRIBUTE_QUADS_SCORE_STATE_H */
Store a list of ParticleQuadsTemp.
Define QuadPredicate.
Abstract predicate function.
Definition: QuadPredicate.h:31
virtual void do_before_evaluate()=0
Update the state given the current state of the model.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Macros for various classes.
A container for Quads.
virtual void do_after_evaluate(DerivativeAccumulator *accpt)=0
Do any necessary updates after the model score is calculated.
#define IMP_NEW(Typename, varname, args)
Declare a ref counted pointer to a new object.
Definition: object_macros.h:74
ScoreStates maintain invariants in the Model.
Definition: ScoreState.h:56
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:143
DynamicListQuadContainer * add_predicate(QuadPredicate *predicate, int value)
A class for storing lists of IMP items.
virtual ModelObjectsTemp do_get_outputs() const =0
Distribute contents of one container into several based on predicates.
virtual ModelObjectsTemp do_get_inputs() const =0
Class for adding derivatives from restraints to the model.