Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PcsInputCenter.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  //////////////////////////////////////////////
11  /// @begin
12  ///
13  /// @file protocols/scoring/methods/pcs2/PcsInputCenter.cc
14  ///
15  /// @brief
16  ///
17  /// @detailed
18  ///
19  /// @param
20  ///
21  /// @return
22  ///
23  /// @remarks
24  ///
25  /// @references
26  ///
27  /// @authorsv Christophe Schmitz
28  ///
29  /// @last_modified February 2010
30  ////////////////////////////////////////////////
31 
32 
33 // Unit headers
36 
37 // Package headers
38 
39 // Project headers
40 #include <basic/Tracer.hh>
41 
42 // Utility headers
43 #include <utility/exit.hh>
44 
45 // Numeric headers
46 
47 // Objexx headers
48 
49 // C++ headers
50 // AUTO-REMOVED #include <iostream>
51 
52 #include <utility/vector1.hh>
53 
54 
55 namespace protocols{
56 namespace scoring{
57 namespace methods{
58 namespace pcs2{
59 
60 basic::Tracer TR_PcsInputCenter("protocols.scoring.methods.pcs.PcsInputCenter");
61 
63  utility_exit_with_message( "You shouldn't call the empty constructor for PcsInputCenter class" );
64 }
65 
67 }
68 
70 ReferenceCount()
71 {
72  // TR_PcsInputCenter << " () called" << std::endl;
74 }
75 
78  // TR_PcsInputCenter << " = called" << std::endl;
79  if ( this != &other ) {
81  }
82  return *this;
83 }
84 
85 std::map< std::string, PcsInputFile > &
87  return PcsInputFile_all_;
88 }
89 
91  // TR_PcsInputCenter << " constructor called" << std::endl;
92  core::Real weight_sum;
93  core::Size i;
94 
95  weight_sum = 0;
96  for (i = 1; i <= filenames.size(); i++){
97  weight_sum += weight[i];
98  }
99 
100  for (i = 1; i <= filenames.size(); i++){
101  //core::Real my_weight(weight[i]/weight_sum);
102  //TODO correct the weighting scheme. For the moment it is one automatically
103  core::Real my_weight(weight[i]);
104  PcsInputFile pcs_i_f_temp(filenames[i], my_weight);
105  PcsInputFile_all_.insert ( std::pair< std::string, PcsInputFile >(filenames[i], pcs_i_f_temp) );
106  }
107 }
108 
109 std::ostream &
110  operator<<(std::ostream & out, const PcsInputCenter &me ){
111 
112  std::map< std::string, PcsInputFile >::iterator it;
113  std::map< std::string, PcsInputFile > mymap;
114  mymap = me.PcsInputFile_all_;
115 
116  for ( it = mymap.begin(); it != mymap.end(); ++it ) {
117  out << "For the file '" << it->first << std::endl;
118  out << it->second;
119  out << "The relative weight is " << (it->second).get_weight() << std::endl;
120  }
121  return out;
122 }
123 
124 }//namespace pcs2
125 }//namespace methods
126 }//namespace scoring
127 }//namespace protocols