Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CountPairDataGeneric.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/etable/etrie/CountPairDataGeneric.hh
11 /// @brief Class to hold per-atom count pair for residues with non-canonical inter-residue connections
12 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
13 
14 #ifndef INCLUDED_core_scoring_etable_etrie_CountPairDataGeneric_hh
15 #define INCLUDED_core_scoring_etable_etrie_CountPairDataGeneric_hh
16 
17 // Unit Headers
19 
20 // Project Headers
21 #include <core/types.hh>
22 
23 // Utility headers
24 // AUTO-REMOVED #include <utility/vector0.hh>
25 #include <utility/vector1.hh>
26 
27 // STL Headers
28 #include <iosfwd>
29 
30 #include <platform/types.hh>
31 #include <utility/vector1.fwd.hh>
32 #include <utility/vector1_bool.hh>
33 #include <utility/vectorL.fwd.hh>
34 #include <utility/vectorL.hh>
35 #include <utility/vectorL_Selector.hh>
36 #include <utility/vectorL_bool.hh>
37 #include <numeric/xyzVector.fwd.hh>
38 #include <algorithm>
39 #include <cassert>
40 #include <cstddef>
41 #include <limits>
42 #include <vector>
43 
44 
45 namespace core {
46 namespace scoring {
47 namespace etable {
48 namespace etrie {
49 
51 {
52 private:
54 
55 public:
56 
58 
59  GenericResidueConnectionData( Size n_connections );
60 
61  inline
62  bool operator < ( GenericResidueConnectionData const & other ) const
63  {
64  assert( size() == other.size() );
65  for ( Size ii = 1; ii <= path_distances_to_connection_points_.size(); ++ii ) {
67  return true;
69  return false;
70  }
71  }
72  return false;
73  }
74 
75  inline
76  bool operator == ( GenericResidueConnectionData const & other ) const
77  {
78  assert( size() == other.size() );
79  for ( Size ii = 1; ii <= path_distances_to_connection_points_.size(); ++ii ) {
81  return false;
82  }
83  }
84  return true;
85  }
86 
87  inline
88  bool operator != ( GenericResidueConnectionData const & other ) const
89  {
90  return ! operator == ( other );
91  }
92 
93 
94  /// @brief getter
95  Size
96  operator [] ( Size connection ) const {
97  return path_distances_to_connection_points_[ connection ];
98  }
99 
100  void set_dist_to_connect_point( Size connpoint, Size connection_dist );
101 
102  Size
103  size() const {
105  }
106 };
107 
109 {
110 private:
111 
112  /// Vector0 to match index-from-0 convention that the other CountPairData classes use (since they hold c-style arrays).
113  ///iwd Lies! All other CountPair-related classes use indexing from 1. The above comment appears to be out-of-date.
114  /// Almost all code for this class assumes indexing from 1.
116  //mutable GenericResidueConnectionData const * data_at_hand_;
117 
118 public:
120 
121  /// @brief "entry" is indexed from 1
122  void set_dist_to_connect_point( Size entry, Size connpoint, Size connection_dist );
123 
124  void print( std::ostream & os ) const;
125 
126  inline
127  bool operator < ( CountPairDataGeneric const & other ) const
128  {
129  for( Size ii = 1; ii <= residue_connection_data_.size(); ++ii ) {
130  if ( residue_connection_data_[ ii ] < other.residue_connection_data_[ ii ] ) {
131  return true;
132  } else if ( other.residue_connection_data_[ ii ] != residue_connection_data_[ ii ] ) {
133  return false;
134  }
135  }
136  return false;
137  }
138 
139  inline
140  bool operator == ( CountPairDataGeneric const & other ) const
141  {
142 
143  for (Size ii = 1; ii <= residue_connection_data_.size(); ++ii ) {
144  if (residue_connection_data_[ ii ] != other.residue_connection_data_[ ii ])
145  return false;
146  }
147  return true;
148  }
149 
150  //void
151  //set_count_pair_data_to_use( Size entry ) const;
152 
153  /// For use by the 1-connection TrieCountPair functions
154  /// Indexed from 0.
155  inline
156  Size
157  conn_dist( Size which_connection ) const
158  {
159  assert ( residue_connection_data_[ which_connection+1 ].size() == 1 );
160  return residue_connection_data_[ which_connection+1 ][1];
161  }
162 
163  inline
164  Size
166  return residue_connection_data_.size();
167  }
168 
169  /// Indexed from 0.
170  inline
172  conn_dat( Size which_connection ) const {
173  return residue_connection_data_[ which_connection+1 ];
174  }
175 
176 };
177 
178 std::ostream & operator << ( std::ostream & os, CountPairDataGeneric const & cpdat );
179 
180 
181 } // namespace etrie
182 } // namespace etable
183 } // namespace scoring
184 } // namespace core
185 
186 #endif