Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TwelveANeighborGraph.cc
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/TwelveANeighborGraph.cc
11 /// @brief Neighbor graph to represent for each residue the number of other residues within 12 Angstroms
12 /// @author Mike Tyka mtyka@u.washington.edu
13 
14 // Unit Headers
16 
17 #include <utility/vector1.hh>
18 
19 
20 
21 namespace core {
22 namespace scoring {
23 
24 ///////////////////////////////
25 // class TwelveANeighborNode ///
26 ///////////////////////////////
27 
29 
31 :
32  parent( owner, node_id )
33 {}
34 
35 void
36 TwelveANeighborNode::copy_from( Node const * /*source*/ )
37 {
38  //assert( dynamic_cast< TwelveANeighborNode const * > (source) );
39 }
40 
41 Size
43  return sizeof( TwelveANeighborNode );
44 }
45 
46 
47 Size
50 }
51 
52 ///////////////////////////////
53 // class TwelveANeighborEdge ///
54 ///////////////////////////////
55 
57 
59  graph::Graph* owner,
60  Size first_node_ind,
61  Size second_node_ind )
62 :
63  parent( owner, first_node_ind, second_node_ind )
64 {}
65 
66 void TwelveANeighborEdge::copy_from( Edge const * /*source*/ )
67 {
68  //assert( dynamic_cast< TwelveNeighborEdge const * > ( source ) );
69 }
70 
72 {
73  return sizeof( TwelveANeighborEdge );
74 }
75 
77 {
79 }
80 
81 ///////////////////////////////
82 // class TwelveANeighborGraph ///
83 ///////////////////////////////
84 
85 /// @details -- 12 A between nbr_atoms, + 6.12 A to the tip of arginine
87 
89 
91 
93 :
94  parent()
95 {}
96 
98 :
99  parent()
100 {
101  set_num_nodes( num_nodes );
102 }
103 
105 :
106  parent( source )
107 {
108  operator = ( source );
109 }
110 
111 
114 {
115  return static_cast< TwelveANeighborGraph & > (parent::operator = ( source ));
116 }
117 
118 Distance
120 {
121  return twelveA_;
122 }
123 
124 void
126  Size lower_node_id,
127  Size upper_node_id,
128  DistanceSquared dsq
129 )
130 {
131  if ( dsq < twelveA_squared_ ) add_edge( lower_node_id, upper_node_id );
132 }
133 
136 {
137  return new TwelveANeighborGraph( *this );
138 }
139 
140 void
142  pose::Pose const & /*pose*/
143 )
144 {}
145 
146 Size
148  return sizeof ( TwelveANeighborGraph );
149 }
150 
151 Size
154 }
155 
157 {
158  delete edge;
159 }
160 
163  return new TwelveANeighborNode( this, node_index );
164 }
165 
168 {
169  return new TwelveANeighborEdge( this, index1, index2 );
170 }
171 
174 {
175  return new TwelveANeighborEdge(
176  this,
177  example_edge->get_first_node_ind(),
178  example_edge->get_second_node_ind()
179  );
180 }
181 
182 
183 } // scoring
184 } // core
185