IMP logo
IMP Reference Guide  develop.4eee3cf66f,2026/08/01
The Integrative Modeling Platform
FloatIndex.h
Go to the documentation of this file.
1 /**
2  * \file IMP/FloatIndex.h
3  * \brief A FloatIndex identifies an optimized attribute in a model.
4  *
5  * Copyright 2007-2026 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPKERNEL_FLOAT_INDEX_H
10 #define IMPKERNEL_FLOAT_INDEX_H
11 
12 #include <IMP/kernel_config.h>
13 #include "base_types.h"
14 #include "particle_index.h"
15 #include <IMP/tuple_macros.h>
16 
17 IMPKERNEL_BEGIN_NAMESPACE
18 
19 class Model;
20 
21 //! A FloatIndex identifies an optimized attribute in a model.
22 /** This can be a single Float attribute, or a single element in an
23  optimized Vector3D or Vector4D, depending on the constructor used.
24  */
25 class IMPKERNELEXPORT FloatIndex : public Value {
26  FloatKey fk_;
27  Vector3DDerivKey v3k_;
28  Vector4DDerivKey v4k_;
29  int dim_;
30  int index_;
31  ParticleIndex pi_;
32 public:
34  : fk_(k), dim_(0), pi_(pi) {}
35 
37  : v3k_(k), dim_(3), index_(index), pi_(pi) {}
38 
40  : v4k_(k), dim_(4), index_(index), pi_(pi) {}
41 
42  FloatKey get_float_key() const { return fk_; }
43 
44  void set_value(Model *m, Float v) const;
45 
46  Float get_value(Model *m) const;
47 
48  Float get_derivative(Model *m) const;
49 
50  IMP_SHOWABLE_INLINE(FloatIndex, out << "(" << pi_ << ")");
51 };
52 
54 
55 IMPKERNEL_END_NAMESPACE
56 
57 #endif /* IMPKERNEL_FLOAT_INDEX_H */
Basic types used by IMP.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
Functions and adaptors for dealing with particle indexes.
Macros to help in defining tuple classes.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
Base class for a simple primitive-like type.
Definition: Value.h:23
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
A FloatIndex identifies an optimized attribute in a model.
Definition: FloatIndex.h:25
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:19