23 #include <basic/datacache/BasicDataCache.hh>
26 #include <utility/vector1.hh>
38 using namespace core::pose::datacache;
39 using namespace basic::datacache;
43 namespace monte_carlo {
46 SubToFullInfo::SubToFullInfo() {}
49 SubToFullInfo::SubToFullInfo( std::map< Size, Size > sub_to_full,
54 sub_to_full_( sub_to_full ),
55 moving_res_list_( moving_res_list ),
56 full_sequence_( full_sequence ),
57 cutpoints_in_full_pose_( cutpoints_in_full_pose )
65 sub_to_full_( src.sub_to_full_ ),
66 moving_res_list_( src.moving_res_list_ ),
67 full_sequence_( src.full_sequence_ ),
68 cutpoints_in_full_pose_( src.cutpoints_in_full_pose_ )
100 return *sub_to_full_info;
107 Size const & res_to_delete ){
111 for (
Size i = 1; i <= moving_res_list.size(); i++ ){
112 Size const n = moving_res_list[ i ];
113 if ( n < res_to_delete ) moving_res_list_new.push_back( n );
114 else if (n > res_to_delete ) moving_res_list_new.push_back( n-1 );
117 return moving_res_list_new;
124 Size const & res_to_delete ){
126 std::map< Size, Size > sub_to_full_new;
128 for ( std::map< Size, Size >::const_iterator it = sub_to_full.begin(); it != sub_to_full.end(); ++it ) {
129 Size const n = it->first;
130 Size const m = it->second;
131 if ( n < res_to_delete ) sub_to_full_new[ n ] = m;
132 else if ( n > res_to_delete ) sub_to_full_new[ n-1 ] = m;
135 return sub_to_full_new;
142 Size const & res_to_add ){
146 for (
Size i = 1; i <= moving_res_list.size(); i++ ){
147 Size const n = moving_res_list[ i ];
148 if ( n < res_to_add ) moving_res_list_new.push_back( n );
150 moving_res_list_new.push_back( res_to_add );
151 for (
Size i = 1; i <= moving_res_list.size(); i++ ){
152 Size const n = moving_res_list[ i ];
153 if ( n >= res_to_add ) moving_res_list_new.push_back( n+1 );
156 return moving_res_list_new;
164 Size const & res_to_add ){
166 std::map< Size, Size > sub_to_full_new;
168 for ( std::map< Size, Size >::const_iterator it = sub_to_full.begin(); it != sub_to_full.end(); ++it ) {
169 Size const n = it->first;
170 Size const m = it->second;
171 if ( n < res_to_add ) sub_to_full_new[ n ] = m;
172 if ( n >= res_to_add ) sub_to_full_new[ n+1 ] = m;
174 sub_to_full_new[ res_to_add ] = sub_to_full[ res_to_add ]-1;
176 return sub_to_full_new;
182 Size const & res_to_add ){
184 std::map< Size, Size > sub_to_full_new;
186 for ( std::map< Size, Size >::const_iterator it = sub_to_full.begin(); it != sub_to_full.end(); ++it ) {
187 Size const n = it->first;
188 Size const m = it->second;
189 if ( n < res_to_add ) sub_to_full_new[ n ] = m;
190 if ( n >= res_to_add ) sub_to_full_new[ n+1 ] = m;
192 sub_to_full_new[ res_to_add ] = sub_to_full[ res_to_add-1 ]+1;
194 return sub_to_full_new;
203 using namespace protocols::swa::monte_carlo;
206 std::map< Size, Size > sub_to_full_new =
reorder_after_delete( sub_to_full_info.sub_to_full(), res_to_delete );
209 sub_to_full_info.set_sub_to_full( sub_to_full_new );
210 sub_to_full_info.set_moving_res_list( moving_res_list_new );
217 using namespace protocols::swa::monte_carlo;
220 std::map< Size, Size > sub_to_full_new =
reorder_after_append( sub_to_full_info.sub_to_full(), res_to_add );
223 sub_to_full_info.set_sub_to_full( sub_to_full_new );
224 sub_to_full_info.set_moving_res_list( moving_res_list_new );
231 using namespace protocols::swa::monte_carlo;
234 std::map< Size, Size > sub_to_full_new =
reorder_after_prepend( sub_to_full_info.sub_to_full(), res_to_add );
237 sub_to_full_info.set_sub_to_full( sub_to_full_new );
238 sub_to_full_info.set_moving_res_list( moving_res_list_new );