IMP logo
IMP Reference Guide  2.7.0
The Integrative Modeling Platform
StateAdaptor.h
Go to the documentation of this file.
1 /**
2  * \file IMP/misc/StateAdaptor.h
3  * \brief XXXXXXXXXXXXXX
4  *
5  * Copyright 2007-2017 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPMISC_STATE_ADAPTOR_H
9 #define IMPMISC_STATE_ADAPTOR_H
10 
11 #include <IMP/misc/misc_config.h>
12 
13 #include <IMP/OptimizerState.h>
14 #include <IMP/ScoreState.h>
15 
16 IMPMISC_BEGIN_NAMESPACE
17 
18 //! Allow OptimizerStates to be used as ScoreStates
19 /** You can have up to two, one for before, and one for after.
20  */
21 class IMPMISCEXPORT StateAdaptor : public ScoreState {
22  IMP::PointerMember<OptimizerState> before_, after_;
23 
24  public:
25  //! set the before and after states
26  StateAdaptor(Model *m, OptimizerState *before, OptimizerState *after);
27  virtual void do_before_evaluate() IMP_OVERRIDE;
28  virtual void do_after_evaluate(DerivativeAccumulator *da) IMP_OVERRIDE;
32 };
33 
34 IMPMISC_END_NAMESPACE
35 
36 #endif /* IMPMISC_STATE_ADAPTOR_H */
Allow OptimizerStates to be used as ScoreStates.
Definition: StateAdaptor.h:21
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
A more IMP-like version of the std::vector.
Definition: Vector.h:39
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
ScoreStates maintain invariants in the Model.
Definition: ScoreState.h:53
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:146
Shared score state.
virtual ModelObjectsTemp do_get_outputs() const =0
Shared optimizer state that is invoked upon commitment of new coordinates.
Shared optimizer state.
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.