Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
protocols::match::OccupiedSpaceHash Class Reference

This class keeps track of the active voxels "up until now" with 64 hashes. More...

#include <OccupiedSpaceHash.hh>

Inheritance diagram for protocols::match::OccupiedSpaceHash:
Inheritance graph

Public Types

typedef core::Real Real
typedef core::Size Size
typedef core::Vector Vector
typedef numeric::geometry::BoundingBox< VectorBoundingBox
typedef numeric::geometry::hashing::Real6 Real6
typedef numeric::geometry::hashing::Size3 Size3
typedef numeric::geometry::hashing::Real3 Real3
typedef boost::unordered_map< boost::uint64_t, boost::uint64_t, numeric::geometry::hashing::bin_index_hasher > ActiveVoxelSet

Public Member Functions

 OccupiedSpaceHash ()
 ~OccupiedSpaceHash () override
void set_bounding_box (BoundingBox const &bb)
void set_uniform_xyz_bin_width (Real bin_width)
void set_uniform_euler_angle_bin_width (Real bin_width_degrees)
void set_xyz_bin_widths (Vector const &bin_widths)
void set_euler_bin_widths (Vector const &euler_bin_widths)
void initialize ()
void insert_hit_geometry (Real6 const &geom)
void prepare_to_note_hits_for_completed_round ()
void note_hit_geometry (Real6 const &)
void reset_3d_projection ()
bool previous_round_geometry_still_matchable (Real6 const &)
bool match_possible_for_hit_geometry (Real6 const &) const
void drop_unsatisfied_voxels ()
void write_3Dprojection_kinemage (std::string const &kin_file_name)
core::Size revision_id () const

Private Member Functions

void project_point_to_3d (Real6 const &geom)
boost::uint64_t bitmask_for_position (core::Size pos) const
boost::uint64_t calc_bin_index (numeric::geometry::hashing::Bin6D const &bin) const

Private Attributes

BoundingBox bb_
bool initialized_
Size3 n_xyz_bins_
Size3 n_euler_bins_
utility::fixedsizearray1< boost::uint64_t, 6 > dim_prods_
utility::fixedsizearray1< Real, 3 > xyz_bin_widths_
utility::fixedsizearray1< Real, 3 > euler_bin_widths_
utility::fixedsizearray1< Real, 3 > xyz_bin_halfwidths_
utility::fixedsizearray1< Real, 3 > euler_bin_halfwidths_
ActiveVoxelSet hash_
Bool3DGridOP threeD_projection_
core::Size revision_id_

Detailed Description

This class keeps track of the active voxels "up until now" with 64 hashes.

Each hash has a slightly shifted definition of the origin, so that points which are close in 6D will end up in the same hash voxel in at least one of these 64 hashes. The amount of data held in this table is intentionally small: a single boolean (32 bits). The meaning is as follows: In the first round of matching constraints, "false" is inserted into each of the hashes for each non-colliding placement of the downstream partner. The map is not altered between the end of the first round and the beginning of the second round. At the end of all rounds besides the first round, the Matcher updates the OccupiedSpaceHash object for each non-colliding placement of the dowstream partner found during that round: for each non-colliding placement of the downstream partner and for each of the 64 hashes, the 6Dofs describing the downstream partner are hashed: if the hash finds an element in the hash table, that element's value is set to "true". At the end of each round past the second round, the entire hash is traversed. Any element whose value is "false" represents a voxel that failed to find a match during that round. Such elements are deleted from the hash. Any element whose value is "true" DID get a hit from that round and should remain in the hash. The element's value is set to "false". After the OccupiedSpaceHash has cleared out the elements which failed to find a match for the previous round, the Matcher may proceed to "clean up" its older hits (from rounds previous to this one) by querying them against the hash map. Any hit in the Matcher that does not have a corresponding element in any of the 64 hashes of the OccupiedSpaceHash may be deleted, since it cannot form a complete match.

This class is intended to be accessed by multiple threads but in a controlled way: read access function "match_possible_for_hit_geometry" is accessible to all threads during the "building" stage. However, the functions note_hit_geometry and drop_unsatisfied_voxels should be called by single thread only, and no other thread should try to access the ActiveVoxelHashes object at that time.

Member Typedef Documentation

◆ ActiveVoxelSet

typedef boost::unordered_map< boost::uint64_t, boost::uint64_t, numeric::geometry::hashing::bin_index_hasher > protocols::match::OccupiedSpaceHash::ActiveVoxelSet

◆ BoundingBox

typedef numeric::geometry::BoundingBox< Vector > protocols::match::OccupiedSpaceHash::BoundingBox

◆ Real

◆ Real3

typedef numeric::geometry::hashing::Real3 protocols::match::OccupiedSpaceHash::Real3

◆ Real6

typedef numeric::geometry::hashing::Real6 protocols::match::OccupiedSpaceHash::Real6

◆ Size

◆ Size3

