Пример #1
0
void LogWrapper::show_it(std::ostream &out) const {
  IMP_CHECK_OBJECT(this);
  for (RestraintConstIterator it = restraints_begin(); it != restraints_end();
       ++it) {
    (*it)->show(out);
  }
  out << "... end LogWrapper " << get_name() << std::endl;
}
Пример #2
0
void Model::clear_all_statistics() {
  for (ScoreStateConstIterator it= score_states_begin();
       it != score_states_end(); ++it) {
    stats_data_.erase(*it);
  }
  RestraintsTemp r= IMP::kernel::get_restraints(restraints_begin(),
                                                restraints_end());
  for (RestraintsTemp::const_iterator it= r.begin();
       it != r.end(); ++it) {
    stats_data_.erase(*it);
  }
}
Пример #3
0
void Model::show_restraint_time_statistics(std::ostream &out) const {
  out << "Restraints: running_time [min_value max_value] "
      << "average_value last_value\n";
  RestraintsTemp r= IMP::kernel::get_restraints(restraints_begin(),
                                                restraints_end());
  for (RestraintsTemp::const_iterator it= r.begin();
       it != r.end(); ++it) {
    if (stats_data_.find(*it) != stats_data_.end()) {
      out << "  " << (*it)->get_name() << ": ";
      out << stats_data_[*it].total_time_/ stats_data_[*it].calls_
          << "s\n";
    } else {
      out << "  " << (*it)->get_name() << ":\n";
    }
  }
}
Пример #4
0
double MinimumRestraint::unprotected_evaluate(DerivativeAccumulator *da) const {
  algebra::internal::MinimalSet<double, Restraint *> ms(k_);
  for (RestraintConstIterator it = restraints_begin(); it != restraints_end();
       ++it) {
    ms.insert((*it)->unprotected_evaluate(nullptr), *it);
  }
  if (!da) {
    double sum = 0;
    for (unsigned int i = 0; i < ms.size(); ++i) {
      sum += ms[i].first;
    }
    return sum;
  } else {
    double sum = 0;
    for (unsigned int i = 0; i < ms.size(); ++i) {
      sum += ms[i].second->unprotected_evaluate(da);
    }
    return sum;
  }
}
Пример #5
0
void Model::show_restraint_score_statistics(std::ostream &out) const {
  boost::format format("%1%: [%15t%2% %30t%3%] %45t%4% %60t%5% %70t%6%\n");
  out << format
    % "Restraints" % "min_value" % "max_value" % "average_value"
    %"limit" % "last_value";
  RestraintsTemp r= IMP::kernel::get_restraints(restraints_begin(),
                                                restraints_end());
  for (RestraintsTemp::const_iterator it= r.begin();
       it != r.end(); ++it) {
    if (stats_data_.find(*it) != stats_data_.end()) {
      out << format % (std::string("  ")+ (*it)->get_name())
        % stats_data_[*it].min_value_
        % stats_data_[*it].max_value_
        % (stats_data_[*it].total_value_/ stats_data_[*it].calls_)
        % (*it)->get_maximum_score()
        % stats_data_[*it].last_value_;
    } else {
      out << "  " << (*it)->get_name() << ":\n";
    }
  }
}
Пример #6
0
ModelObjectsTemp LogWrapper::do_get_inputs() const {
  return ModelObjectsTemp(restraints_begin(), restraints_end());
}