IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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
16IMPMISC_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 */
21class IMPMISCEXPORT StateAdaptor : public ScoreState {
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
34IMPMISC_END_NAMESPACE
35
36#endif /* IMPMISC_STATE_ADAPTOR_H */
Shared optimizer state.
Shared score state.
Class for adding derivatives from restraints to the model.
Shared optimizer state that is invoked upon commitment of new coordinates.
StateAdaptor(Model *m, OptimizerState *before, OptimizerState *after)
set the before and after states
virtual ModelObjectsTemp do_get_outputs() const override
virtual void do_before_evaluate() override
Update the state given the current state of the model.
virtual void do_after_evaluate(DerivativeAccumulator *da) override
Do any necessary updates after the model score is calculated.
virtual ModelObjectsTemp do_get_inputs() const override
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
A smart pointer to a ref-counted Object that is a class member.
Definition Pointer.h:144