IMP  2.1.0
The Integrative Modeling Platform
Weight.h
Go to the documentation of this file.
1 /**
2  * \file isd/Weight.h
3  * \brief Add weights for a set of states to a particle.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPISD_WEIGHT_H
10 #define IMPISD_WEIGHT_H
11 
12 #include "isd_config.h"
13 
14 #include <IMP/kernel/Particle.h>
15 #include <IMP/decorator_macros.h>
16 #include <IMP/kernel/Model.h>
17 #include <IMP/Decorator.h>
18 #include <IMP/base/exception.h>
19 #include <sstream>
20 
21 IMPISD_BEGIN_NAMESPACE
22 
23 //! Add weights for a set of states to a particle.
24 class IMPISDEXPORT Weight: public Decorator
25 {
26 
27  static const int nstates_max = 20;
28  static void do_setup_particle(kernel::Model *m,
30 public:
31 
34 
35 //! Get number of states key
36  static IntKey get_nstates_key();
37 
38 //! Get i-th weight key
39  static FloatKey get_weight_key(int i);
40 
41 //! Set all the weights
42  void set_weights(algebra::VectorKD w);
43 
44 //! Add one weight
45  void add_weight();
46 
47 //! Get the i-th weight
48  Float get_weight(int i);
49 
50 //! Get all the weights
51  algebra::VectorKD get_weights();
52 
53 //! Set weights are optimized
54  void set_weights_are_optimized(bool tf);
55 
56 //! Get number of states
57  Int get_number_of_states();
58 
59  static bool get_is_setup(kernel::Model *m,
61  return m->get_has_attribute(get_nstates_key(), pi);
62  }
63 
64 };
65 
67 
68 IMPISD_END_NAMESPACE
69 
70 #endif /* IMPISD_WEIGHT_H */
Import IMP/kernel/Decorator.h in the namespace.
A base class for Keys.
Definition: kernel/Key.h:46
Add weights for a set of states to a particle.
Definition: Weight.h:24
#define IMP_DECORATOR_METHODS(Name, Parent)
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
A Cartesian vector in D-dimensions.
Definition: VectorD.h:48
static bool get_is_setup(Particle *p)
Return true if the particle can be cast to the decorator.
#define IMP_DECORATOR_SETUP_0(Name)
Import IMP/kernel/decorator_macros.h in the namespace.
Storage of a model, its restraints, constraints and particles.
Classes to handle individual model particles.
Exception definitions and assertions.
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20
int Int
Basic integer value.
Definition: base/types.h:35
Class for storing model, its restraints, constraints, and particles.