IMP  2.3.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-2014 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"
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 kernel::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(kernel::Model *m, double weight, const std::string &name = "LogWrapper %1%");
28  //! Create an empty set that is registered with the model
29  LogWrapper(kernel::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 */
Class for adding derivatives from restraints to the model.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
IMP::base::Vector< IMP::base::WeakPointer< Restraint > > RestraintsTemp
IMP::base::Vector< IMP::base::Pointer< Restraint > > Restraints
A restraint is a term in an IMP ScoringFunction.
Calculate the -Log of a list of restraints.
Definition: LogWrapper.h:19
virtual ModelObjectsTemp do_get_inputs() const =0
Import IMP/kernel/Restraint.h in the namespace.
Macros to define containers of objects.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73