Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FrameList.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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file core/fragments/FragData.cc
12 /// @brief a collection classes of the FragData and SingleResidueFragData class hirachy
13 /// @author Oliver Lange (olange@u.washington.edu)
14 /// @date Wed Oct 20 12:08:31 2007
15 ///
16 
17 // Unit Headers
19 
20 // Package Headers
21 // AUTO-REMOVED #include <core/fragment/FragData.hh>
22 #include <core/fragment/Frame.hh>
23 
24 // Project Headers
25 // AUTO-REMOVED #include <core/pose/Pose.hh>
26 // AUTO-REMOVED #include <core/conformation/ResidueFactory.hh>
27 
28 // ObjexxFCL Headers
29 
30 // Utility headers
31 #include <utility/vector1.fwd.hh>
32 #include <basic/Tracer.hh>
33 
34 #include <core/fragment/FragID.hh>
35 #include <utility/exit.hh>
36 #include <utility/vector1.hh>
37 
38 
39 namespace core {
40 namespace fragment {
41 
42 static basic::Tracer tr("core.fragment");
43 
45  Size frags( 0 );
46  iterator it = begin(), eit=end();
47  for ( ; it!=eit && frags<flat_nr ; ++it) {
48  frags += (*it)->nr_frags();
49  }
50  if ( it!=eit ) {
51  if ( frags >= flat_nr ) {
52  frags -= (*it)->nr_frags();
53  it--;
54  }
55  return FragID( *it, flat_nr-frags );
56  }
57  runtime_assert( 0 ); //out of bounds
58  return FragID();
59 }
60 
62  Size frags( 0 );
63  for (const_iterator it=begin(), eit=end(); it!=eit ; ++it) {
64  frags += (*it)->nr_frags();
65  }
66  return frags;
67 }
68 
69 std::ostream& operator<< ( std::ostream& out, FrameList const& frags) {
70  for ( FrameList::const_iterator it=frags.begin(), eit=frags.end(); it!=eit; ++it ) {
71  (*it)->show( out );
72  }
73  return out;
74 }
75 
76 } //fragment
77 } //core