typedef numeric::geometry::hashing::Size3 protocols::match::OccupiedSpaceHash::Size3

◆ Vector

Constructor & Destructor Documentation

◆ OccupiedSpaceHash()

protocols::match::OccupiedSpaceHash::OccupiedSpaceHash ( )

◆ ~OccupiedSpaceHash()

protocols::match::OccupiedSpaceHash::~OccupiedSpaceHash ( )

Member Function Documentation

◆ bitmask_for_position()

boost::uint64_t protocols::match::OccupiedSpaceHash::bitmask_for_position ( core::Size  pos) const

return the 64-bit bitmask for a particular bit – numbered in increasing order from right to left.

Referenced by insert_hit_geometry(), match_possible_for_hit_geometry(), and note_hit_geometry().

◆ calc_bin_index()

boost::uint64_t protocols::match::OccupiedSpaceHash::calc_bin_index ( numeric::geometry::hashing::Bin6D const &  bin) const

◆ drop_unsatisfied_voxels()

void protocols::match::OccupiedSpaceHash::drop_unsatisfied_voxels ( )

References hash_, and initialized_.

◆ initialize()

void protocols::match::OccupiedSpaceHash::initialize ( )

◆ insert_hit_geometry()

void protocols::match::OccupiedSpaceHash::insert_hit_geometry ( Real6 const &  geom)

◆ match_possible_for_hit_geometry()

bool protocols::match::OccupiedSpaceHash::match_possible_for_hit_geometry ( Real6 const &  geom) const

◆ note_hit_geometry()

void protocols::match::OccupiedSpaceHash::note_hit_geometry ( Real6 const &  geom)

◆ prepare_to_note_hits_for_completed_round()

void protocols::match::OccupiedSpaceHash::prepare_to_note_hits_for_completed_round ( )

◆ previous_round_geometry_still_matchable()

bool protocols::match::OccupiedSpaceHash::previous_round_geometry_still_matchable ( Real6 const &  geom)

◆ project_point_to_3d()

void protocols::match::OccupiedSpaceHash::project_point_to_3d ( Real6 const &  geom)

◆ reset_3d_projection()

void protocols::match::OccupiedSpaceHash::reset_3d_projection ( )

◆ revision_id()

OccupiedSpaceHash::Size protocols::match::OccupiedSpaceHash::revision_id ( ) const

References revision_id_.

◆ set_bounding_box()

void protocols::match::OccupiedSpaceHash::set_bounding_box ( BoundingBox const &  bb)

References bb_, and initialized_.

◆ set_euler_bin_widths()

void protocols::match::OccupiedSpaceHash::set_euler_bin_widths ( Vector const &  euler_bin_widths)

◆ set_uniform_euler_angle_bin_width()

void protocols::match::OccupiedSpaceHash::set_uniform_euler_angle_bin_width ( Real  bin_width_degrees)

◆ set_uniform_xyz_bin_width()

void protocols::match::OccupiedSpaceHash::set_uniform_xyz_bin_width ( Real  bin_width)

◆ set_xyz_bin_widths()

void protocols::match::OccupiedSpaceHash::set_xyz_bin_widths ( Vector const &  bin_widths)

◆ write_3Dprojection_kinemage()

void protocols::match::OccupiedSpaceHash::write_3Dprojection_kinemage ( std::string const &  kin_file_name)

Member Data Documentation

◆ bb_

BoundingBox protocols::match::OccupiedSpaceHash::bb_

◆ dim_prods_

utility::fixedsizearray1< boost::uint64_t, 6 > protocols::match::OccupiedSpaceHash::dim_prods_

Referenced by calc_bin_index(), and initialize().

◆ euler_bin_halfwidths_

utility::fixedsizearray1< Real, 3 > protocols::match::OccupiedSpaceHash::euler_bin_halfwidths_

◆ euler_bin_widths_

utility::fixedsizearray1< Real, 3 > protocols::match::OccupiedSpaceHash::euler_bin_widths_

◆ hash_

ActiveVoxelSet protocols::match::OccupiedSpaceHash::hash_

◆ initialized_

bool protocols::match::OccupiedSpaceHash::initialized_

◆ n_euler_bins_

Size3 protocols::match::OccupiedSpaceHash::n_euler_bins_

◆ n_xyz_bins_

Size3 protocols::match::OccupiedSpaceHash::n_xyz_bins_

◆ revision_id_

core::Size protocols::match::OccupiedSpaceHash::revision_id_

◆ threeD_projection_

Bool3DGridOP protocols::match::OccupiedSpaceHash::threeD_projection_

◆ xyz_bin_halfwidths_

utility::fixedsizearray1< Real, 3 > protocols::match::OccupiedSpaceHash::xyz_bin_halfwidths_

◆ xyz_bin_widths_

utility::fixedsizearray1< Real, 3 > protocols::match::OccupiedSpaceHash::xyz_bin_widths_

The documentation for this class was generated from the following files: