Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FixedBBInteractionGraph.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/pack/interaction_graph/FixedBBInteractionGraph.hh
11 /// @brief Interaction graph base class for fixed-backbone packing
12 /// @author Andrew Leaver-Fay (leaverfa@email.unc.edu)
13 
14 
15 #ifndef INCLUDED_core_pack_interaction_graph_FixedBBInteractionGraph_hh
16 #define INCLUDED_core_pack_interaction_graph_FixedBBInteractionGraph_hh
17 
18 // Unit Headers
20 
21 // Package Headers
23 
24 /// This layer of abstraction between the InteractionGraphBase and the
25 /// various fixed-backbone interaction graphs is primarily to allow
26 /// outside users to READ from an interaction graph -- to grab data
27 /// that the interaction graph stores. This is not so much for the
28 /// writing of information -- in particular, edge energies -- to an
29 /// interaction graph.
30 
31 namespace core {
32 namespace pack {
33 namespace interaction_graph {
34 
35 class FixedBBNode : public NodeBase
36 {
37 public:
38  virtual ~FixedBBNode() {}
39 
41  InteractionGraphBase * owner,
42  int node_id,
43  int num_states)
44  :
45  NodeBase( owner, node_id, num_states )
46  {}
47 
48 };
49 
50 class FixedBBEdge : public EdgeBase
51 {
52 public:
53  virtual ~FixedBBEdge() {}
54 
56  InteractionGraphBase* owner,
57  int first_node_ind,
58  int second_node_ind)
59  :
60  EdgeBase( owner, first_node_ind, second_node_ind )
61  {}
62 
63  virtual
64  void set_sparse_aa_info(ObjexxFCL::FArray2_bool const & sparse_conn_info) = 0;
65 
66  virtual
67  bool get_sparse_aa_info( int node1aa, int node2aa) const = 0;
68 
69  virtual
70  void force_aa_neighbors(int node1aa, int node2aa) = 0;
71 
72  virtual
73  void force_all_aa_neighbors() = 0;
74 
75  virtual core::PackerEnergy get_two_body_energy( int const, int const ) const = 0;
76 
77 };
78 
80 {
81 public:
83  FixedBBInteractionGraph( int num_nodes )
84  :
85  InteractionGraphBase( num_nodes )
86  {}
87 
88  //virtual void set_num_aatypes( int ) = 0;
89  virtual int get_num_aatypes() const = 0;
90 
91  virtual
92  bool
94 
95  virtual
97  int node_ind,
98  int node_state
99  ) const;
100 
101  virtual
102  ObjexxFCL::FArray2D< core::PackerEnergy >
104  int node1,
105  int node2,
106  int node1aa,
107  int node2aa
108  ) const;
109 
110  /// @brief interface to PDEdge::set_sparse_aa_info
112  (
113  int node1,
114  int node2,
115  ObjexxFCL::FArray2_bool const & sparse_conn_info
116  );
117 
118  /// @brief returns true if node1aa and node2aa are amino acid neighbors
120  (
121  int node1,
122  int node2,
123  int node1aa,
124  int node2aa
125  );
126 
127  /// @brief interface to FixedBBEdge::force_aa_neighbors
129  (
130  int node1,
131  int node2,
132  int node1aa,
133  int node2aa
134  );
135 
136  /// @brief interface to PDEdge::force_aa_neighbors
138  (
139  int node1,
140  int node2
141  );
142 
143 
144  /// @brief interface to FixedBBEdge::get_two_body_energy
145  /// - returns the state pair energy
147  (
148  int node1,
149  int node2,
150  int state_node1,
151  int state_node2
152  ) const;
153 
154 protected:
155  /// Downcasts
156 
157  inline FixedBBNode const * get_fixedbb_node( int node_index ) const;
158  inline FixedBBNode * get_fixedbb_node( int node_index );
159  inline FixedBBEdge const * get_fixedbb_edge( int node1, int node2 ) const;
160  inline FixedBBEdge * get_fixedbb_edge( int node1, int node2 );
161 
162 };
163 
164 inline
166 {
167  return static_cast< FixedBBNode const * > (get_node( node_index ));
168 }
169 
170 inline
172 {
173  return static_cast< FixedBBNode * > (get_node( node_index ));
174 }
175 
176 inline
177 FixedBBEdge const * FixedBBInteractionGraph::get_fixedbb_edge( int node1, int node2 ) const
178 {
179  return static_cast< FixedBBEdge const * > (find_edge( node1, node2 ));
180 }
181 
182 inline
184 {
185  return static_cast< FixedBBEdge * > (find_edge( node1, node2 ));
186 }
187 
188 } //end namespace interaction_graph
189 } //end namespace pack
190 } //end namespace core
191 
192 #endif