本文整理汇总了C++中ModelObjectsTemp::size方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelObjectsTemp::size方法的具体用法?C++ ModelObjectsTemp::size怎么用?C++ ModelObjectsTemp::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelObjectsTemp
的用法示例。
在下文中一共展示了ModelObjectsTemp::size方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_all_possible_indexes
ParticleIndexes DummyPairContainer::get_all_possible_indexes() const {
ParticleIndexes ret = c_->get_all_possible_indexes();
ModelObjectsTemp mos =
cpf_->get_inputs(get_model(), c_->get_indexes());
for (unsigned int i = 0; i < mos.size(); ++i) {
ModelObject *o = mos[i];
Particle *p = dynamic_cast<Particle *>(o);
if (p) ret.push_back(p->get_index());
}
return ret;
}
示例2: validate_outputs
void ModelObject::validate_outputs() const {
if (!get_has_dependencies()) return;
IMP_IF_CHECK(USAGE_AND_INTERNAL) {
IMP_CHECK_OBJECT(this);
ModelObjectsTemp ret = do_get_outputs();
std::sort(ret.begin(), ret.end());
ret.erase(std::unique(ret.begin(), ret.end()), ret.end());
ModelObjectsTemp saved = get_model()->get_dependency_graph_outputs(this);
std::sort(saved.begin(), saved.end());
ModelObjectsTemp intersection;
std::set_intersection(saved.begin(), saved.end(), ret.begin(), ret.end(),
std::back_inserter(intersection));
IMP_USAGE_CHECK(
intersection.size() == ret.size(),
"Dependencies changed without invalidating dependencies."
<< " Make sure you call set_has_dependencies(false) any "
<< "time the list of dependencies changed. Object is " << get_name()
<< " of type " << get_type_name());
}
}
示例3: get_movable_particles
ParticleIndexes MonteCarlo::get_movable_particles() const {
ParticleIndexes movable;
for (unsigned int i = 0; i < get_number_of_movers(); ++i) {
ModelObjectsTemp t = get_mover(i)->get_outputs();
for (unsigned int j = 0; j < t.size(); ++j) {
ModelObject *mo = t[j];
if (dynamic_cast<Particle *>(mo)) {
movable.push_back(dynamic_cast<Particle *>(mo)->get_index());
}
}
}
return movable;
}
示例4: get_output_containers
ContainersTemp get_output_containers(const ModelObjectsTemp &mo) {
ContainersTemp ret;
for (unsigned int i = 0; i < mo.size(); ++i) {
ModelObject *o = mo[i];
Container *p = dynamic_cast<Container *>(o);
if (p)
ret.push_back(p);
else {
ret += get_output_containers(o->get_inputs());
}
}
return ret;
}
示例5: get_output_particles
ParticlesTemp get_output_particles(const ModelObjectsTemp &mo) {
ParticlesTemp ret;
for (unsigned int i = 0; i < mo.size(); ++i) {
ModelObject *o = mo[i];
Particle *p = dynamic_cast<Particle *>(o);
if (p)
ret.push_back(p);
else {
ret += get_output_particles(o->get_inputs());
}
}
return ret;
}
示例6: get_required_score_states
ScoreStatesTemp get_required_score_states(const ModelObjectsTemp &mos,
ScoreStatesTemp exclude) {
if (mos.empty()) return ScoreStatesTemp();
ScoreStatesTemp ret;
for (unsigned int i = 0; i < mos.size(); ++i) {
mos[0]->get_model()->do_set_has_required_score_states(mos[i], true);
ret += mos[i]->get_required_score_states();
}
std::sort(ret.begin(), ret.end());
std::sort(exclude.begin(), exclude.end());
ScoreStatesTemp diff;
std::set_difference(ret.begin(), ret.end(), exclude.begin(), exclude.end(),
std::back_inserter(diff));
return get_update_order(diff);
}
示例7: do_step
void HybridMonteCarlo::do_step()
{
//gibbs sampler on x and v
//persistence=p samples p times x and once v
//However because it's constant E, a rejected move
//will result in recalculating the same move up to p times
//until it is either accepted or the velocities are redrawn
//since p has to be independent of the outcome (markov property)
//we avoid recalculating the trajectory on rejection by just trying
//it over and over without doing the md again.
persistence_counter_ += 1;
if (persistence_counter_ == persistence_)
{
persistence_counter_ = 0;
//boltzmann constant in kcal/mol
static const double kB = 8.31441 / 4186.6;
md_->assign_velocities(get_kt() / kB);
}
ParticleIndexes all_optimized_particles;
{
ModelObjectsTemp op = get_model()->get_optimized_particles();
for (unsigned int i = 0; i< op.size(); ++i) {
all_optimized_particles.push_back(dynamic_cast<Particle*>(op[i].get())
->get_index());
}
}
double last = do_evaluate(all_optimized_particles);
core::MonteCarloMoverResult moved = do_move();
double energy = do_evaluate(all_optimized_particles);
bool accepted = do_accept_or_reject_move(energy, last,
moved.get_proposal_ratio());
while ((!accepted) && (persistence_counter_ < persistence_-1))
{
persistence_counter_ += 1;
accepted = do_accept_or_reject_move(energy, last,
moved.get_proposal_ratio());
}
/*std::cout << "hmc"
<< " old " << last
<< " new " << energy
<< " delta " << energy-last
<< " accepted " << accepted
<<std::endl;*/
}