IMP  2.0.1
The Integrative Modeling Platform
kernel/ScoringFunction.h
Go to the documentation of this file.
1 /**
2  * \file IMP/kernel/ScoringFunction.h
3  * \brief Storage of a model, its restraints,
4  * constraints and particles.
5  *
6  * Copyright 2007-2013 IMP Inventors. All rights reserved.
7  *
8  */
9 
10 #ifndef IMPKERNEL_SCORING_FUNCTION_H
11 #define IMPKERNEL_SCORING_FUNCTION_H
12 
13 #include <IMP/kernel/kernel_config.h>
15 #include "declare_Model.h"
16 #include <boost/tuple/tuple.hpp>
17 
18 
19 IMPKERNEL_BEGIN_NAMESPACE
20 
21 #ifndef IMP_DOXYGEN
22 inline void ScoringFunction::ensure_dependencies() {
23  // work around NullScoringFunction which has no model
24  if (get_model() && !get_model()->get_has_dependencies()) {
25  get_model()->compute_dependencies();
26  }
27  IMP_INTERNAL_CHECK(!get_model() || get_model()->get_has_dependencies(),
28  "Dependencies are still bad...");
29 }
30 inline const ScoreStatesTemp& ScoringFunction::get_score_states() {
31  ensure_dependencies();
32  return ss_;
33 }
34 #endif
35 
36 IMPKERNEL_END_NAMESPACE
37 
38 #endif /* IMPKERNEL_SCORING_FUNCTION_H */