8#ifndef IMPISD_SWITCHING_H
9#define IMPISD_SWITCHING_H
11#include <IMP/isd/isd_config.h>
23class IMPISDEXPORT Switching :
public Nuisance {
25 double switching = 0.5) {
26 if (!Nuisance::get_is_setup(m, pi))
28 Nuisance(m, pi).set_lower(0.);
29 Nuisance(m, pi).set_upper(1.);
38 return Nuisance::get_is_setup(m, pi) && Nuisance(m, pi).get_lower() >= 0 &&
39 Nuisance(m, pi).get_upper() <= 1;
42 Float get_switching()
const {
43 return Nuisance(get_particle()).get_nuisance();
46 void set_switching(
Float d) { set_nuisance(d); }
48 void add_to_switching_derivative(Float d, DerivativeAccumulator &accum) {
49 add_to_nuisance_derivative(d, accum);
52 Float get_switching_derivative()
const {
return get_nuisance_derivative(); }
54 static FloatKey get_switching_key() {
return get_nuisance_key(); }
56 bool get_switching_is_optimized()
const {
57 return get_nuisance_is_optimized();
60 void set_switching_is_optimized(
bool val) { set_nuisance_is_optimized(val); }
The base class for decorators.
A decorator for nuisance parameters particles.
A container for Singletons.
Class for storing model, its restraints, constraints, and particles.
Add nuisance parameter to particle.
static Nuisance setup_particle(Model *m, ParticleIndex pi)
#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)
Index< ParticleIndexTag > ParticleIndex
double Float
Basic floating-point value (could be float, double...).
Key< 0 > FloatKey
The type used to identify float attributes in the Particles.