home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.20.1
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
em2d
version 2.20.1
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
>
19
#include <
IMP/SingletonContainer.h
>
20
21
IMPEM2D_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
*/
33
class
IMPEM2DEXPORT
DummyRestraint
:
public
Restraint
{
34
Pointer<Particle>
p0_;
35
Pointer<Particle>
p1_;
36
37
public
:
38
/**
39
* Inits the dummy restraint between the particles
40
* @param p First particle
41
* @param q Second particle
42
*/
43
DummyRestraint
(
IMP::Particle
*p,
IMP::Particle
*q)
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
57
virtual
double
unprotected_evaluate
(
IMP::DerivativeAccumulator
*accum)
58
const override
;
59
virtual
IMP::ModelObjectsTemp
do_get_inputs
()
const override
;
60
IMP_OBJECT_METHODS
(
DummyRestraint
);
61
};
62
IMP_OBJECTS
(
DummyRestraint
,
DummyRestraints
);
63
64
//! Dummy restraint for a set of particles. Same use as DummyRestraint
65
class
IMPEM2DEXPORT
ParticlesDummyRestraint
:
public
Restraint
{
66
Pointer<SingletonContainer>
container_;
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
*/
73
ParticlesDummyRestraint
(
SingletonContainer
*sc)
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
86
virtual
double
unprotected_evaluate
(
IMP::DerivativeAccumulator
*accum)
87
const override
;
88
virtual
IMP::ModelObjectsTemp
do_get_inputs
()
const override
;
89
IMP_OBJECT_METHODS
(
ParticlesDummyRestraint
);
90
};
91
IMP_OBJECTS
(
ParticlesDummyRestraint
,
ParticlesDummyRestraints
);
92
93
IMPEM2D_END_NAMESPACE
94
95
#endif
/* IMPEM2D_DUMMY_RESTRAINT_H */
SingletonContainer.h
A container for Singletons.
IMP_OBJECT_METHODS
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition:
object_macros.h:25
IMP::Restraint::unprotected_evaluate
virtual double unprotected_evaluate(DerivativeAccumulator *da) const
Return the unweighted score for the restraint.
IMP::em2d::DummyRestraint::DummyRestraint
DummyRestraint(IMP::Particle *p, IMP::Particle *q)
Definition:
DummyRestraint.h:43
IMP::em2d::ParticlesDummyRestraint
Dummy restraint for a set of particles. Same use as DummyRestraint.
Definition:
DummyRestraint.h:65
IMP::Vector
A more IMP-like version of the std::vector.
Definition:
Vector.h:42
IMP::Pointer
A smart pointer to a reference counted object.
Definition:
Pointer.h:87
IMP::em2d::DummyRestraint::show
void show(std::ostream &out=std::cout) const
Definition:
DummyRestraint.h:53
IMP::SingletonContainer
A shared container for Singletons.
Definition:
SingletonContainer.h:39
IMP::em2d::DummyRestraint
Dummy restraint between two particles.
Definition:
DummyRestraint.h:33
IMP_OBJECTS
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Definition:
object_macros.h:44
IMP::em2d::ParticlesDummyRestraint::show
void show(std::ostream &out=std::cout) const
Definition:
DummyRestraint.h:82
Pointer.h
A nullptr-initialized pointer to an IMP Object.
IMP::em2d::ParticlesDummyRestraint::ParticlesDummyRestraint
ParticlesDummyRestraint(SingletonContainer *sc)
Definition:
DummyRestraint.h:73
IMP::Particle
Class to handle individual particles of a Model object.
Definition:
Particle.h:43
Restraint.h
Abstract base class for all restraints.
log.h
Logging and error reporting support.
IMP::ModelObject::do_get_inputs
virtual ModelObjectsTemp do_get_inputs() const =0
IMP::DerivativeAccumulator
Class for adding derivatives from restraints to the model.
Definition:
DerivativeAccumulator.h:24
IMP::Restraint
A restraint is a term in an IMP ScoringFunction.
Definition:
Restraint.h:56