10#define IMPISD_WEIGHT_H
12#include <IMP/isd/isd_config.h>
21static const int IMPISD_MAX_WEIGHTS = 1000;
29class IMPISDEXPORT Weight :
public Decorator {
144#if !defined(IMP_DOXYGEN) && !defined(SWIG)
150 WeightSimplexConstraint(
Particle *p)
151 :
IMP::
Constraint(p->get_model(),
"WeightSimplexConstraint%1%")
152 , pi_(p->get_index()) {}
156 virtual void do_update_attributes()
override;
The base class for decorators.
Storage of a model, its restraints, constraints and particles.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Simple unit simplex class.
Implement a constraint on the Model.
Class for adding derivatives from restraints to the model.
Class for storing model, its restraints, constraints, and particles.
Class to handle individual particles of a Model object.
Add weights to a particle.
void set_weights_lazy(const algebra::VectorKD &w)
Set all the weights.
void set_number_of_weights_lazy(Int nweights)
Set number of weights lazily.
void add_to_weight_derivative(int i, Float dwi, const DerivativeAccumulator &da)
Add to derivative wrt ith weight.
Float get_weight_derivative(int i) const
Get derivative wrt ith weight.
Float get_weight(int i) const
Get the ith weight.
void set_weights(const algebra::VectorKD &w)
Set all weights, enforcing the simplex constraint.
algebra::UnitSimplexKD get_unit_simplex() const
Get unit simplex on which weight vector lies.
void set_weights_are_optimized(bool tf)
Set weights are optimized.
FloatKeys get_weight_keys() const
Get all weight keys.
static IntKey get_number_of_weights_key()
Get number of weights key.
void set_number_of_weights(Int nweights)
Set number of weights.
bool get_weights_are_optimized() const
Get weights are optimized.
Int get_number_of_weights() const
Get number of weights.
void set_weight_lazy(int i, Float wi)
Set the ith weight lazily.
void add_weight_lazy(Float wi=0)
Extend the weight vector by one element lazily.
algebra::VectorKD get_weights() const
Get all weights.
void add_weight(Float wi=0)
Extend the weight vector by one element.
void add_to_weights_derivatives(const algebra::VectorKD &dw, const DerivativeAccumulator &da)
Add to derivatives wrt all weights.
algebra::VectorKD get_weights_derivatives() const
Get derivatives wrt all weights.
static FloatKey get_weight_key(int i)
Get ith weight key.
Helper macros for implementing Decorators.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
#define IMP_DECORATOR_SETUP_0(Name)
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
#define IMP_DECORATOR_METHODS(Name, Parent)
Base functionality and abstract base classes for representation, scoring and sampling.
Index< ParticleIndexTag > ParticleIndex
double Float
Basic floating-point value (could be float, double...).
int Int
Basic integer value.
Key< 0 > FloatKey
The type used to identify float attributes in the Particles.
Key< 4 > ObjectKey
The type used to identify an Object attribute.
Key< 1 > IntKey
The type used to identify int attributes in the Particles.
IMP::Vector< FloatKey > FloatKeys
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.