IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
TripletModifier.h
Go to the documentation of this file.
1// Autogenerated by tools/build/make_containers.py
2// from tools/build/container_templates/kernel/ClassnameModifier.h
3// Do not edit - any changes will be lost!
4
5/**
6 * \file IMP/TripletModifier.h
7 * \brief A Modifier on ParticleTripletsTemp
8 *
9 * Copyright 2007-2026 IMP Inventors. All rights reserved.
10 */
11
12#ifndef IMPKERNEL_TRIPLET_MODIFIER_H
13#define IMPKERNEL_TRIPLET_MODIFIER_H
14
15#include <IMP/kernel_config.h>
17#include "base_types.h"
18#include "internal/container_helpers.h"
20
21IMPKERNEL_BEGIN_NAMESPACE
22
23//! A base class for modifiers of ParticleTripletsTemp
24/** The primary function of such a class is to change
25 the passed particles.
26
27 \see IMP::TripletPredicate
28
29 Implementers should see IMP_TRIPLET_MODIFIER().
30 */
31class IMPKERNELEXPORT TripletModifier : public ParticleInputs,
32 public ParticleOutputs,
33 public Object {
34 public:
35 typedef ParticleTriplet Argument;
36 typedef ParticleIndexTriplet IndexArgument;
37 TripletModifier(std::string name = "TripletModifier %1%");
38
39 /** Apply the function to a single value*/
40 virtual void apply_index(Model *m, const ParticleIndexTriplet& v) const = 0;
41
42 /** Apply the function to a collection of ParticleTripletsTemp */
43 /** If bounds are passed, only apply to ones between the upper and
44 lower bounds.*/
45 virtual void apply_indexes(Model *m, const ParticleIndexTriplets &o,
46 unsigned int lower_bound,
47 unsigned int upper_bound) const {
48 for (unsigned int i = lower_bound; i < upper_bound; ++i) {
49 apply_index(m, o[i]);
50 }
51 }
52
53 /** Apply the function to a collection of ParticleTripletsTemp */
54 /** Information on particles that moved since the last scoring function
55 evaluation is also passed, which may be used to accelerate the
56 computation. */
57 virtual void apply_indexes_moved(
58 Model *m, const ParticleIndexTriplets &o,
59 unsigned int lower_bound, unsigned int upper_bound,
60 const ParticleIndexes &moved_pis,
61 const ParticleIndexes &reset_pis) const {
62 IMP_UNUSED(moved_pis);
63 IMP_UNUSED(reset_pis);
64 apply_indexes(m, o, lower_bound, upper_bound);
65 }
66};
67
68IMPKERNEL_END_NAMESPACE
69
70#endif /* IMPKERNEL_TRIPLET_MODIFIER_H */
Class for adding derivatives from restraints to the model.
Basic types used by IMP.
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Object(std::string name)
Construct an object with the given name.
Base class for objects that take particle arguments and read from them.
Base class for objects that take particle arguments and modify them.
virtual void apply_index(Model *m, const ParticleIndexTriplet &v) const =0
virtual void apply_indexes(Model *m, const ParticleIndexTriplets &o, unsigned int lower_bound, unsigned int upper_bound) const
virtual void apply_indexes_moved(Model *m, const ParticleIndexTriplets &o, unsigned int lower_bound, unsigned int upper_bound, const ParticleIndexes &moved_pis, const ParticleIndexes &reset_pis) const
Classes used in the construction of ModelObjects.
Array< 3, ParticleIndex > ParticleIndexTriplet
An ordered triplet of particles, each identified by its ParticleIndex.
Definition base_types.h:204
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Definition base_types.h:199
Array< 3, WeakPointer< Particle >, Particle * > ParticleTriplet
Definition base_types.h:183
IMP::Vector< ParticleIndexTriplet, std::allocator< ParticleIndexTriplet > > ParticleIndexTriplets
Definition base_types.h:209
#define IMP_UNUSED(variable)