![]() |
Rosetta Protocols
2014.35
|
This class keeps track of the active voxels "up until now" with 64 hashes. More...
#include <OccupiedSpaceHash.hh>
Public Member Functions | |
OccupiedSpaceHash () | |
virtual | ~OccupiedSpaceHash () |
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) |
Size | revision_id () const |
Private Member Functions | |
void | project_point_to_3d (Real6 const &geom) |
boost::uint64_t | bitmask_for_position (Size pos) const |
boost::uint64_t | calc_bin_index (numeric::geometry::hashing::Bin6D const &bin) const |
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.
typedef boost::unordered_map< boost::uint64_t, boost::uint64_t, numeric::geometry::hashing::bin_index_hasher > protocols::match::OccupiedSpaceHash::ActiveVoxelSet |
protocols::match::OccupiedSpaceHash::OccupiedSpaceHash | ( | ) |
|
virtual |
|
private |
return the 64-bit bitmask for a particular bit – numbered in increasing order from right to left.
References utility_exit_with_message.
Referenced by insert_hit_geometry(), match_possible_for_hit_geometry(), and note_hit_geometry().
|
private |
References dim_prods_.
Referenced by insert_hit_geometry(), match_possible_for_hit_geometry(), and note_hit_geometry().
void protocols::match::OccupiedSpaceHash::drop_unsatisfied_voxels | ( | ) |
References hash_, and initialized_.
void protocols::match::OccupiedSpaceHash::initialize | ( | ) |
void protocols::match::OccupiedSpaceHash::insert_hit_geometry | ( | Real6 const & | geom | ) |
References protocols::match::VoxelSetIterator::at_end(), bb_, bin, bitmask_for_position(), calc_bin_index(), numeric::geometry::BoundingBox< class >::contains(), euler_bin_halfwidths_, euler_bin_widths_, protocols::match::VoxelSetIterator::get_bin_and_pos(), hash_, initialized_, n_euler_bins_, n_xyz_bins_, project_point_to_3d(), revision_id_, xyz_bin_halfwidths_, and xyz_bin_widths_.
bool protocols::match::OccupiedSpaceHash::match_possible_for_hit_geometry | ( | Real6 const & | geom | ) | const |
It must be safe for multiple threads to call function simultaneously
References protocols::match::VoxelSetIterator::at_end(), bb_, bin, bitmask_for_position(), calc_bin_index(), numeric::geometry::BoundingBox< class >::contains(), euler_bin_halfwidths_, euler_bin_widths_, protocols::match::VoxelSetIterator::get_bin_and_pos(), hash_, initialized_, n_euler_bins_, n_xyz_bins_, revision_id_, threeD_projection_, xyz_bin_halfwidths_, and xyz_bin_widths_.
Referenced by previous_round_geometry_still_matchable().
void protocols::match::OccupiedSpaceHash::note_hit_geometry | ( | Real6 const & | geom | ) |
References protocols::match::VoxelSetIterator::at_end(), bb_, bin, bitmask_for_position(), calc_bin_index(), numeric::geometry::BoundingBox< class >::contains(), euler_bin_halfwidths_, euler_bin_widths_, protocols::match::VoxelSetIterator::get_bin_and_pos(), hash_, initialized_, n_euler_bins_, n_xyz_bins_, project_point_to_3d(), xyz_bin_halfwidths_, and xyz_bin_widths_.
void protocols::match::OccupiedSpaceHash::prepare_to_note_hits_for_completed_round | ( | ) |
References hash_, reset_3d_projection(), and revision_id_.
bool protocols::match::OccupiedSpaceHash::previous_round_geometry_still_matchable | ( | Real6 const & | geom | ) |
References match_possible_for_hit_geometry(), and project_point_to_3d().
|
private |
References bb_, numeric::geometry::BoundingBox< class >::contains(), numeric::geometry::BoundingBox< class >::lower(), threeD_projection_, numeric::geometry::BoundingBox< class >::upper(), and xyz_bin_widths_.
Referenced by insert_hit_geometry(), note_hit_geometry(), and previous_round_geometry_still_matchable().
void protocols::match::OccupiedSpaceHash::reset_3d_projection | ( | ) |
References threeD_projection_.
Referenced by prepare_to_note_hits_for_completed_round().
OccupiedSpaceHash::Size protocols::match::OccupiedSpaceHash::revision_id | ( | ) | const |
References revision_id_.
void protocols::match::OccupiedSpaceHash::set_bounding_box | ( | BoundingBox const & | bb | ) |
References bb_, and initialized_.
void protocols::match::OccupiedSpaceHash::set_euler_bin_widths | ( | Vector const & | euler_bin_widths | ) |
References euler_bin_halfwidths_, euler_bin_widths_, and initialized_.
void protocols::match::OccupiedSpaceHash::set_uniform_euler_angle_bin_width | ( | Real | bin_width_degrees | ) |
References euler_bin_halfwidths_, euler_bin_widths_, and initialized_.
void protocols::match::OccupiedSpaceHash::set_uniform_xyz_bin_width | ( | Real | bin_width | ) |
References initialized_, xyz_bin_halfwidths_, and xyz_bin_widths_.
void protocols::match::OccupiedSpaceHash::set_xyz_bin_widths | ( | Vector const & | bin_widths | ) |
References initialized_, xyz_bin_halfwidths_, and xyz_bin_widths_.
void protocols::match::OccupiedSpaceHash::write_3Dprojection_kinemage | ( | std::string const & | kin_file_name | ) |
|
private |
|
private |
Referenced by calc_bin_index(), and initialize().
|
private |
|
private |
|
private |
|
private |
|
private |
Referenced by initialize(), insert_hit_geometry(), match_possible_for_hit_geometry(), and note_hit_geometry().
|
private |
Referenced by initialize(), insert_hit_geometry(), match_possible_for_hit_geometry(), and note_hit_geometry().
|
private |
|
private |
|
private |
|
private |