Pteros  2.0
Molecular modeling library for human beings!
distance_search_contacts.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 #pragma once
31 
32 #include "distance_search_base.h"
33 
34 namespace pteros {
35 
36 
37 class DistanceSearchContacts: public DistanceSearchBase {
38 protected:
39  // Implements logic for calling search_between_cells() or search_inside_cell()
40  // with correct grids in derived classes
41  virtual void search_planned_pair(const PlannedPair& pair,
42  std::vector<Eigen::Vector2i> &pairs_buffer,
43  std::vector<float> &distances_buffer) = 0;
44 
45  void do_search();
46 
47  void search_between_cells(const PlannedPair &pair,
48  const Grid &grid1,
49  const Grid &grid2,
50  std::vector<Eigen::Vector2i> &pairs_buffer,
51  std::vector<float> &distances_buffer);
52 
53  void search_inside_cell(const PlannedPair &pair,
54  const Grid &grid,
55  std::vector<Eigen::Vector2i> &pairs_buffer,
56  std::vector<float> &distances_buffer);
57 
58  // Pointers to search results
59  std::vector<Eigen::Vector2i>* pairs;
60  std::vector<float>* distances;
61 
62  void compute_chunk(int b, int e,
63  std::vector<Eigen::Vector2i> &pairs_buf,
64  std::vector<float> &dist_buf);
65 };
66 
67 }
68 
69 
70 
71