IMP logo
IMP Reference Guide  develop.7cb8855c60,2024/10/04
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-2022 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() override;
28  virtual void do_after_evaluate(DerivativeAccumulator *da) override;
29  virtual ModelObjectsTemp do_get_inputs() const override;
30  virtual ModelObjectsTemp do_get_outputs() const override;
32 };
33 
34 IMPMISC_END_NAMESPACE
35 
36 #endif /* IMPMISC_STATE_ADAPTOR_H */
virtual void do_before_evaluate()=0
Update the state given the current state of the model.
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
virtual void do_after_evaluate(DerivativeAccumulator *accpt)=0
Do any necessary updates after the model score is calculated.
A more IMP-like version of the std::vector.
Definition: Vector.h:50
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
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
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
Class for adding derivatives from restraints to the model.