18 #include <utility/in_place_list.hh>
23 #include <utility/vector0.hh>
24 #include <utility/vector1.hh>
29 namespace interaction_graph {
61 curr_state_one_body_energy_( 0.0f ),
62 curr_state_total_energy_( 0.0f ),
63 alternate_state_( 0 ),
64 alternate_state_one_body_energy_( 0 ),
65 alternate_state_total_energy_( 0 ),
66 alternate_state_is_being_considered_( false ),
67 procrastinated_( false )
90 std::cout <<
"curr_state_sparse_mat_info_ ";
94 std::cout <<
"Curr Two Body Energies:";
98 std::cout << std::endl;
102 std::cout <<
"Alt Two Body Energies:";
106 std::cout << std::endl <<
"-----------------" << std::endl;
232 if (new_state == 0) {
281 if (new_state == 0 ) {
329 get_energy_following_partial_state_assignment();
373 std::copy( alt_position1,
429 int edge_making_energy_request
434 edge_making_energy_request,
464 int edge_to_altered_neighbor,
465 int other_node_new_state,
473 other_node_new_state_sparse_info;
502 std::cout <<
"curr_state_sparse_mat_info_ ";
505 std::cout <<
"curr_state_one_body_energy_ ";
511 std::cout << std::endl;
624 sparse_aa_neighbors_(
625 get_dlazy_ig_owner()->get_num_aatypes(),
626 get_dlazy_ig_owner()->get_num_aatypes(),
629 get_dlazy_ig_owner()->get_num_aatypes(),
630 get_dlazy_ig_owner()->get_num_aatypes(),
631 ( ObjexxFCL::FArray2D< core::
PackerEnergy > * ) ( 0 ) ),
632 curr_state_energy_( 0.0f ),
633 partial_state_assignment_( false ),
634 ran_annealing_since_pair_energy_table_cleared_( false ),
654 FArray2_bool
const & aa_neighbors
688 int const node1state,
699 int const node1state,
700 int const node2state,
730 two_body_energies_( node2aa, node1aa ) =
new ObjexxFCL::FArray2D< core::PackerEnergy >(
801 total_memory +=
two_body_energies_.size() *
sizeof( ObjexxFCL::FArray2D< core::PackerEnergy > * );
805 total_memory +=
sizeof( ObjexxFCL::FArray2D< core::PackerEnergy > );
815 unsigned int total_memory( 0 );
830 unsigned int total_memory( 0 );
876 ObjexxFCL::FArray2D< core::PackerEnergy > & ii_jj_table( *
two_body_energies_(jj,ii) );
877 for (
Size kk = 0; kk < ii_jj_table.size(); ++kk ) {
879 ii_jj_table[ kk ] *= scale_factor;
947 int node_not_substituted = ! node_substituted;
949 int nodes_curr_states[2];
952 nodes_curr_states[ node_substituted ] = new_state;
953 nodes_curr_states_sparse_info[ node_substituted ] = new_state_sparse_info;
955 nodes_curr_states[ node_not_substituted ] =
957 nodes_curr_states_sparse_info[ node_not_substituted ] =
959 get_sparse_mat_info_for_curr_state();
968 new_state_sparse_info
999 int node_not_substituted = ! node_substituted;
1043 int node_not_substituted = ! node_substituted;
1050 new_state_sparse_info
1081 int nodes_curr_states[2];
1084 for (
int ii = 0; ii < 2; ++ii) {
1085 nodes_curr_states[ ii ] =
1087 nodes_curr_states_sparse_info[ ii ] =
1147 int nodes_states[ 2 ],
1151 bool one_node_in_zero_state = ( nodes_states[0] == 0 || nodes_states[1] == 0 );
1153 if ( one_node_in_zero_state ) {
1156 if ( !
sparse_aa_neighbors_( sparse_matrix_indices[1].get_aa_type(), sparse_matrix_indices[0].get_aa_type() ) ) {
1160 nodes_states[0], nodes_states[1],
1161 sparse_matrix_indices[0], sparse_matrix_indices[1] );
1166 ObjexxFCL::FArray2D< core::PackerEnergy >
1173 ObjexxFCL::FArray2D< core::PackerEnergy > empty;
1180 ObjexxFCL::FArray2D< core::PackerEnergy > submat( *
two_body_energies_( node2aa, node1aa ));
1184 for (
Size ii = 1; ii <= submat.size2(); ++ii ) {
1185 for (
Size jj = 1; jj <= submat.size1(); ++jj ) {
1187 int const ii_state = ii + iioffset;
1188 int const jj_state = jj + jjoffset;
1191 ii_state, jj_state );
1193 submat(jj,ii) = iijjenergy;
1247 std::pair< int, int >
1252 return std::make_pair( node1aa, node2aa );
1284 memory_max_for_rpes_( 0 ),
1285 curr_memory_for_rpes_( 0 )
1312 unsigned int edge_potential_usage( 0 );
1313 unsigned int edge_actual_usage( 0 );
1320 std::cout <<
"~DoubleLazyIG: used " << edge_actual_usage <<
" bytes instead of " << edge_potential_usage << std::endl;
1463 project_deltaE_for_substitution( new_state, prev_energy_for_node );
1593 std::cout <<
"State Assignment: " << std::endl;
1671 int first_node_ind = (*edge_iter)->get_first_node_ind();
1672 int second_node_ind = (*edge_iter)->get_second_node_ind();
1676 esum += ((
DoubleLazyEdge*) (*edge_iter))->get_current_two_body_energy();
1698 ObjexxFCL::FArray2D< core::PackerEnergy >
1742 return total_memory;
1752 int submatrix_index,
1762 assert( global_submatrix_index );
1765 --global_submatrix_index;
1770 int savings =
dlazy_edge_vector_[ edge_index ]->drop_aa_submatrix( local_submatrix_index );
1783 int global_submatrix_index = edge_index *
sqr_num_aa_types_ + submatrix_index + 1;
1870 get_one_body_energy_current_state();