Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TenANeighborGraph.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file core/scoring/TenANeighborGraph.hh
11 /// @brief Ten Angstrom Neighbor Graph class declaration
12 /// @author Andrew Leaver-Fay (leaverfa@email.unc.edu)
13 
14 #ifndef INCLUDED_core_scoring_TenANeighborGraph_hh
15 #define INCLUDED_core_scoring_TenANeighborGraph_hh
16 
17 // Unit Headers
19 
20 // Package Headers
22 
23 // Project Headers
24 #include <core/graph/Graph.hh>
25 
26 #include <core/pose/Pose.fwd.hh>
27 
28 #include <utility/vector1.hh>
29 
30 
31 namespace core {
32 namespace scoring {
33 
35 {
36 public:
38 
39 public:
40  virtual ~TenANeighborNode();
41  TenANeighborNode( graph::Graph*, Size node_id );
42 
43  virtual void copy_from( Node const * source );
44 
45  virtual Size count_static_memory() const;
46  virtual Size count_dynamic_memory() const;
47 
48  /// @brief set the neighbor mass for a vertex
49  void neighbor_mass( Real mass );
50 
51  /// @brief return the neighbor mass for a vertex
52  inline
54  { return neighbor_mass_; }
55 
56  inline
58  {
61  }
63  }
64 
65  /// @brief To be called by TenANeighborEdge only
66  /// called at the time of edge addition
67  void add_neighbors_mass( Real neighbors_mass ) {
68  sum_of_neighbors_masses_ += neighbors_mass;
70  }
71 
72  /// @brief To be called by TenANeighborEdge only
73  /// called at the time of edge deletion
74  void subtract_neighbors_mass( Real neighbors_mass ) {
75  sum_of_neighbors_masses_ -= neighbors_mass;
77  }
78 private:
79  void
81 
82 private:
83  static Size const TIME_TO_UPDATE = 1024;
84 
88 };
89 
91 {
92 public:
94 
95 public:
96  virtual ~TenANeighborEdge();
97  TenANeighborEdge(graph::Graph* owner, Size first_node_ind, Size second_node_ind);
98 
99  virtual void copy_from( graph::Edge const * source );
100 
101  virtual Size count_static_memory() const;
102  virtual Size count_dynamic_memory() const;
103 
104 private:
105  inline
106  TenANeighborNode const *
107  get_TenANode( Size node_index ) const {
108  assert( dynamic_cast< TenANeighborNode const * > ( get_node( node_index ) ) );
109  return static_cast< TenANeighborNode const * > ( get_node( node_index ) );
110  }
111 
112  inline
114  get_TenANode( Size node_index ) {
115  assert( dynamic_cast< TenANeighborNode * > ( get_node( node_index ) ) );
116  return static_cast< TenANeighborNode * > ( get_node( node_index ) );
117  }
118 
119 };
120 
122 {
123 public:
125 
126 public:
127 
128  virtual ~TenANeighborGraph();
129 
132  TenANeighborGraph( TenANeighborGraph const & source );
133  TenANeighborGraph & operator = ( TenANeighborGraph const & source );
134 
135  virtual
136  Distance
137  neighbor_cutoff() const;
138 
139  virtual
140  void
142  Size lower_node_id,
143  Size upper_node_id,
144  DistanceSquared dsq
145  );
146 
147  virtual
149  clone() const;
150 
151  virtual
152  void update_from_pose(
153  pose::Pose const & pose
154  );
155 
156  virtual void delete_edge( graph::Edge * edge );
157 
158 
159 protected:
160 
161  virtual Size count_static_memory() const;
162  virtual Size count_dynamic_memory() const;
163 
164  virtual graph::Node * create_new_node( Size node_index );
165  virtual graph::Edge * create_new_edge( Size index1, Size index2);
166  virtual graph::Edge * create_new_edge( graph::Edge const * example_edge );
167 
168 private:
169  static Distance const tenA_;
171 
173 
174 };
175 
176 } // scoring
177 } // core
178 
179 #endif