IMP logo
IMP Reference Guide  2.16.0
The Integrative Modeling Platform
LogWrapper.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/LogWrapper.h
3  * \brief Calculate the -Log of a list of restraints.
4  *
5  * Copyright 2007-2021 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPISD_LOG_WRAPPER_H
10 #define IMPISD_LOG_WRAPPER_H
11 
12 #include <IMP/isd/isd_config.h>
13 #include <IMP/container_macros.h>
14 #include <IMP/RestraintSet.h>
15 
16 IMPISD_BEGIN_NAMESPACE
17 
18 //! Calculate the -Log of a list of restraints.
19 /** This is intended to be used with restraints where their score represents
20  the probability (from 0 to 1) of being satisfied.
21  \note Any weights of the wrapped restraints are ignored.
22  */
23 class IMPISDEXPORT LogWrapper : public RestraintSet {
24  void show_it(std::ostream &out) const;
25 
26  public:
27  //! Create an empty set that is registered with the model
28  LogWrapper(Model *m, double weight, const std::string &name = "LogWrapper %1%");
29  //! Create an empty set that is registered with the model
30  LogWrapper(Model *m, const std::string &name = "LogWrapper %1%");
31  //! Create a set that is registered with the model
32  LogWrapper(const RestraintsTemp &rs, double weight,
33  const std::string &name = "LogWrapper %1%");
34 
35  virtual double unprotected_evaluate(
37  virtual double unprotected_evaluate_moved(
38  IMP::DerivativeAccumulator* accum, const ParticleIndexes &moved_pis,
39  const ParticleIndexes &reset_pis) const IMP_OVERRIDE;
40  void do_add_score_and_derivatives(ScoreAccumulator sa) const IMP_OVERRIDE;
41  void do_add_score_and_derivatives_moved(
42  ScoreAccumulator sa, const ParticleIndexes &moved_pis,
43  const ParticleIndexes &reset_pis) const IMP_OVERRIDE;
44 
46 
47 };
48 
49 IMPISD_END_NAMESPACE
50 
51 #endif /* IMPISD_LOG_WRAPPER_H */
Used to hold a set of related restraints.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Macros to define containers of objects.
Object used to hold a set of restraints.
Definition: RestraintSet.h:37
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:73
Class for adding up scores during ScoringFunction evaluation.
Calculate the -Log of a list of restraints.
Definition: LogWrapper.h:23
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.