Pteros  2.0
Molecular modeling library for human beings!
distance_search_within_base.h
1 /*
2  * This file is a part of
3  *
4  * ============================================
5  * ### Pteros molecular modeling library ###
6  * ============================================
7  *
8  * https://github.com/yesint/pteros
9  *
10  * (C) 2009-2021, Semen Yesylevskyy
11  *
12  * All works, which use Pteros, should cite the following papers:
13  *
14  * 1. Semen O. Yesylevskyy, "Pteros 2.0: Evolution of the fast parallel
15  * molecular analysis library for C++ and python",
16  * Journal of Computational Chemistry, 2015, 36(19), 1480–1488.
17  * doi: 10.1002/jcc.23943.
18  *
19  * 2. Semen O. Yesylevskyy, "Pteros: Fast and easy to use open-source C++
20  * library for molecular analysis",
21  * Journal of Computational Chemistry, 2012, 33(19), 1632–1636.
22  * doi: 10.1002/jcc.22989.
23  *
24  * This is free software distributed under Artistic License:
25  * http://www.opensource.org/licenses/artistic-license-2.0.php
26  *
27 */
28 
29 
30 
31 
32 
33 #pragma once
34 
35 #include "distance_search_base.h"
36 
37 namespace pteros {
38 
39 // In this class searching returns only the list of atoms from the source seletion.
40 // No distances are computed.
41 class DistanceSearchWithinBase: public DistanceSearchBase {
42 protected:
43  // Implements logic for calling search_between_cells() or search_inside_cell()
44  // with correct grids in derived classes
45 
46  // Pointer to search results
47  std::unordered_set<int> result;
48 
49  void do_search();
50 
51  void compute_chunk(int b, int e, std::unordered_set<int> &res_buf);
52 
53 private:
54  void search_between_cells(Vector3i_const_ref c1,
55  Vector3i_const_ref c2,
56  Vector3i_const_ref wrapped,
57  std::unordered_set<int> &res_buffer);
58 
59  void search_planned_pair(const PlannedPair& pair,
60  std::unordered_set<int> &res_buffer);
61 };
62 
63 }
64 
65 
66 
67