IMP  2.0.0
The Integrative Modeling Platform
embedding_macros.h
Go to the documentation of this file.
1 /**
2  * \file IMP/statistics/embedding_macros.h \brief Various important macros
3  * for implementing decorators.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPSTATISTICS_EMBEDDING_MACROS_H
10 #define IMPSTATISTICS_EMBEDDING_MACROS_H
11 
12 #include "Embedding.h"
13 #include <IMP/base/object_macros.h>
14 
15 
16 //! Define things needed for a Embedding
17 /** In addition to what is done by IMP_OBJECT() it declares
18  - IMP::statistics::Embedding::get_point()
19  - IMP::statistics::Embedding::get_number_of_items()
20  and defines
21  - IMP::statistics::Embedding::get_points()
22 */
23 #define IMP_EMBEDDING(Name) \
24  algebra::VectorKD get_point(unsigned int i) const; \
25  algebra::VectorKDs get_points() const { \
26  algebra::VectorKDs ret(get_number_of_items()); \
27  for (unsigned int i=0; i< ret.size(); ++i) { \
28  ret[i]= Name::get_point(i); \
29  } \
30  return ret; \
31  } \
32  unsigned int get_number_of_items() const; \
33  IMP_OBJECT(Name)
34 
35 
36 #endif /* IMPSTATISTICS_EMBEDDING_MACROS_H */