|
Rosetta 3.5
|
This class keeps track of the active voxels "up until now" with 64 hashes. More...
#include <OccupiedSpaceHash.hh>


Public Types | |
| typedef core::Real | Real |
| typedef core::Size | Size |
| typedef core::Vector | Vector |
| typedef numeric::geometry::BoundingBox < Vector > | BoundingBox |
| 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 () | |
| 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 |
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_ |
| Size | revision_id_ |
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.
Definition at line 77 of file OccupiedSpaceHash.hh.
| typedef boost::unordered_map< boost::uint64_t, boost::uint64_t, numeric::geometry::hashing::bin_index_hasher > protocols::match::OccupiedSpaceHash::ActiveVoxelSet |
Definition at line 86 of file OccupiedSpaceHash.hh.
| typedef numeric::geometry::BoundingBox< Vector > protocols::match::OccupiedSpaceHash::BoundingBox |
Definition at line 82 of file OccupiedSpaceHash.hh.
Definition at line 79 of file OccupiedSpaceHash.hh.
| typedef numeric::geometry::hashing::Real3 protocols::match::OccupiedSpaceHash::Real3 |
Definition at line 85 of file OccupiedSpaceHash.hh.
| typedef numeric::geometry::hashing::Real6 protocols::match::OccupiedSpaceHash::Real6 |
Definition at line 83 of file OccupiedSpaceHash.hh.
Definition at line 80 of file OccupiedSpaceHash.hh.
| typedef numeric::geometry::hashing::Size3 protocols::match::OccupiedSpaceHash::Size3 |
Definition at line 84 of file OccupiedSpaceHash.hh.
Definition at line 81 of file OccupiedSpaceHash.hh.
| protocols::match::OccupiedSpaceHash::OccupiedSpaceHash | ( | ) |
Definition at line 38 of file OccupiedSpaceHash.cc.
|
virtual |
Definition at line 39 of file OccupiedSpaceHash.cc.
|
private |
return the 64-bit bitmask for a particular bit – numbered in increasing order from right to left.
Definition at line 370 of file OccupiedSpaceHash.cc.
Referenced by insert_hit_geometry(), match_possible_for_hit_geometry(), and note_hit_geometry().
|
private |
Definition at line 452 of file OccupiedSpaceHash.cc.
References dim_prods_.
Referenced by insert_hit_geometry(), match_possible_for_hit_geometry(), and note_hit_geometry().
| void protocols::match::OccupiedSpaceHash::drop_unsatisfied_voxels | ( | ) |
Definition at line 284 of file OccupiedSpaceHash.cc.
References hash_, and initialized_.
| void protocols::match::OccupiedSpaceHash::initialize | ( | ) |
Definition at line 103 of file OccupiedSpaceHash.cc.
References bb_, dim_prods_, euler_bin_widths_, initialized_, n_euler_bins_, n_xyz_bins_, protocols::sic_dock::range(), threeD_projection_, and xyz_bin_widths_.
| void protocols::match::OccupiedSpaceHash::insert_hit_geometry | ( | Real6 const & | geom) |
Definition at line 137 of file OccupiedSpaceHash.cc.
References protocols::match::VoxelSetIterator::at_end(), bb_, bitmask_for_position(), calc_bin_index(), 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
Definition at line 234 of file OccupiedSpaceHash.cc.
References protocols::match::VoxelSetIterator::at_end(), bb_, bitmask_for_position(), calc_bin_index(), 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) |
Definition at line 204 of file OccupiedSpaceHash.cc.
References protocols::match::VoxelSetIterator::at_end(), bb_, bitmask_for_position(), calc_bin_index(), 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 | ( | ) |
Definition at line 168 of file OccupiedSpaceHash.cc.
References hash_, reset_3d_projection(), and revision_id_.
| bool protocols::match::OccupiedSpaceHash::previous_round_geometry_still_matchable | ( | Real6 const & | geom) |
Definition at line 194 of file OccupiedSpaceHash.cc.
References match_possible_for_hit_geometry(), and project_point_to_3d().
|
private |
Definition at line 322 of file OccupiedSpaceHash.cc.
References bb_, threeD_projection_, 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 | ( | ) |
Definition at line 187 of file OccupiedSpaceHash.cc.
References threeD_projection_.
Referenced by prepare_to_note_hits_for_completed_round().
| OccupiedSpaceHash::Size protocols::match::OccupiedSpaceHash::revision_id | ( | ) | const |
Definition at line 315 of file OccupiedSpaceHash.cc.
References revision_id_.
| void protocols::match::OccupiedSpaceHash::set_bounding_box | ( | BoundingBox const & | bb) |
Definition at line 42 of file OccupiedSpaceHash.cc.
References bb_, and initialized_.
| void protocols::match::OccupiedSpaceHash::set_euler_bin_widths | ( | Vector const & | euler_bin_widths) |
Definition at line 87 of file OccupiedSpaceHash.cc.
References euler_bin_halfwidths_, euler_bin_widths_, and initialized_.
| void protocols::match::OccupiedSpaceHash::set_uniform_euler_angle_bin_width | ( | Real | bin_width_degrees) |
Definition at line 63 of file OccupiedSpaceHash.cc.
References euler_bin_halfwidths_, euler_bin_widths_, and initialized_.
| void protocols::match::OccupiedSpaceHash::set_uniform_xyz_bin_width | ( | Real | bin_width) |
Definition at line 51 of file OccupiedSpaceHash.cc.
References initialized_, xyz_bin_halfwidths_, and xyz_bin_widths_.
| void protocols::match::OccupiedSpaceHash::set_xyz_bin_widths | ( | Vector const & | bin_widths) |
Definition at line 75 of file OccupiedSpaceHash.cc.
References initialized_, xyz_bin_halfwidths_, and xyz_bin_widths_.
| void protocols::match::OccupiedSpaceHash::write_3Dprojection_kinemage | ( | std::string const & | kin_file_name) |
Definition at line 304 of file OccupiedSpaceHash.cc.
References protocols::match::Bool3DGridKinemageWriter::set_skip_completely_buried_positions(), threeD_projection_, and protocols::match::Bool3DGridKinemageWriter::write_grid_to_kinemage().
|
private |
Definition at line 154 of file OccupiedSpaceHash.hh.
Referenced by initialize(), insert_hit_geometry(), match_possible_for_hit_geometry(), note_hit_geometry(), project_point_to_3d(), and set_bounding_box().
|
private |
Definition at line 160 of file OccupiedSpaceHash.hh.
Referenced by calc_bin_index(), and initialize().
|
private |
Definition at line 166 of file OccupiedSpaceHash.hh.
Referenced by insert_hit_geometry(), match_possible_for_hit_geometry(), note_hit_geometry(), set_euler_bin_widths(), and set_uniform_euler_angle_bin_width().
|
private |
Definition at line 163 of file OccupiedSpaceHash.hh.
Referenced by initialize(), insert_hit_geometry(), match_possible_for_hit_geometry(), note_hit_geometry(), set_euler_bin_widths(), and set_uniform_euler_angle_bin_width().
|
private |
Definition at line 170 of file OccupiedSpaceHash.hh.
Referenced by drop_unsatisfied_voxels(), insert_hit_geometry(), match_possible_for_hit_geometry(), note_hit_geometry(), and prepare_to_note_hits_for_completed_round().
|
private |
Definition at line 156 of file OccupiedSpaceHash.hh.
Referenced by drop_unsatisfied_voxels(), initialize(), insert_hit_geometry(), match_possible_for_hit_geometry(), note_hit_geometry(), set_bounding_box(), set_euler_bin_widths(), set_uniform_euler_angle_bin_width(), set_uniform_xyz_bin_width(), and set_xyz_bin_widths().
|
private |
Definition at line 159 of file OccupiedSpaceHash.hh.
Referenced by initialize(), insert_hit_geometry(), match_possible_for_hit_geometry(), and note_hit_geometry().
|
private |
Definition at line 158 of file OccupiedSpaceHash.hh.
Referenced by initialize(), insert_hit_geometry(), match_possible_for_hit_geometry(), and note_hit_geometry().
|
private |
Definition at line 174 of file OccupiedSpaceHash.hh.
Referenced by insert_hit_geometry(), match_possible_for_hit_geometry(), prepare_to_note_hits_for_completed_round(), and revision_id().
|
private |
Definition at line 172 of file OccupiedSpaceHash.hh.
Referenced by initialize(), match_possible_for_hit_geometry(), project_point_to_3d(), reset_3d_projection(), and write_3Dprojection_kinemage().
|
private |
Definition at line 165 of file OccupiedSpaceHash.hh.
Referenced by insert_hit_geometry(), match_possible_for_hit_geometry(), note_hit_geometry(), set_uniform_xyz_bin_width(), and set_xyz_bin_widths().
|
private |
Definition at line 162 of file OccupiedSpaceHash.hh.
Referenced by initialize(), insert_hit_geometry(), match_possible_for_hit_geometry(), note_hit_geometry(), project_point_to_3d(), set_uniform_xyz_bin_width(), and set_xyz_bin_widths().
1.8.4