IMP logo
IMP Reference Guide  2.6.2
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-2016 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPISD_LOG_WRAPPER_H
10 #define IMPISD_LOG_WRAPPER_H
11 
12 #include "isd_config.h"
13 #include <IMP/container_macros.h>
14 #include <IMP/Restraint.h>
15 
16 IMPISD_BEGIN_NAMESPACE
17 
18 //! Calculate the -Log of a list of restraints.
19 class IMPISDEXPORT LogWrapper : public Restraint {
20  void on_add(Restraint *r);
21  void on_change();
22  static void on_remove(LogWrapper *container, Restraint *r);
23  void show_it(std::ostream &out) const;
24 
25  public:
26  //! Create an empty set that is registered with the model
27  LogWrapper(Model *m, double weight, const std::string &name = "LogWrapper %1%");
28  //! Create an empty set that is registered with the model
29  LogWrapper(Model *m, const std::string &name = "LogWrapper %1%");
30  //! Create a set that is registered with the model
31  LogWrapper(const RestraintsTemp &rs, double weight,
32  const std::string &name = "LogWrapper %1%");
33 
34  virtual double unprotected_evaluate(
38 
39  IMP_LIST_ACTION(public, Restraint, Restraints, restraint, restraints,
40  Restraint *, Restraints, on_add(obj), on_change(),
41  if (container) on_remove(container, obj));
42 };
43 
44 IMPISD_END_NAMESPACE
45 
46 #endif /* IMPISD_LOG_WRAPPER_H */
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Macros to define containers of objects.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Calculate the -Log of a list of restraints.
Definition: LogWrapper.h:19
Abstract base class for all restraints.
virtual ModelObjectsTemp do_get_inputs() const =0
#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.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:52