IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
WeightedDerivativesToRefined.h
Go to the documentation of this file.
1/**
2 * \file IMP/core/WeightedDerivativesToRefined.h
3 * \brief Copies derivatives from coarse grained particle
4 * to its refined set of particles using weights
5 * indicated by a weight key.
6 *
7 * Copyright 2007-2026 IMP Inventors. All rights reserved.
8 */
9
10#ifndef IMPCORE_WEIGHTED_DERIVATIVES_TO_REFINED_H
11#define IMPCORE_WEIGHTED_DERIVATIVES_TO_REFINED_H
12
13#include <IMP/core/core_config.h>
14
15#include "XYZ.h"
16#include <IMP/Refiner.h>
18#include <IMP/Pointer.h>
20
21IMPCORE_BEGIN_NAMESPACE
22
23//! Copy the derivatives from a coarse particle to its refined particles
24/** \see DerivativesFromRefined
25 \see DerivativesToRefined
26 \see Centroid
27 \see atom::CenterOfMass
28 */
29class IMPCOREEXPORT WeightedDerivativesToRefined : public SingletonModifier {
31 FloatKey w_; // weights key
32 FloatKeys keys_;
33
34 public:
35 //! Constructs a weighted derivatives-to-refined modifier that copies
36 //! derivatives from the coarse particle to its refinement
37 /**
38 Constructs a weighted derivatives-to-refined modifier that copies
39 derivatives from the coarse particle to its refinement. The modifier
40 copy the derivatives of keys to the particles returned by r, using weights w,
41 divided by weight of pi.
42
43 @param r a refiner to get fine particles for particle
44 @param w the key for the weight given to derivatives of the fine
45 particle (to be divided by the weight of the coarse
46 particle). If w equals FloatKey(), then a default weight
47 of [1.0 / N] is used, for N equals the number of particles
48 returned by r.
49 @param keys the keys whose derivatives are to be copied.
50 */
52 FloatKey w = FloatKey(),
54
55 //! Copies weighted derivatives to fine particles
56 /**
57 Copy ks to the particles returned by the refiner r, using weights w,
58 divided by weight of pi, all as indicated in the constructor
59
60 @param m the model
61 @param pi the coarse grained particle
62 */
63 virtual void apply_index(Model *m, ParticleIndex pi) const
64 override;
65
67 Model *m, const ParticleIndexes &pis) const override;
68
70 Model *m, const ParticleIndexes &pis) const override;
71
73
75};
76
77IMPCORE_END_NAMESPACE
78
79#endif /* IMPCORE_WEIGHTED_DERIVATIVES_TO_REFINED_H */
A nullptr-initialized pointer to an IMP Object.
Refine a particle into a list of particles.
A Modifier on ParticlesTemp.
Simple XYZ decorator.
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Abstract class to implement hierarchical methods.
Definition Refiner.h:36
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
virtual void apply_index(Model *m, ParticleIndex pi) const override
Copies weighted derivatives to fine particles.
WeightedDerivativesToRefined(Refiner *r, FloatKey w=FloatKey(), FloatKeys keys=XYZ::get_xyz_keys())
virtual ModelObjectsTemp do_get_outputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the outputs.
static const FloatKeys & get_xyz_keys()
Get a vector containing the keys for x,y,z.
Index< ParticleIndexTag > ParticleIndex
Definition base_types.h:196
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Definition base_types.h:199
Key< 0 > FloatKey
The type used to identify float attributes in the Particles.
Definition base_types.h:32
IMP::Vector< FloatKey > FloatKeys
Definition base_types.h:33
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Macros for various classes.
#define IMP_SINGLETON_MODIFIER_METHODS(Name)
A smart pointer to a ref-counted Object that is a class member.
Definition Pointer.h:144