25 #include <basic/Tracer.hh>
26 #include <numeric/random/random.hh>
27 #include <utility/exit.hh>
28 #include <utility/vector1.hh>
31 #include <ObjexxFCL/FArray1D.hh>
32 #include <ObjexxFCL/string.functions.hh>
40 static basic::Tracer
tr(
"protocols.loops.Loop");
41 static numeric::random::RandomGenerator
RG(429);
72 Size const n_cut_s ( loop_size - 1 );
73 ObjexxFCL::FArray1D_float cut_weight( n_cut_s );
75 for (
Size i = 1; i <= n_cut_s; ++i ) {
77 core::Real const weight ( std::max( i, n_cut_s-i + 1 ) );
78 total_cut_weight += weight;
79 cut_weight(i) = total_cut_weight;
89 core::Real const weight ( numeric::random::uniform()*total_cut_weight );
90 for (
Size i = 1; i <= n_cut_s; ++i ) {
91 if ( weight <= cut_weight(i) ) {
99 if( nfail < 20 )
if( ( ss ==
'H' || ss ==
'E' ) )
continue;
102 if( nfail >= 40 )
tr.Error <<
"Cutpoint choice problem, setting cut_ = " <<
cut_ << std::endl;
107 tr.Warning <<
"Cutpoint choice problem, setting cut_ = " <<
cut_ << std::endl;
110 }
else if(
start_ == 1 ) {
112 }
else if (
stop_ == nres ){
115 utility_exit_with_message(
116 "Somthing is wrong with the input loop: Pose has " +
117 ObjexxFCL::string_of( nres ) +
118 " residues, but loop definition runs from " +
119 ObjexxFCL::string_of(
start_ ) +
" to " +
120 ObjexxFCL::string_of(
stop_ )
124 tr.Info <<
"Autoset cut_ for loop " <<
start_ <<
" " <<
stop_
125 <<
" as " <<
cut_ <<
"." << std::endl;
130 selection.push_back( i );
141 if (
start() == 1 )
return true;