IMP
2.0.1
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
core/HarmonicLowerBound.h
Go to the documentation of this file.
1
/**
2
* \file IMP/core/HarmonicLowerBound.h \brief Harmonic lower bound function.
3
*
4
* Copyright 2007-2013 IMP Inventors. All rights reserved.
5
*/
6
7
#ifndef IMPCORE_HARMONIC_LOWER_BOUND_H
8
#define IMPCORE_HARMONIC_LOWER_BOUND_H
9
10
#include <IMP/core/core_config.h>
11
#include "
Harmonic.h
"
12
13
IMPCORE_BEGIN_NAMESPACE
14
15
//! Lower bound harmonic function (non-zero when feature < mean)
16
/** \see Harmonic
17
\see HarmonicUpperBound
18
\see TruncatedHarmonicLowerBound
19
*/
20
class
HarmonicLowerBound
:
public
Harmonic
21
{
22
public
:
23
/** Create with the given mean and the spring constant k */
24
HarmonicLowerBound
(
Float
mean,
Float
k) :
Harmonic
(mean, k) {}
25
IMP_UNARY_FUNCTION_INLINE
(
HarmonicLowerBound
,
26
feature >=
Harmonic::get_mean
() ?
27
0.0: Harmonic::evaluate(feature),
28
feature >=
Harmonic::get_mean
() ?
29
0.0:
30
Harmonic::evaluate_with_derivative(feature).second,
31
"HarmonicLB: "
<<
Harmonic::get_mean
()
32
<<
" and "
<< Harmonic::get_k() << std::endl);
33
};
34
35
IMPCORE_END_NAMESPACE
36
37
#endif
/* IMPCORE_HARMONIC_LOWER_BOUND_H */