Block.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. // This file is part of Eigen, a lightweight C++ template library
  2. // for linear algebra.
  3. //
  4. // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
  5. // Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
  6. //
  7. // This Source Code Form is subject to the terms of the Mozilla
  8. // Public License v. 2.0. If a copy of the MPL was not distributed
  9. // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
  10. #ifndef EIGEN_BLOCK_H
  11. #define EIGEN_BLOCK_H
  12. namespace Eigen {
  13. namespace internal {
  14. template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
  15. struct traits<Block<XprType, BlockRows, BlockCols, InnerPanel> > : traits<XprType>
  16. {
  17. typedef typename traits<XprType>::Scalar Scalar;
  18. typedef typename traits<XprType>::StorageKind StorageKind;
  19. typedef typename traits<XprType>::XprKind XprKind;
  20. typedef typename ref_selector<XprType>::type XprTypeNested;
  21. typedef typename remove_reference<XprTypeNested>::type _XprTypeNested;
  22. enum{
  23. MatrixRows = traits<XprType>::RowsAtCompileTime,
  24. MatrixCols = traits<XprType>::ColsAtCompileTime,
  25. RowsAtCompileTime = MatrixRows == 0 ? 0 : BlockRows,
  26. ColsAtCompileTime = MatrixCols == 0 ? 0 : BlockCols,
  27. MaxRowsAtCompileTime = BlockRows==0 ? 0
  28. : RowsAtCompileTime != Dynamic ? int(RowsAtCompileTime)
  29. : int(traits<XprType>::MaxRowsAtCompileTime),
  30. MaxColsAtCompileTime = BlockCols==0 ? 0
  31. : ColsAtCompileTime != Dynamic ? int(ColsAtCompileTime)
  32. : int(traits<XprType>::MaxColsAtCompileTime),
  33. XprTypeIsRowMajor = (int(traits<XprType>::Flags)&RowMajorBit) != 0,
  34. IsRowMajor = (MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1
  35. : (MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0
  36. : XprTypeIsRowMajor,
  37. HasSameStorageOrderAsXprType = (IsRowMajor == XprTypeIsRowMajor),
  38. InnerSize = IsRowMajor ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
  39. InnerStrideAtCompileTime = HasSameStorageOrderAsXprType
  40. ? int(inner_stride_at_compile_time<XprType>::ret)
  41. : int(outer_stride_at_compile_time<XprType>::ret),
  42. OuterStrideAtCompileTime = HasSameStorageOrderAsXprType
  43. ? int(outer_stride_at_compile_time<XprType>::ret)
  44. : int(inner_stride_at_compile_time<XprType>::ret),
  45. // FIXME, this traits is rather specialized for dense object and it needs to be cleaned further
  46. FlagsLvalueBit = is_lvalue<XprType>::value ? LvalueBit : 0,
  47. FlagsRowMajorBit = IsRowMajor ? RowMajorBit : 0,
  48. Flags = (traits<XprType>::Flags & (DirectAccessBit | (InnerPanel?CompressedAccessBit:0))) | FlagsLvalueBit | FlagsRowMajorBit,
  49. // FIXME DirectAccessBit should not be handled by expressions
  50. //
  51. // Alignment is needed by MapBase's assertions
  52. // We can sefely set it to false here. Internal alignment errors will be detected by an eigen_internal_assert in the respective evaluator
  53. Alignment = 0
  54. };
  55. };
  56. template<typename XprType, int BlockRows=Dynamic, int BlockCols=Dynamic, bool InnerPanel = false,
  57. bool HasDirectAccess = internal::has_direct_access<XprType>::ret> class BlockImpl_dense;
  58. } // end namespace internal
  59. template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel, typename StorageKind> class BlockImpl;
  60. /** \class Block
  61. * \ingroup Core_Module
  62. *
  63. * \brief Expression of a fixed-size or dynamic-size block
  64. *
  65. * \tparam XprType the type of the expression in which we are taking a block
  66. * \tparam BlockRows the number of rows of the block we are taking at compile time (optional)
  67. * \tparam BlockCols the number of columns of the block we are taking at compile time (optional)
  68. * \tparam InnerPanel is true, if the block maps to a set of rows of a row major matrix or
  69. * to set of columns of a column major matrix (optional). The parameter allows to determine
  70. * at compile time whether aligned access is possible on the block expression.
  71. *
  72. * This class represents an expression of either a fixed-size or dynamic-size block. It is the return
  73. * type of DenseBase::block(Index,Index,Index,Index) and DenseBase::block<int,int>(Index,Index) and
  74. * most of the time this is the only way it is used.
  75. *
  76. * However, if you want to directly maniputate block expressions,
  77. * for instance if you want to write a function returning such an expression, you
  78. * will need to use this class.
  79. *
  80. * Here is an example illustrating the dynamic case:
  81. * \include class_Block.cpp
  82. * Output: \verbinclude class_Block.out
  83. *
  84. * \note Even though this expression has dynamic size, in the case where \a XprType
  85. * has fixed size, this expression inherits a fixed maximal size which means that evaluating
  86. * it does not cause a dynamic memory allocation.
  87. *
  88. * Here is an example illustrating the fixed-size case:
  89. * \include class_FixedBlock.cpp
  90. * Output: \verbinclude class_FixedBlock.out
  91. *
  92. * \sa DenseBase::block(Index,Index,Index,Index), DenseBase::block(Index,Index), class VectorBlock
  93. */
  94. template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel> class Block
  95. : public BlockImpl<XprType, BlockRows, BlockCols, InnerPanel, typename internal::traits<XprType>::StorageKind>
  96. {
  97. typedef BlockImpl<XprType, BlockRows, BlockCols, InnerPanel, typename internal::traits<XprType>::StorageKind> Impl;
  98. public:
  99. //typedef typename Impl::Base Base;
  100. typedef Impl Base;
  101. EIGEN_GENERIC_PUBLIC_INTERFACE(Block)
  102. EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block)
  103. typedef typename internal::remove_all<XprType>::type NestedExpression;
  104. /** Column or Row constructor
  105. */
  106. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  107. Block(XprType& xpr, Index i) : Impl(xpr,i)
  108. {
  109. eigen_assert( (i>=0) && (
  110. ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && i<xpr.rows())
  111. ||((BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) && i<xpr.cols())));
  112. }
  113. /** Fixed-size constructor
  114. */
  115. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  116. Block(XprType& xpr, Index startRow, Index startCol)
  117. : Impl(xpr, startRow, startCol)
  118. {
  119. EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic,THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE)
  120. eigen_assert(startRow >= 0 && BlockRows >= 0 && startRow + BlockRows <= xpr.rows()
  121. && startCol >= 0 && BlockCols >= 0 && startCol + BlockCols <= xpr.cols());
  122. }
  123. /** Dynamic-size constructor
  124. */
  125. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  126. Block(XprType& xpr,
  127. Index startRow, Index startCol,
  128. Index blockRows, Index blockCols)
  129. : Impl(xpr, startRow, startCol, blockRows, blockCols)
  130. {
  131. eigen_assert((RowsAtCompileTime==Dynamic || RowsAtCompileTime==blockRows)
  132. && (ColsAtCompileTime==Dynamic || ColsAtCompileTime==blockCols));
  133. eigen_assert(startRow >= 0 && blockRows >= 0 && startRow <= xpr.rows() - blockRows
  134. && startCol >= 0 && blockCols >= 0 && startCol <= xpr.cols() - blockCols);
  135. }
  136. };
  137. // The generic default implementation for dense block simplu forward to the internal::BlockImpl_dense
  138. // that must be specialized for direct and non-direct access...
  139. template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
  140. class BlockImpl<XprType, BlockRows, BlockCols, InnerPanel, Dense>
  141. : public internal::BlockImpl_dense<XprType, BlockRows, BlockCols, InnerPanel>
  142. {
  143. typedef internal::BlockImpl_dense<XprType, BlockRows, BlockCols, InnerPanel> Impl;
  144. typedef typename XprType::StorageIndex StorageIndex;
  145. public:
  146. typedef Impl Base;
  147. EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl)
  148. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index i) : Impl(xpr,i) {}
  149. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index startRow, Index startCol) : Impl(xpr, startRow, startCol) {}
  150. EIGEN_DEVICE_FUNC
  151. EIGEN_STRONG_INLINE BlockImpl(XprType& xpr, Index startRow, Index startCol, Index blockRows, Index blockCols)
  152. : Impl(xpr, startRow, startCol, blockRows, blockCols) {}
  153. };
  154. namespace internal {
  155. /** \internal Internal implementation of dense Blocks in the general case. */
  156. template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel, bool HasDirectAccess> class BlockImpl_dense
  157. : public internal::dense_xpr_base<Block<XprType, BlockRows, BlockCols, InnerPanel> >::type
  158. {
  159. typedef Block<XprType, BlockRows, BlockCols, InnerPanel> BlockType;
  160. typedef typename internal::ref_selector<XprType>::non_const_type XprTypeNested;
  161. public:
  162. typedef typename internal::dense_xpr_base<BlockType>::type Base;
  163. EIGEN_DENSE_PUBLIC_INTERFACE(BlockType)
  164. EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl_dense)
  165. // class InnerIterator; // FIXME apparently never used
  166. /** Column or Row constructor
  167. */
  168. EIGEN_DEVICE_FUNC
  169. inline BlockImpl_dense(XprType& xpr, Index i)
  170. : m_xpr(xpr),
  171. // It is a row if and only if BlockRows==1 and BlockCols==XprType::ColsAtCompileTime,
  172. // and it is a column if and only if BlockRows==XprType::RowsAtCompileTime and BlockCols==1,
  173. // all other cases are invalid.
  174. // The case a 1x1 matrix seems ambiguous, but the result is the same anyway.
  175. m_startRow( (BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? i : 0),
  176. m_startCol( (BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? i : 0),
  177. m_blockRows(BlockRows==1 ? 1 : xpr.rows()),
  178. m_blockCols(BlockCols==1 ? 1 : xpr.cols())
  179. {}
  180. /** Fixed-size constructor
  181. */
  182. EIGEN_DEVICE_FUNC
  183. inline BlockImpl_dense(XprType& xpr, Index startRow, Index startCol)
  184. : m_xpr(xpr), m_startRow(startRow), m_startCol(startCol),
  185. m_blockRows(BlockRows), m_blockCols(BlockCols)
  186. {}
  187. /** Dynamic-size constructor
  188. */
  189. EIGEN_DEVICE_FUNC
  190. inline BlockImpl_dense(XprType& xpr,
  191. Index startRow, Index startCol,
  192. Index blockRows, Index blockCols)
  193. : m_xpr(xpr), m_startRow(startRow), m_startCol(startCol),
  194. m_blockRows(blockRows), m_blockCols(blockCols)
  195. {}
  196. EIGEN_DEVICE_FUNC inline Index rows() const { return m_blockRows.value(); }
  197. EIGEN_DEVICE_FUNC inline Index cols() const { return m_blockCols.value(); }
  198. EIGEN_DEVICE_FUNC
  199. inline Scalar& coeffRef(Index rowId, Index colId)
  200. {
  201. EIGEN_STATIC_ASSERT_LVALUE(XprType)
  202. return m_xpr.coeffRef(rowId + m_startRow.value(), colId + m_startCol.value());
  203. }
  204. EIGEN_DEVICE_FUNC
  205. inline const Scalar& coeffRef(Index rowId, Index colId) const
  206. {
  207. return m_xpr.derived().coeffRef(rowId + m_startRow.value(), colId + m_startCol.value());
  208. }
  209. EIGEN_DEVICE_FUNC
  210. EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index rowId, Index colId) const
  211. {
  212. return m_xpr.coeff(rowId + m_startRow.value(), colId + m_startCol.value());
  213. }
  214. EIGEN_DEVICE_FUNC
  215. inline Scalar& coeffRef(Index index)
  216. {
  217. EIGEN_STATIC_ASSERT_LVALUE(XprType)
  218. return m_xpr.coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
  219. m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
  220. }
  221. EIGEN_DEVICE_FUNC
  222. inline const Scalar& coeffRef(Index index) const
  223. {
  224. return m_xpr.coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
  225. m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
  226. }
  227. EIGEN_DEVICE_FUNC
  228. inline const CoeffReturnType coeff(Index index) const
  229. {
  230. return m_xpr.coeff(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
  231. m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
  232. }
  233. template<int LoadMode>
  234. inline PacketScalar packet(Index rowId, Index colId) const
  235. {
  236. return m_xpr.template packet<Unaligned>(rowId + m_startRow.value(), colId + m_startCol.value());
  237. }
  238. template<int LoadMode>
  239. inline void writePacket(Index rowId, Index colId, const PacketScalar& val)
  240. {
  241. m_xpr.template writePacket<Unaligned>(rowId + m_startRow.value(), colId + m_startCol.value(), val);
  242. }
  243. template<int LoadMode>
  244. inline PacketScalar packet(Index index) const
  245. {
  246. return m_xpr.template packet<Unaligned>
  247. (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
  248. m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
  249. }
  250. template<int LoadMode>
  251. inline void writePacket(Index index, const PacketScalar& val)
  252. {
  253. m_xpr.template writePacket<Unaligned>
  254. (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
  255. m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0), val);
  256. }
  257. #ifdef EIGEN_PARSED_BY_DOXYGEN
  258. /** \sa MapBase::data() */
  259. EIGEN_DEVICE_FUNC inline const Scalar* data() const;
  260. EIGEN_DEVICE_FUNC inline Index innerStride() const;
  261. EIGEN_DEVICE_FUNC inline Index outerStride() const;
  262. #endif
  263. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  264. const typename internal::remove_all<XprTypeNested>::type& nestedExpression() const
  265. {
  266. return m_xpr;
  267. }
  268. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  269. XprType& nestedExpression() { return m_xpr; }
  270. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
  271. StorageIndex startRow() const EIGEN_NOEXCEPT
  272. {
  273. return m_startRow.value();
  274. }
  275. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
  276. StorageIndex startCol() const EIGEN_NOEXCEPT
  277. {
  278. return m_startCol.value();
  279. }
  280. protected:
  281. XprTypeNested m_xpr;
  282. const internal::variable_if_dynamic<StorageIndex, (XprType::RowsAtCompileTime == 1 && BlockRows==1) ? 0 : Dynamic> m_startRow;
  283. const internal::variable_if_dynamic<StorageIndex, (XprType::ColsAtCompileTime == 1 && BlockCols==1) ? 0 : Dynamic> m_startCol;
  284. const internal::variable_if_dynamic<StorageIndex, RowsAtCompileTime> m_blockRows;
  285. const internal::variable_if_dynamic<StorageIndex, ColsAtCompileTime> m_blockCols;
  286. };
  287. /** \internal Internal implementation of dense Blocks in the direct access case.*/
  288. template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
  289. class BlockImpl_dense<XprType,BlockRows,BlockCols, InnerPanel,true>
  290. : public MapBase<Block<XprType, BlockRows, BlockCols, InnerPanel> >
  291. {
  292. typedef Block<XprType, BlockRows, BlockCols, InnerPanel> BlockType;
  293. typedef typename internal::ref_selector<XprType>::non_const_type XprTypeNested;
  294. enum {
  295. XprTypeIsRowMajor = (int(traits<XprType>::Flags)&RowMajorBit) != 0
  296. };
  297. public:
  298. typedef MapBase<BlockType> Base;
  299. EIGEN_DENSE_PUBLIC_INTERFACE(BlockType)
  300. EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl_dense)
  301. /** Column or Row constructor
  302. */
  303. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  304. BlockImpl_dense(XprType& xpr, Index i)
  305. : Base(xpr.data() + i * ( ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && (!XprTypeIsRowMajor))
  306. || ((BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) && ( XprTypeIsRowMajor)) ? xpr.innerStride() : xpr.outerStride()),
  307. BlockRows==1 ? 1 : xpr.rows(),
  308. BlockCols==1 ? 1 : xpr.cols()),
  309. m_xpr(xpr),
  310. m_startRow( (BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? i : 0),
  311. m_startCol( (BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? i : 0)
  312. {
  313. init();
  314. }
  315. /** Fixed-size constructor
  316. */
  317. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  318. BlockImpl_dense(XprType& xpr, Index startRow, Index startCol)
  319. : Base(xpr.data()+xpr.innerStride()*(XprTypeIsRowMajor?startCol:startRow) + xpr.outerStride()*(XprTypeIsRowMajor?startRow:startCol)),
  320. m_xpr(xpr), m_startRow(startRow), m_startCol(startCol)
  321. {
  322. init();
  323. }
  324. /** Dynamic-size constructor
  325. */
  326. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  327. BlockImpl_dense(XprType& xpr,
  328. Index startRow, Index startCol,
  329. Index blockRows, Index blockCols)
  330. : Base(xpr.data()+xpr.innerStride()*(XprTypeIsRowMajor?startCol:startRow) + xpr.outerStride()*(XprTypeIsRowMajor?startRow:startCol), blockRows, blockCols),
  331. m_xpr(xpr), m_startRow(startRow), m_startCol(startCol)
  332. {
  333. init();
  334. }
  335. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  336. const typename internal::remove_all<XprTypeNested>::type& nestedExpression() const EIGEN_NOEXCEPT
  337. {
  338. return m_xpr;
  339. }
  340. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  341. XprType& nestedExpression() { return m_xpr; }
  342. /** \sa MapBase::innerStride() */
  343. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
  344. Index innerStride() const EIGEN_NOEXCEPT
  345. {
  346. return internal::traits<BlockType>::HasSameStorageOrderAsXprType
  347. ? m_xpr.innerStride()
  348. : m_xpr.outerStride();
  349. }
  350. /** \sa MapBase::outerStride() */
  351. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
  352. Index outerStride() const EIGEN_NOEXCEPT
  353. {
  354. return internal::traits<BlockType>::HasSameStorageOrderAsXprType
  355. ? m_xpr.outerStride()
  356. : m_xpr.innerStride();
  357. }
  358. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
  359. StorageIndex startRow() const EIGEN_NOEXCEPT { return m_startRow.value(); }
  360. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
  361. StorageIndex startCol() const EIGEN_NOEXCEPT { return m_startCol.value(); }
  362. #ifndef __SUNPRO_CC
  363. // FIXME sunstudio is not friendly with the above friend...
  364. // META-FIXME there is no 'friend' keyword around here. Is this obsolete?
  365. protected:
  366. #endif
  367. #ifndef EIGEN_PARSED_BY_DOXYGEN
  368. /** \internal used by allowAligned() */
  369. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  370. BlockImpl_dense(XprType& xpr, const Scalar* data, Index blockRows, Index blockCols)
  371. : Base(data, blockRows, blockCols), m_xpr(xpr)
  372. {
  373. init();
  374. }
  375. #endif
  376. protected:
  377. EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
  378. void init()
  379. {
  380. m_outerStride = internal::traits<BlockType>::HasSameStorageOrderAsXprType
  381. ? m_xpr.outerStride()
  382. : m_xpr.innerStride();
  383. }
  384. XprTypeNested m_xpr;
  385. const internal::variable_if_dynamic<StorageIndex, (XprType::RowsAtCompileTime == 1 && BlockRows==1) ? 0 : Dynamic> m_startRow;
  386. const internal::variable_if_dynamic<StorageIndex, (XprType::ColsAtCompileTime == 1 && BlockCols==1) ? 0 : Dynamic> m_startCol;
  387. Index m_outerStride;
  388. };
  389. } // end namespace internal
  390. } // end namespace Eigen
  391. #endif // EIGEN_BLOCK_H