IMP
2.0.0
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
kernel/unary_function_macros.h
Go to the documentation of this file.
1
/**
2
* \file IMP/kernel/unary_function_macros.h
3
* \brief Various general useful macros for IMP.
4
*
5
* Copyright 2007-2013 IMP Inventors. All rights reserved.
6
*
7
*/
8
9
#ifndef IMPKERNEL_UNARY_FUNCTION_MACROS_H
10
#define IMPKERNEL_UNARY_FUNCTION_MACROS_H
11
#include <IMP/kernel/kernel_config.h>
12
#include "
UnaryFunction.h
"
13
14
15
16
//! Do not use
17
#define IMP_UNARY_FUNCTION(Name) \
18
IMP_IMPLEMENT(virtual DerivativePair \
19
evaluate_with_derivative(double feature) const); \
20
IMP_IMPLEMENT(virtual double evaluate(double feature) const); \
21
IMP_OBJECT(Name)
22
23
24
25
//! Do not use.
26
#define IMP_UNARY_FUNCTION_INLINE(Name, value_expression, \
27
derivative_expression, show_expression) \
28
IMP_IMPLEMENT_INLINE(virtual DerivativePair \
29
evaluate_with_derivative(double feature) const, { \
30
return DerivativePair((value_expression), (derivative_expression)); \
31
}); \
32
IMP_IMPLEMENT_INLINE(virtual double evaluate(double feature) const,{ \
33
return (value_expression); \
34
}); \
35
IMP_OBJECT_METHODS(Name)
36
37
38
39
#endif
/* IMPKERNEL_UNARY_FUNCTION_MACROS_H */