fir-filter.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * François Bleibel,
4  * Olivier Stasse,
5  *
6  * CNRS/AIST
7  *
8  */
9 
10 #include <sot/core/factory.hh>
11 #include <sot/core/fir-filter.hh>
12 
16 
17 #define SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(sotClassType, sotSigType, \
18  sotCoefType, id, className) \
19  template <> \
20  std::string sotClassType<sotSigType, sotCoefType>::getTypeName(void) { \
21  return #sotSigType; \
22  } \
23  \
24  template <> \
25  const std::string sotClassType<sotSigType, sotCoefType>::CLASS_NAME = \
26  std::string(className) + "_" + #sotSigType + "_" + #sotCoefType; \
27  \
28  template <> \
29  const std::string &sotClassType<sotSigType, sotCoefType>::getClassName(void) \
30  const { \
31  return CLASS_NAME; \
32  } \
33  extern "C" { \
34  Entity *regFunction##_##id(const std::string &objname) { \
35  return new sotClassType<sotSigType, sotCoefType>(objname); \
36  } \
37  EntityRegisterer reg##_##id(std::string(className) + "_" + #sotSigType + \
38  "_" + #sotCoefType, \
39  &regFunction##_##id); \
40  }
41 
42 namespace dynamicgraph {
43 namespace sot {
46 
47 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(FIRFilter, double, double, double_double,
48  "FIRFilter")
50  "FIRFilter")
51 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(FIRFilter, Vector, Matrix, vec_mat,
52  "FIRFilter")
53 
54 template <>
55 void FIRFilter<Vector, double>::reset_signal(Vector &res,
56  const Vector &sample) {
57  res.resize(sample.size());
58  res.fill(0);
59 }
60 
61 template <>
63  const Vector &sample) {
64  res.resize(sample.size());
65  res.fill(0);
66 }
67 
68 } // namespace sot
69 } // namespace dynamicgraph
70 
72 
73 #ifdef WIN32
74 #define DEFINE_SPECIFICATION(sotClassType, sotSigType, sotCoefType) \
75  sotClassType##sotSigType##sotCoefType:: \
76  sotClassType##sotSigType##sotCoefType(const std::string &name) \
77  : sotClassType<sotSigType, sotCoefType>(name){};
78 
79 namespace dynamicgraph {
80 namespace sot {
81 typedef double Double;
83 DEFINE_SPECIFICATION(FIRFilter, Double, Double)
84 DEFINE_SPECIFICATION(FIRFilter, Vector, Double)
85 DEFINE_SPECIFICATION(FIRFilter, Vector, Matrix)
86 } // namespace sot
87 } // namespace dynamicgraph
88 #endif // WIN32
Eigen::VectorXd Vector
static void reset_signal(sigT &, const sigT &)
Definition: fir-filter.hh:193
SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(FIRFilter, double, double, double_double, "FIRFilter") SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN(FIRFilter
Eigen::MatrixXd Matrix


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Wed Jun 21 2023 02:51:26