blob: 380cd445045df643925a2a4478d50cf738b9369f [file] [log] [blame]
Austin Schuh189376f2018-12-20 22:11:15 +11001template <class ArgType>
2class Circulant : public Eigen::MatrixBase<Circulant<ArgType> >
3{
4public:
5 Circulant(const ArgType& arg)
6 : m_arg(arg)
7 {
8 EIGEN_STATIC_ASSERT(ArgType::ColsAtCompileTime == 1,
9 YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
10 }
11
12 typedef typename Eigen::internal::ref_selector<Circulant>::type Nested;
13
14 typedef Eigen::Index Index;
15 Index rows() const { return m_arg.rows(); }
16 Index cols() const { return m_arg.rows(); }
17
18 typedef typename Eigen::internal::ref_selector<ArgType>::type ArgTypeNested;
19 ArgTypeNested m_arg;
20};