9 #ifndef IMPISD_WEIGHT_H
10 #define IMPISD_WEIGHT_H
12 #include <IMP/isd/isd_config.h>
19 IMPISD_BEGIN_NAMESPACE
21 static const int IMPISD_MAX_WEIGHTS = 1000;
57 IMPISD_DEPRECATED_METHOD_DECL(2.12)
58 static
IntKey get_nstates_key();
61 static
IntKey get_number_of_weights_key();
64 static
FloatKey get_weight_key(
int i);
70 Float get_weight(
int i) const;
73 algebra::
VectorKD get_weights() const;
77 void set_weight_lazy(
int i,
Float wi);
81 void set_weights_lazy(const algebra::
VectorKD& w);
85 void set_weights(const algebra::
VectorKD& w);
88 bool get_weights_are_optimized() const;
91 void set_weights_are_optimized(
bool tf);
94 Float get_weight_derivative(
int i) const;
97 algebra::
VectorKD get_weights_derivatives() const;
100 void add_to_weight_derivative(
int i,
Float dwi,
104 void add_to_weights_derivatives(const algebra::
VectorKD& dw,
113 void add_weight_lazy(
Float wi = 0);
119 void add_weight(
Float wi = 0);
122 Int get_number_of_weights() const;
125 algebra::UnitSimplexKD get_unit_simplex() const;
133 void set_number_of_weights_lazy(
Int nweights);
139 void set_number_of_weights(
Int nweights);
147 #if !defined(IMP_DOXYGEN) && !defined(SWIG)
153 WeightSimplexConstraint(
Particle *p)
154 : IMP::
Constraint(p->get_model(),
"WeightSimplexConstraint%1%")
159 virtual void do_update_attributes()
override;
The base class for decorators.
Add weights to a particle.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Storage of a model, its restraints, constraints and particles.
Simple unit simplex class.
Implement a constraint on the Model.
Class for storing model, its restraints, constraints, and particles.
Ints get_index(const ParticlesTemp &particles, const Subset &subset, const Subsets &excluded)
Helper macros for implementing Decorators.
#define IMP_DECORATOR_SETUP_0(Name)
Interface to specialized Particle types (e.g. atoms)
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
virtual ModelObjectsTemp do_get_outputs() const =0
#define IMP_DECORATOR_METHODS(Name, Parent)
double Float
Basic floating-point value (could be float, double...)
Class to handle individual particles of a Model object.
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
int Int
Basic integer value.
virtual ModelObjectsTemp do_get_inputs() const =0
Class for adding derivatives from restraints to the model.