home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.6.2
The Integrative Modeling Platform
IMP Manual
Reference Guide
Modules
Classes
Examples
include
IMP
isd
Weight.h
Go to the documentation of this file.
1
/**
2
* \file IMP/isd/Weight.h
3
* \brief Add weights for a set of states to a particle.
4
*
5
* Copyright 2007-2016 IMP Inventors. All rights reserved.
6
*
7
*/
8
9
#ifndef IMPISD_WEIGHT_H
10
#define IMPISD_WEIGHT_H
11
12
#include "isd_config.h"
13
14
#include <
IMP/Particle.h
>
15
#include <
IMP/decorator_macros.h
>
16
#include <
IMP/Model.h
>
17
#include <
IMP/Decorator.h
>
18
#include <
IMP/exception.h
>
19
#include <sstream>
20
21
IMPISD_BEGIN_NAMESPACE
22
23
//! Add weights for a set of states to a particle.
24
class
IMPISDEXPORT
Weight
:
public
Decorator
{
25
26
static
const
int
nstates_max = 20;
27
static
void
do_setup_particle(
Model
*m,
ParticleIndex
pi);
28
29
public
:
30
IMP_DECORATOR_METHODS
(
Weight
,
Decorator
);
31
IMP_DECORATOR_SETUP_0
(
Weight
);
32
33
//! Get number of states key
34
static
IntKey
get_nstates_key();
35
36
//! Get i-th weight key
37
static
FloatKey
get_weight_key(
int
i);
38
39
//! Set all the weights
40
void
set_weights(
algebra::VectorKD
w);
41
42
//! Add one weight
43
void
add_weight();
44
45
//! Get the i-th weight
46
Float
get_weight(
int
i);
47
48
//! Get all the weights
49
algebra::VectorKD
get_weights();
50
51
//! Set weights are optimized
52
void
set_weights_are_optimized(
bool
tf);
53
54
//! Get number of states
55
Int
get_number_of_states();
56
57
static
bool
get_is_setup(
Model
*m,
ParticleIndex
pi) {
58
return
m->get_has_attribute(get_nstates_key(), pi);
59
}
60
};
61
62
IMP_VALUES
(
Weight
,
Weights
);
63
64
IMPISD_END_NAMESPACE
65
66
#endif
/* IMPISD_WEIGHT_H */
Decorator.h
The base class for decorators.
IMP::isd::Weight
Add weights for a set of states to a particle.
Definition:
Weight.h:24
Model.h
Storage of a model, its restraints, constraints and particles.
IMP::Index< ParticleIndexTag >
exception.h
Exception definitions and assertions.
IMP::Vector
Definition:
Vector.h:42
IMP::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
Model.h:72
IMP_VALUES
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition:
value_macros.h:23
decorator_macros.h
Various general useful macros for IMP.
IMP::Key< 1, true >
IMP_DECORATOR_SETUP_0
#define IMP_DECORATOR_SETUP_0(Name)
Definition:
decorator_macros.h:111
IMP::Decorator
Interface to specialized Particle types (e.g. atoms)
Definition:
Decorator.h:118
Particle.h
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
IMP_DECORATOR_METHODS
#define IMP_DECORATOR_METHODS(Name, Parent)
Definition:
decorator_macros.h:27
IMP::Float
double Float
Basic floating-point value (could be float, double...)
Definition:
types.h:20
IMP::Int
int Int
Basic integer value.
Definition:
types.h:35
IMP::algebra::VectorKD
VectorD<-1 > VectorKD
Definition:
VectorD.h:411