-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathfunctor.h
28 lines (22 loc) · 801 Bytes
/
functor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef FUNCTOR_H
#define FUNCTOR_H
#include <Eigen/Core>
// Generic functor
template<typename _Scalar, int NX=Eigen::Dynamic, int NY=Eigen::Dynamic>
struct Functor
{
typedef _Scalar Scalar;
enum {
InputsAtCompileTime = NX,
ValuesAtCompileTime = NY
};
typedef Eigen::Matrix<Scalar,InputsAtCompileTime,1> InputType;
typedef Eigen::Matrix<Scalar,ValuesAtCompileTime,1> ValueType;
typedef Eigen::Matrix<Scalar,ValuesAtCompileTime,InputsAtCompileTime> JacobianType;
const int mInputs, mValues;
Functor() : mInputs(InputsAtCompileTime), mValues(ValuesAtCompileTime) {}
Functor(int inputs, int values) : mInputs(inputs), mValues(values) {}
int inputs() const { return mInputs; }
int values() const { return mValues; }
};
#endif // FUNCTOR_H