29 #include <basic/MetricValue.hh>
30 #include <basic/Tracer.hh>
31 #include <utility/exit.hh>
32 #include <utility/string_util.hh>
36 #include <utility/vector1.hh>
40 using namespace core::pose;
41 using namespace core::pose::metrics;
42 using namespace utility;
47 namespace simple_calculators {
51 InterfaceDeltaEnergeticsCalculator::InterfaceDeltaEnergeticsCalculator(
std::string const & NameOfInterfaceNeighborDefinitionCalculator ) :
53 name_of_InterfaceNeighborDefinitionCalculator_(NameOfInterfaceNeighborDefinitionCalculator)
56 basic::Error() <<
"Tried to tie InterfaceDeltaEnergeticsCalculator to InterfaceNeighborDefinitionCalculator " <<
65 name_of_InterfaceNeighborDefinitionCalculator_(NameOfInterfaceNeighborDefinitionCalculator)
69 basic::Error() <<
"Tried to tie InterfaceDeltaEnergeticsCalculator to InterfaceNeighborDefinitionCalculator " <<
82 basic::Error() <<
"InterfaceDeltaEnergeticsCalculator cannot create a new InterfaceNeighborDefinitionCalculator named " <<
98 basic::Error() <<
"InterfaceDeltaEnergeticsCalculator cannot create a new InterfaceNeighborDefinitionCalculator named " <<
110 if ( key ==
"weighted_total" ) {
111 basic::check_cast( valptr, &
weighted_total_,
"weighted_total expects to return a Real" );
112 (
static_cast<basic::MetricValue<Real> *
>(valptr))->set(
weighted_total_ );
117 basic::check_cast( valptr, &scoreval,
"Interface "+key+
" expects to return a Real" );
118 (
static_cast<basic::MetricValue<Real> *
>(valptr))->set( scoreval );
126 if ( key ==
"weighted_total" ) {
131 return utility::to_string( scoreval );
134 basic::Error() <<
"This Calculator cannot compute metric " << key << std::endl;
146 basic::MetricValue<Size> mv_size;
148 Size ch1_begin_num = mv_size.value();
150 Size ch1_end_num = mv_size.value();
152 Size ch2_begin_num = mv_size.value();
154 Size ch2_end_num = mv_size.value();
161 for (
Size i = ch1_begin_num; i <= ch1_end_num; ++i ) {
163 iru = energy_graph.get_node(i)->const_upper_edge_list_begin(),
165 iru != irue; ++iru ) {
168 if ( ( j >= ch2_begin_num ) && ( j <= ch2_end_num ) ) {
175 for (
Size i = ch2_begin_num; i <= ch2_end_num; ++i ) {
177 iru = energy_graph.get_node(i)->const_upper_edge_list_begin(),
179 iru != irue; ++iru ) {
182 if ( ( j >= ch1_begin_num ) && ( j <= ch1_end_num ) ) {
193 if( !lrec )
continue;
194 if( lrec->empty() )
continue;
196 for(
Size i = ch1_begin_num; i <= ch1_end_num; ++i ){
198 rni = lrec->const_upper_neighbor_iterator_begin( i );
199 *rni != *( lrec->const_upper_neighbor_iterator_end( i ) );
201 Size j = rni->upper_neighbor_id();
202 if( ( j >= ch2_begin_num ) && ( j <= ch2_end_num ) ) {
204 rni->retrieve_energy( emap );
210 for(
Size i = ch2_begin_num; i <= ch2_end_num; ++i ){
212 rni = lrec->const_upper_neighbor_iterator_begin( i );
213 *rni != *( lrec->const_upper_neighbor_iterator_end( i ) );
215 Size j = rni->upper_neighbor_id();
216 if( ( j >= ch1_begin_num ) && ( j <= ch1_end_num ) ) {
218 rni->retrieve_energy( emap );