29 #include <numeric/conversions.hh>
30 #include <numeric/random/random.hh>
31 #include <numeric/trig.functions.hh>
32 #include <numeric/xyz.functions.hh>
33 #include <numeric/xyzMatrix.hh>
35 #include <basic/Tracer.hh>
37 #include <utility/vector1.hh>
44 static basic::Tracer
TR(
"protocols.geometry.RB_geometry");
45 static numeric::random::RandomGenerator
RG(62451);
47 using namespace ObjexxFCL;
62 numeric::xyzMatrix_double
67 const double phi( phi_range *
RG.uniform() );
68 const double psi( psi_range *
RG.uniform() );
70 numeric::conversions::degrees( std::acos(numeric::sin_cos_range( 1.0 - 2.0 *
RG.uniform() ) ) )
73 TR <<
"random_reorientation_matrix phi: " <<
phi <<
" psi: " <<
psi <<
" theta: " << theta << std::endl;
75 numeric::z_rotation_matrix_degrees(
psi ) *
76 numeric::y_rotation_matrix_degrees( theta ) *
77 numeric::z_rotation_matrix_degrees(
phi );
93 centroids_by_jump( pose, jump_id, upstream_ctrd, downstream_ctrd, ok_for_centroid_calculation );
113 int upstream_atoms = 0, downstream_atoms = 0;
115 for(
int ii = 1, ii_end = pose.
total_residue(); ii <= ii_end; ++ii) {
116 int & natoms = ( is_upstream(ii) ? upstream_atoms : downstream_atoms );
117 core::Vector & ctrd = ( is_upstream(ii) ? upstream_ctrd : downstream_ctrd );
120 if ( ok_for_centroid_calculation.size() > 0 && !ok_for_centroid_calculation[ ii ] ) {
125 for(
int jj = 1, jj_end = rsd.
natoms(); jj <= jj_end; ++jj) {
132 upstream_ctrd /= upstream_atoms;
133 downstream_ctrd /= downstream_atoms;
142 std::pair<core::Vector, core::Vector > centroids;
174 TR.Debug <<
"fold-tree: " << pose.
fold_tree() << std::endl;
175 TR.Debug <<
"partition by jump " << jump_id << std::endl;
180 core::Size upstream_atoms = 0, downstream_atoms = 0;
185 Size int_res_num = 0;
186 Real int_distance = 8.0;
189 for(
Size ll = 1; ll <= 5; ll++){
190 if (int_res_num == 0){
200 int_distance = int_distance+2;
205 Size & natoms = ( is_upstream(ii) ? upstream_atoms : downstream_atoms );
206 core::Vector & ctrd = ( is_upstream(ii) ? upstream_ctrd : downstream_ctrd );
208 for (
Size jj = 1, jj_end = rsd.
natoms(); jj <= jj_end; ++jj ) {
216 if ( upstream_atoms == 0 || downstream_atoms == 0 ){
217 TR.Warning <<
"centroids_by_jump_int called but no interface detected!!" << std::endl;
218 TR.Warning <<
"calling centroids_by_jump..." << std::endl;
221 upstream_ctrd /= upstream_atoms;
222 downstream_ctrd /= downstream_atoms;
248 for (
int i=start; i<=
stop; ++i ) {
257 center /= (stop-start+1);
306 Real min_dist = 9999.9;
308 for (
int i=begin; i<=
end; ++i )
319 Real tmp_dist( ca_pos.length_squared() );
320 if ( tmp_dist < min_dist ) {