Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IGEdgeReweightContainer.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 edge reweighting for Interaction Graphs
11 /// @brief
12 /// @author Florian Richter, floric@u.washington.edu, june 08
13 
14 // Unit headers
16 // Package headers
17 
18 #include <basic/Tracer.hh>
19 
20 // AUTO-REMOVED #include <utility/exit.hh>
21 #include <utility/string_util.hh>
22 
23 #include <utility/vector1.hh>
24 
25 
26 namespace core {
27 namespace pack {
28 namespace task {
29 
30 static basic::Tracer tr("core.pack.task.IGEdgeReweightContainer");
31 
33 
35 {
36  nres_ = nres;
37  edge_reweighters_.clear();
38 }
40 
41 
42 Real
44  pose::Pose const & pose,
45  PackerTask const & task,
46  core::Size res1id,
47  core::Size res2id
48 ) const {
49 
50  assert( res1id <= nres_ );
51  assert( res2id <= nres_ );
52 
53  Real reweight = 1.0;
54  bool firstpass = true;
55 
57  re_it != edge_reweighters_.end();
58  ++re_it
59  ){
60 
61  Real weight_this_upweighter = (*re_it)->get_edge_reweight( pose, task, res1id, res2id );
62 
63  if( firstpass ){
64  reweight = weight_this_upweighter;
65  if( reweight != 1.0 ) firstpass = false;
66  }
67 
68  else if ( (reweight != weight_this_upweighter) && (weight_this_upweighter != 1.0) ){
69 
70  reweight = ( reweight > weight_this_upweighter) ? reweight : weight_this_upweighter ;
71 
72  tr.Info << "WARNING WARNING!!! Conflicting IG-reweighting factors specified for residues "+utility::to_string( res1id )+" and "+utility::to_string( res2id )+"are given, will user the larger value ( "+utility::to_string( reweight )+" )." << std::endl;
73 
74  }
75  }
76 
77  return reweight;
78 }
79 
80 void
82 
83  edge_reweighters_.push_back( reweighter );
84 
85 }
86 
87 } //namespace task
88 } //namespace pack
89 } //namespace core