IMP  2.1.1
The Integrative Modeling Platform
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 //! \deprecated_at{2.1} Declare the methods directly.
15 #define IMP_UNARY_FUNCTION(Name) \
16  IMPKERNEL_DEPRECATED_MACRO(2.1, "Declare the methods directly."); \
17  IMP_IMPLEMENT( \
18  virtual DerivativePair evaluate_with_derivative(double feature) const); \
19  IMP_IMPLEMENT(virtual double evaluate(double feature) const); \
20  IMP_OBJECT_NO_WARNING(Name)
21 
22 //! \deprecated_at{2.1} Declare the methods directly.
23 #define IMP_UNARY_FUNCTION_INLINE(Name, value_expression, \
24  derivative_expression, show_expression) \
25  IMPKERNEL_DEPRECATED_MACRO(2.1, "Declare the methods directly."); \
26  IMP_IMPLEMENT_INLINE( \
27  virtual DerivativePair evaluate_with_derivative(double feature) const, { \
28  return DerivativePair((value_expression), (derivative_expression)); \
29  }); \
30  IMP_IMPLEMENT_INLINE(virtual double evaluate(double feature) const, \
31  { return (value_expression); }); \
32  IMP_OBJECT_METHODS(Name)
33 
34 #endif /* IMPKERNEL_UNARY_FUNCTION_MACROS_H */
Single variable function.