IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
InContainerPairFilter.h
Go to the documentation of this file.
1// Autogenerated by tools/build/make_containers.py
2// from tools/build/container_templates/container/InContainerClassnameFilter.h
3// Do not edit - any changes will be lost!
4
5/**
6 * \file IMP/container/InContainerPairFilter.h
7 * \brief A filter for Pairs.
8 *
9 * Copyright 2007-2022 IMP Inventors. All rights reserved.
10 */
11
12#ifndef IMPCONTAINER_IN_CONTAINER_PAIR_FILTER_H
13#define IMPCONTAINER_IN_CONTAINER_PAIR_FILTER_H
14
15#include <IMP/container/container_config.h>
16#include <IMP/PairPredicate.h>
17#include <IMP/PairContainer.h>
18#include <IMP/internal/container_helpers.h>
19#include "internal/PairContainerIndex.h"
20#include <IMP/pair_macros.h>
21#include <IMP/object_macros.h>
22#include <IMP/warning_macros.h>
23
24IMPCONTAINER_BEGIN_NAMESPACE
25
26//! A filter which returns true if a container contains the Pair
27/** This predicate returns 1 if the passed tuple is in the container.
28 \note Use the handle_permutations parameter to the constructor to
29 determine whether only exact matches, or matches under permutation
30 are considered matching. By default permutations are allowed.
31 */
32class IMPCONTAINEREXPORT InContainerPairFilter
33 : public PairPredicate {
35
36 public:
37 InContainerPairFilter(PairContainer *c,
38 std::string name = "PairFilter %1%");
39 InContainerPairFilter(PairContainer *c, bool handle_permutations,
40 std::string name = "PairFilter %1%");
41
42 virtual int get_value_index(Model *, const ParticleIndexPair& vt) const
43 override {
44 return c_->get_contains(vt);
45 }
47 Model *m, const ParticleIndexes &pi) const override {
49 ret.push_back(c_);
50 return ret;
51 }
53 IMP_OBJECT_METHODS(InContainerPairFilter);
54};
55
57
58IMPCONTAINER_END_NAMESPACE
59
60#endif /* IMPCONTAINER_IN_CONTAINER_PAIR_FILTER_H */
A container for Pairs.
Define PairPredicate.
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
A shared container for Pairs.
A filter which returns true if a container contains the Pair.
virtual int get_value_index(Model *, const ParticleIndexPair &vt) const override
Compute the predicate and the derivative if needed.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pi) const override
Overload this method to specify the inputs.
IMP::Vector< IMP::Pointer< InContainerPairFilter > > InContainerPairFilters
ParticlesTemp get_particles(Model *m, const ParticleIndexes &ps)
Get the particles from a list of indexes.
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Definition base_types.h:199
Array< 2, ParticleIndex > ParticleIndexPair
An ordered pair of particles, each identified by its ParticleIndex.
Definition base_types.h:202
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
Helper macros for implementing IMP Objects.
#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.
Macros for various classes.
#define IMP_PAIR_PREDICATE_METHODS(Name)
Define extra the functions needed for a PairPredicate.
A smart pointer to a ref-counted Object that is a class member.
Definition Pointer.h:144
Macros to control compiler warnings.