9 #ifndef IMPKERNEL_DERIVATIVE_ACCUMULATOR_H
10 #define IMPKERNEL_DERIVATIVE_ACCUMULATOR_H
12 #include <IMP/kernel_config.h>
20 IMPKERNEL_BEGIN_NAMESPACE
33 : weight_(copy.weight_ * weight) {}
40 return value * weight_;
47 return Vector3D(
operator()(std::get<0>(value)),
48 operator()(std::get<1>(value)),
49 operator()(std::get<2>(value)));
56 return Vector4D(
operator()(std::get<0>(value)),
57 operator()(std::get<1>(value)),
58 operator()(std::get<2>(value)),
59 operator()(std::get<3>(value)));
62 double get_weight()
const {
return weight_; }
71 IMPKERNEL_END_NAMESPACE
Helper functions to check for NaN or infinity.
Vector3D operator()(const Vector3D &value) const
Scale a Vector3D value appropriately.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
Vector4D operator()(const Vector4D &value) const
Scale a Vector4D value appropriately.
double operator()(const double value) const
Scale a float value appropriately.
Exception definitions and assertions.
A more IMP-like version of the std::vector.
DerivativeAccumulator(const DerivativeAccumulator ©, double weight)
The weight is multiplied by the new weight.
#define IMP_INTERNAL_CHECK(expr, message)
An assertion to check for internal errors in IMP. An IMP::ErrorException will be thrown.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
bool isnan(const T &a)
Return true if a number is NaN.
Helper macros for throwing and handling exceptions.
DerivativeAccumulator(double weight=1.0)
the weight is one by default
Macros to help in implementing Value objects.
Macros to help with objects that can be printed to a stream.
Class for adding derivatives from restraints to the model.