IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
DummyRestraint.h
Go to the documentation of this file.
1/**
2 * \file IMP/em2d/DummyRestraint.h
3 * \brief
4 *
5 * Copyright 2007-2022 IMP Inventors. All rights reserved.
6 *
7 */
8
9#ifndef IMPEM2D_DUMMY_RESTRAINT_H
10#define IMPEM2D_DUMMY_RESTRAINT_H
11
12#include <IMP/em2d/em2d_config.h>
13#include "IMP/log.h"
14#include <IMP/Restraint.h>
15#include "IMP/Pointer.h"
16
17#include <IMP/Restraint.h>
18#include <IMP/log.h>
20
21IMPEM2D_BEGIN_NAMESPACE
22
23//! Dummy restraint between two particles
24/*!
25 The restraint does do anything and returns 0 as a value. Use this
26 restraint to force two particles to be considered by DOMINO as belonging
27 to a restraint. This trick can be useful when building the merge tree for
28 DOMINO, as can add branches that consider pairs of particles before entire
29 subsets.
30 NOTE: Using this restraint for DOMINO requires a fairly good knowledge of
31 the works of merge trees.
32*/
33class IMPEM2DEXPORT DummyRestraint : public Restraint {
36
37 public:
38 /**
39 * Inits the dummy restraint between the particles
40 * @param p First particle
41 * @param q Second particle
42 */
44 : Restraint(p->get_model(), "DummyRestraint%1%") {
45 p0_ = p;
46 p1_ = q;
47 }
48
49 /**
50 * Shows information about the class
51 * @param out Stream used to show the information
52 */
53 void show(std::ostream &out = std::cout) const {
54 out << "Dummy Restraint" << std::endl;
55 }
56
58 const override;
59 virtual IMP::ModelObjectsTemp do_get_inputs() const override;
61};
63
64//! Dummy restraint for a set of particles. Same use as DummyRestraint
65class IMPEM2DEXPORT ParticlesDummyRestraint : public Restraint {
67
68 public:
69 /**
70 * Sets a dummy restraint for a set of particles
71 * @param sc Must contain all the particles that are going to be restrained
72 */
74 : Restraint(sc->get_model(), "ParticlesDummyRestraint%1%") {
75 container_ = sc;
76 }
77
78 /**
79 * Shows information about the class
80 * @param out Stream used to show the information
81 */
82 void show(std::ostream &out = std::cout) const {
83 out << "ParticlesDummyRestraint" << std::endl;
84 }
85
87 const override;
88 virtual IMP::ModelObjectsTemp do_get_inputs() const override;
90};
92
93IMPEM2D_END_NAMESPACE
94
95#endif /* IMPEM2D_DUMMY_RESTRAINT_H */
A nullptr-initialized pointer to an IMP Object.
Abstract base class for all restraints.
A container for Singletons.
Class for adding derivatives from restraints to the model.
Class to handle individual particles of a Model object.
Definition Particle.h:45
Restraint(Model *m, std::string name)
Create a restraint and register it with the model.
A shared container for Singletons.
Dummy restraint between two particles.
virtual IMP::ModelObjectsTemp do_get_inputs() const override
DummyRestraint(IMP::Particle *p, IMP::Particle *q)
void show(std::ostream &out=std::cout) const
virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const override
Return the unweighted score for the restraint.
Dummy restraint for a set of particles. Same use as DummyRestraint.
ParticlesDummyRestraint(SingletonContainer *sc)
virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const override
Return the unweighted score for the restraint.
virtual IMP::ModelObjectsTemp do_get_inputs() const override
void show(std::ostream &out=std::cout) const
Logging and error reporting support.
IMP::Vector< IMP::Pointer< DummyRestraint > > DummyRestraints
IMP::Vector< IMP::Pointer< ParticlesDummyRestraint > > ParticlesDummyRestraints
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
A smart pointer to a reference counted object.
Definition Pointer.h:88