home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.13.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
core
version 2.13.0
TableRefiner.h
Go to the documentation of this file.
1
/**
2
* \file IMP/core/TableRefiner.h
3
* \brief A lookup based particle refiner
4
*
5
* Copyright 2007-2020 IMP Inventors. All rights reserved.
6
*/
7
8
#ifndef IMPCORE_TABLE_REFINER_H
9
#define IMPCORE_TABLE_REFINER_H
10
11
#include <IMP/core/core_config.h>
12
13
#include <
IMP/Refiner.h
>
14
#include <boost/unordered_map.hpp>
15
IMPCORE_BEGIN_NAMESPACE
16
17
//! A lookup based particle refiner
18
/** Each particle is refined by returning the list
19
of particles stored for it in a table.
20
*/
21
class
IMPCOREEXPORT
TableRefiner
:
public
Refiner
{
22
boost::unordered_map<Particle *, Particles> map_;
23
24
public
:
25
//! Initialize it with an empty table
26
TableRefiner
();
27
28
//! Add a mapping to the table
29
void
add_particle
(
Particle
*p,
const
ParticlesTemp
&ps);
30
31
//! Remove a mapping from the table
32
void
remove_particle(
Particle
*p);
33
34
//! Set the mapping for a particular particle
35
void
set_particle(
Particle
*p,
const
ParticlesTemp
&ps);
36
37
virtual
bool
get_can_refine
(
Particle
*)
const
IMP_OVERRIDE
;
38
virtual
const
ParticlesTemp
get_refined
(
Particle
*)
const
39
IMP_OVERRIDE
;
40
#ifndef SWIG
41
using
Refiner::get_refined
;
42
#endif
43
virtual
ModelObjectsTemp
do_get_inputs
(
44
Model
*m,
const
ParticleIndexes
&pis)
const
IMP_OVERRIDE
;
45
IMP_OBJECT_METHODS
(
TableRefiner
);
46
};
47
48
IMPCORE_END_NAMESPACE
49
50
#endif
/* IMPCORE_TABLE_REFINER_H */
IMP_OBJECT_METHODS
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition:
object_macros.h:25
IMP::rmf::add_particle
void add_particle(RMF::FileHandle fh, Particle *hs)
IMP::Vector< WeakPointer< Particle > >
IMP::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
Model.h:72
IMP::Refiner::get_can_refine
virtual bool get_can_refine(Particle *) const
Return true if this refiner can refine that particle.
Definition:
Refiner.h:51
Refiner.h
Refine a particle into a list of particles.
IMP::core::TableRefiner
A lookup based particle refiner.
Definition:
TableRefiner.h:21
IMP::ParticleInputs::do_get_inputs
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
IMP::Refiner::get_refined
virtual const ParticlesTemp get_refined(Particle *a) const =0
Refine the passed particle into a set of particles.
IMP::Refiner
Abstract class to implement hierarchical methods.
Definition:
Refiner.h:34
IMP::Particle
Class to handle individual particles of a Model object.
Definition:
Particle.h:41
IMP_OVERRIDE
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Definition:
compiler_macros.h:78