tomoto 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (369) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/README.md +8 -10
  4. data/ext/tomoto/ct.cpp +11 -11
  5. data/ext/tomoto/dmr.cpp +14 -13
  6. data/ext/tomoto/dt.cpp +14 -14
  7. data/ext/tomoto/extconf.rb +7 -5
  8. data/ext/tomoto/gdmr.cpp +7 -7
  9. data/ext/tomoto/hdp.cpp +9 -9
  10. data/ext/tomoto/hlda.cpp +13 -13
  11. data/ext/tomoto/hpa.cpp +5 -5
  12. data/ext/tomoto/lda.cpp +42 -39
  13. data/ext/tomoto/llda.cpp +6 -6
  14. data/ext/tomoto/mglda.cpp +15 -15
  15. data/ext/tomoto/pa.cpp +6 -6
  16. data/ext/tomoto/plda.cpp +6 -6
  17. data/ext/tomoto/slda.cpp +8 -8
  18. data/ext/tomoto/{ext.cpp → tomoto.cpp} +8 -8
  19. data/ext/tomoto/utils.h +16 -70
  20. data/lib/tomoto/version.rb +1 -1
  21. data/lib/tomoto.rb +5 -1
  22. data/vendor/EigenRand/EigenRand/Core.h +10 -10
  23. data/vendor/EigenRand/EigenRand/Dists/Basic.h +208 -9
  24. data/vendor/EigenRand/EigenRand/Dists/Discrete.h +52 -31
  25. data/vendor/EigenRand/EigenRand/Dists/GammaPoisson.h +9 -8
  26. data/vendor/EigenRand/EigenRand/Dists/NormalExp.h +28 -21
  27. data/vendor/EigenRand/EigenRand/EigenRand +11 -6
  28. data/vendor/EigenRand/EigenRand/Macro.h +13 -7
  29. data/vendor/EigenRand/EigenRand/MorePacketMath.h +348 -740
  30. data/vendor/EigenRand/EigenRand/MvDists/Multinomial.h +5 -3
  31. data/vendor/EigenRand/EigenRand/MvDists/MvNormal.h +9 -3
  32. data/vendor/EigenRand/EigenRand/PacketFilter.h +11 -253
  33. data/vendor/EigenRand/EigenRand/PacketRandomEngine.h +21 -47
  34. data/vendor/EigenRand/EigenRand/RandUtils.h +50 -344
  35. data/vendor/EigenRand/EigenRand/arch/AVX/MorePacketMath.h +619 -0
  36. data/vendor/EigenRand/EigenRand/arch/AVX/PacketFilter.h +149 -0
  37. data/vendor/EigenRand/EigenRand/arch/AVX/RandUtils.h +228 -0
  38. data/vendor/EigenRand/EigenRand/arch/NEON/MorePacketMath.h +473 -0
  39. data/vendor/EigenRand/EigenRand/arch/NEON/PacketFilter.h +142 -0
  40. data/vendor/EigenRand/EigenRand/arch/NEON/RandUtils.h +126 -0
  41. data/vendor/EigenRand/EigenRand/arch/SSE/MorePacketMath.h +501 -0
  42. data/vendor/EigenRand/EigenRand/arch/SSE/PacketFilter.h +133 -0
  43. data/vendor/EigenRand/EigenRand/arch/SSE/RandUtils.h +120 -0
  44. data/vendor/EigenRand/EigenRand/doc.h +24 -12
  45. data/vendor/EigenRand/README.md +57 -4
  46. data/vendor/eigen/COPYING.APACHE +203 -0
  47. data/vendor/eigen/COPYING.BSD +1 -1
  48. data/vendor/eigen/COPYING.MINPACK +51 -52
  49. data/vendor/eigen/Eigen/Cholesky +0 -1
  50. data/vendor/eigen/Eigen/Core +112 -265
  51. data/vendor/eigen/Eigen/Eigenvalues +2 -3
  52. data/vendor/eigen/Eigen/Geometry +5 -8
  53. data/vendor/eigen/Eigen/Householder +0 -1
  54. data/vendor/eigen/Eigen/Jacobi +0 -1
  55. data/vendor/eigen/Eigen/KLUSupport +41 -0
  56. data/vendor/eigen/Eigen/LU +2 -5
  57. data/vendor/eigen/Eigen/OrderingMethods +0 -3
  58. data/vendor/eigen/Eigen/PaStiXSupport +1 -0
  59. data/vendor/eigen/Eigen/PardisoSupport +0 -0
  60. data/vendor/eigen/Eigen/QR +2 -3
  61. data/vendor/eigen/Eigen/QtAlignedMalloc +0 -1
  62. data/vendor/eigen/Eigen/SVD +0 -1
  63. data/vendor/eigen/Eigen/Sparse +0 -2
  64. data/vendor/eigen/Eigen/SparseCholesky +0 -8
  65. data/vendor/eigen/Eigen/SparseLU +4 -0
  66. data/vendor/eigen/Eigen/SparseQR +0 -1
  67. data/vendor/eigen/Eigen/src/Cholesky/LDLT.h +42 -27
  68. data/vendor/eigen/Eigen/src/Cholesky/LLT.h +39 -23
  69. data/vendor/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +90 -47
  70. data/vendor/eigen/Eigen/src/Core/ArithmeticSequence.h +413 -0
  71. data/vendor/eigen/Eigen/src/Core/Array.h +99 -11
  72. data/vendor/eigen/Eigen/src/Core/ArrayBase.h +3 -3
  73. data/vendor/eigen/Eigen/src/Core/ArrayWrapper.h +21 -21
  74. data/vendor/eigen/Eigen/src/Core/Assign.h +1 -1
  75. data/vendor/eigen/Eigen/src/Core/AssignEvaluator.h +125 -50
  76. data/vendor/eigen/Eigen/src/Core/Assign_MKL.h +10 -10
  77. data/vendor/eigen/Eigen/src/Core/BandMatrix.h +16 -16
  78. data/vendor/eigen/Eigen/src/Core/Block.h +56 -60
  79. data/vendor/eigen/Eigen/src/Core/BooleanRedux.h +29 -31
  80. data/vendor/eigen/Eigen/src/Core/CommaInitializer.h +7 -3
  81. data/vendor/eigen/Eigen/src/Core/CoreEvaluators.h +325 -272
  82. data/vendor/eigen/Eigen/src/Core/CoreIterators.h +5 -0
  83. data/vendor/eigen/Eigen/src/Core/CwiseBinaryOp.h +21 -22
  84. data/vendor/eigen/Eigen/src/Core/CwiseNullaryOp.h +153 -18
  85. data/vendor/eigen/Eigen/src/Core/CwiseUnaryOp.h +6 -6
  86. data/vendor/eigen/Eigen/src/Core/CwiseUnaryView.h +14 -10
  87. data/vendor/eigen/Eigen/src/Core/DenseBase.h +132 -42
  88. data/vendor/eigen/Eigen/src/Core/DenseCoeffsBase.h +25 -21
  89. data/vendor/eigen/Eigen/src/Core/DenseStorage.h +153 -71
  90. data/vendor/eigen/Eigen/src/Core/Diagonal.h +21 -23
  91. data/vendor/eigen/Eigen/src/Core/DiagonalMatrix.h +50 -2
  92. data/vendor/eigen/Eigen/src/Core/DiagonalProduct.h +1 -1
  93. data/vendor/eigen/Eigen/src/Core/Dot.h +10 -10
  94. data/vendor/eigen/Eigen/src/Core/EigenBase.h +10 -9
  95. data/vendor/eigen/Eigen/src/Core/ForceAlignedAccess.h +8 -4
  96. data/vendor/eigen/Eigen/src/Core/Fuzzy.h +3 -3
  97. data/vendor/eigen/Eigen/src/Core/GeneralProduct.h +20 -10
  98. data/vendor/eigen/Eigen/src/Core/GenericPacketMath.h +599 -152
  99. data/vendor/eigen/Eigen/src/Core/GlobalFunctions.h +40 -33
  100. data/vendor/eigen/Eigen/src/Core/IO.h +40 -7
  101. data/vendor/eigen/Eigen/src/Core/IndexedView.h +237 -0
  102. data/vendor/eigen/Eigen/src/Core/Inverse.h +9 -10
  103. data/vendor/eigen/Eigen/src/Core/Map.h +7 -7
  104. data/vendor/eigen/Eigen/src/Core/MapBase.h +10 -3
  105. data/vendor/eigen/Eigen/src/Core/MathFunctions.h +767 -125
  106. data/vendor/eigen/Eigen/src/Core/MathFunctionsImpl.h +118 -19
  107. data/vendor/eigen/Eigen/src/Core/Matrix.h +131 -25
  108. data/vendor/eigen/Eigen/src/Core/MatrixBase.h +21 -3
  109. data/vendor/eigen/Eigen/src/Core/NestByValue.h +25 -50
  110. data/vendor/eigen/Eigen/src/Core/NoAlias.h +4 -3
  111. data/vendor/eigen/Eigen/src/Core/NumTraits.h +107 -20
  112. data/vendor/eigen/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
  113. data/vendor/eigen/Eigen/src/Core/PermutationMatrix.h +3 -31
  114. data/vendor/eigen/Eigen/src/Core/PlainObjectBase.h +152 -59
  115. data/vendor/eigen/Eigen/src/Core/Product.h +30 -25
  116. data/vendor/eigen/Eigen/src/Core/ProductEvaluators.h +192 -125
  117. data/vendor/eigen/Eigen/src/Core/Random.h +37 -1
  118. data/vendor/eigen/Eigen/src/Core/Redux.h +180 -170
  119. data/vendor/eigen/Eigen/src/Core/Ref.h +121 -23
  120. data/vendor/eigen/Eigen/src/Core/Replicate.h +8 -8
  121. data/vendor/eigen/Eigen/src/Core/Reshaped.h +454 -0
  122. data/vendor/eigen/Eigen/src/Core/ReturnByValue.h +7 -5
  123. data/vendor/eigen/Eigen/src/Core/Reverse.h +18 -12
  124. data/vendor/eigen/Eigen/src/Core/Select.h +8 -6
  125. data/vendor/eigen/Eigen/src/Core/SelfAdjointView.h +33 -20
  126. data/vendor/eigen/Eigen/src/Core/Solve.h +14 -14
  127. data/vendor/eigen/Eigen/src/Core/SolveTriangular.h +16 -16
  128. data/vendor/eigen/Eigen/src/Core/SolverBase.h +41 -3
  129. data/vendor/eigen/Eigen/src/Core/StableNorm.h +100 -70
  130. data/vendor/eigen/Eigen/src/Core/StlIterators.h +463 -0
  131. data/vendor/eigen/Eigen/src/Core/Stride.h +9 -4
  132. data/vendor/eigen/Eigen/src/Core/Swap.h +5 -4
  133. data/vendor/eigen/Eigen/src/Core/Transpose.h +88 -27
  134. data/vendor/eigen/Eigen/src/Core/Transpositions.h +26 -47
  135. data/vendor/eigen/Eigen/src/Core/TriangularMatrix.h +93 -75
  136. data/vendor/eigen/Eigen/src/Core/VectorBlock.h +5 -5
  137. data/vendor/eigen/Eigen/src/Core/VectorwiseOp.h +159 -70
  138. data/vendor/eigen/Eigen/src/Core/Visitor.h +137 -29
  139. data/vendor/eigen/Eigen/src/Core/arch/AVX/Complex.h +50 -129
  140. data/vendor/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +126 -337
  141. data/vendor/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +1092 -155
  142. data/vendor/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +65 -1
  143. data/vendor/eigen/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
  144. data/vendor/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +207 -236
  145. data/vendor/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1482 -495
  146. data/vendor/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
  147. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +152 -165
  148. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +19 -251
  149. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
  150. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
  151. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
  152. data/vendor/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2042 -392
  153. data/vendor/eigen/Eigen/src/Core/arch/CUDA/Complex.h +235 -80
  154. data/vendor/eigen/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
  155. data/vendor/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +102 -14
  156. data/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
  157. data/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
  158. data/vendor/eigen/Eigen/src/Core/arch/Default/Half.h +942 -0
  159. data/vendor/eigen/Eigen/src/Core/arch/Default/Settings.h +1 -1
  160. data/vendor/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
  161. data/vendor/eigen/Eigen/src/Core/arch/{CUDA → GPU}/MathFunctions.h +16 -4
  162. data/vendor/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
  163. data/vendor/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
  164. data/vendor/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  165. data/vendor/eigen/Eigen/src/Core/arch/MSA/Complex.h +648 -0
  166. data/vendor/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
  167. data/vendor/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
  168. data/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h +313 -219
  169. data/vendor/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
  170. data/vendor/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +54 -70
  171. data/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4376 -549
  172. data/vendor/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
  173. data/vendor/eigen/Eigen/src/Core/arch/SSE/Complex.h +59 -179
  174. data/vendor/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +65 -428
  175. data/vendor/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +893 -283
  176. data/vendor/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +65 -0
  177. data/vendor/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
  178. data/vendor/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
  179. data/vendor/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
  180. data/vendor/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
  181. data/vendor/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
  182. data/vendor/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
  183. data/vendor/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
  184. data/vendor/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
  185. data/vendor/eigen/Eigen/src/Core/arch/ZVector/Complex.h +212 -183
  186. data/vendor/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +101 -5
  187. data/vendor/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +510 -395
  188. data/vendor/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +11 -2
  189. data/vendor/eigen/Eigen/src/Core/functors/BinaryFunctors.h +112 -46
  190. data/vendor/eigen/Eigen/src/Core/functors/NullaryFunctors.h +31 -30
  191. data/vendor/eigen/Eigen/src/Core/functors/StlFunctors.h +32 -2
  192. data/vendor/eigen/Eigen/src/Core/functors/UnaryFunctors.h +355 -16
  193. data/vendor/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1075 -586
  194. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +49 -24
  195. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +41 -35
  196. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +6 -6
  197. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +4 -2
  198. data/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +382 -483
  199. data/vendor/eigen/Eigen/src/Core/products/Parallelizer.h +22 -5
  200. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +53 -30
  201. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +16 -8
  202. data/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +8 -6
  203. data/vendor/eigen/Eigen/src/Core/products/SelfadjointProduct.h +4 -4
  204. data/vendor/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +5 -4
  205. data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +33 -27
  206. data/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +14 -12
  207. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +36 -34
  208. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +8 -4
  209. data/vendor/eigen/Eigen/src/Core/products/TriangularSolverVector.h +13 -10
  210. data/vendor/eigen/Eigen/src/Core/util/BlasUtil.h +304 -119
  211. data/vendor/eigen/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
  212. data/vendor/eigen/Eigen/src/Core/util/Constants.h +25 -9
  213. data/vendor/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +26 -3
  214. data/vendor/eigen/Eigen/src/Core/util/ForwardDeclarations.h +29 -9
  215. data/vendor/eigen/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
  216. data/vendor/eigen/Eigen/src/Core/util/IntegralConstant.h +272 -0
  217. data/vendor/eigen/Eigen/src/Core/util/MKL_support.h +8 -1
  218. data/vendor/eigen/Eigen/src/Core/util/Macros.h +709 -246
  219. data/vendor/eigen/Eigen/src/Core/util/Memory.h +222 -52
  220. data/vendor/eigen/Eigen/src/Core/util/Meta.h +355 -77
  221. data/vendor/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +5 -1
  222. data/vendor/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  223. data/vendor/eigen/Eigen/src/Core/util/StaticAssert.h +8 -5
  224. data/vendor/eigen/Eigen/src/Core/util/SymbolicIndex.h +293 -0
  225. data/vendor/eigen/Eigen/src/Core/util/XprHelper.h +65 -30
  226. data/vendor/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +1 -1
  227. data/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +7 -4
  228. data/vendor/eigen/Eigen/src/Eigenvalues/EigenSolver.h +2 -2
  229. data/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +1 -1
  230. data/vendor/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +2 -2
  231. data/vendor/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +2 -2
  232. data/vendor/eigen/Eigen/src/Eigenvalues/RealQZ.h +9 -6
  233. data/vendor/eigen/Eigen/src/Eigenvalues/RealSchur.h +21 -9
  234. data/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +77 -43
  235. data/vendor/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +20 -15
  236. data/vendor/eigen/Eigen/src/Geometry/AlignedBox.h +99 -5
  237. data/vendor/eigen/Eigen/src/Geometry/AngleAxis.h +4 -4
  238. data/vendor/eigen/Eigen/src/Geometry/EulerAngles.h +3 -3
  239. data/vendor/eigen/Eigen/src/Geometry/Homogeneous.h +15 -11
  240. data/vendor/eigen/Eigen/src/Geometry/Hyperplane.h +1 -1
  241. data/vendor/eigen/Eigen/src/Geometry/OrthoMethods.h +3 -2
  242. data/vendor/eigen/Eigen/src/Geometry/ParametrizedLine.h +39 -2
  243. data/vendor/eigen/Eigen/src/Geometry/Quaternion.h +70 -14
  244. data/vendor/eigen/Eigen/src/Geometry/Rotation2D.h +3 -3
  245. data/vendor/eigen/Eigen/src/Geometry/Scaling.h +23 -5
  246. data/vendor/eigen/Eigen/src/Geometry/Transform.h +88 -67
  247. data/vendor/eigen/Eigen/src/Geometry/Translation.h +6 -12
  248. data/vendor/eigen/Eigen/src/Geometry/Umeyama.h +1 -1
  249. data/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
  250. data/vendor/eigen/Eigen/src/Householder/BlockHouseholder.h +9 -2
  251. data/vendor/eigen/Eigen/src/Householder/Householder.h +8 -4
  252. data/vendor/eigen/Eigen/src/Householder/HouseholderSequence.h +123 -48
  253. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +15 -15
  254. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +7 -23
  255. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +5 -22
  256. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +41 -47
  257. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +51 -60
  258. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +70 -20
  259. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +2 -20
  260. data/vendor/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +11 -9
  261. data/vendor/eigen/Eigen/src/Jacobi/Jacobi.h +31 -10
  262. data/vendor/eigen/Eigen/src/KLUSupport/KLUSupport.h +358 -0
  263. data/vendor/eigen/Eigen/src/LU/Determinant.h +35 -19
  264. data/vendor/eigen/Eigen/src/LU/FullPivLU.h +29 -43
  265. data/vendor/eigen/Eigen/src/LU/InverseImpl.h +25 -8
  266. data/vendor/eigen/Eigen/src/LU/PartialPivLU.h +71 -58
  267. data/vendor/eigen/Eigen/src/LU/arch/InverseSize4.h +351 -0
  268. data/vendor/eigen/Eigen/src/OrderingMethods/Amd.h +7 -17
  269. data/vendor/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +297 -277
  270. data/vendor/eigen/Eigen/src/OrderingMethods/Ordering.h +6 -10
  271. data/vendor/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +1 -1
  272. data/vendor/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +9 -7
  273. data/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR.h +41 -20
  274. data/vendor/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +100 -27
  275. data/vendor/eigen/Eigen/src/QR/FullPivHouseholderQR.h +59 -22
  276. data/vendor/eigen/Eigen/src/QR/HouseholderQR.h +48 -23
  277. data/vendor/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +25 -3
  278. data/vendor/eigen/Eigen/src/SVD/BDCSVD.h +183 -63
  279. data/vendor/eigen/Eigen/src/SVD/JacobiSVD.h +22 -14
  280. data/vendor/eigen/Eigen/src/SVD/SVDBase.h +83 -22
  281. data/vendor/eigen/Eigen/src/SVD/UpperBidiagonalization.h +3 -3
  282. data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +17 -9
  283. data/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +12 -37
  284. data/vendor/eigen/Eigen/src/SparseCore/AmbiVector.h +3 -2
  285. data/vendor/eigen/Eigen/src/SparseCore/CompressedStorage.h +16 -0
  286. data/vendor/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +6 -6
  287. data/vendor/eigen/Eigen/src/SparseCore/SparseAssign.h +81 -27
  288. data/vendor/eigen/Eigen/src/SparseCore/SparseBlock.h +25 -57
  289. data/vendor/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +40 -11
  290. data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +11 -15
  291. data/vendor/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +4 -2
  292. data/vendor/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +30 -8
  293. data/vendor/eigen/Eigen/src/SparseCore/SparseMatrix.h +126 -11
  294. data/vendor/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +5 -12
  295. data/vendor/eigen/Eigen/src/SparseCore/SparseProduct.h +13 -1
  296. data/vendor/eigen/Eigen/src/SparseCore/SparseRef.h +7 -7
  297. data/vendor/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +5 -2
  298. data/vendor/eigen/Eigen/src/SparseCore/SparseUtil.h +8 -0
  299. data/vendor/eigen/Eigen/src/SparseCore/SparseVector.h +1 -1
  300. data/vendor/eigen/Eigen/src/SparseCore/SparseView.h +1 -0
  301. data/vendor/eigen/Eigen/src/SparseLU/SparseLU.h +162 -12
  302. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +1 -1
  303. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +76 -2
  304. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +2 -2
  305. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +1 -1
  306. data/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +1 -1
  307. data/vendor/eigen/Eigen/src/SparseQR/SparseQR.h +19 -6
  308. data/vendor/eigen/Eigen/src/StlSupport/StdDeque.h +2 -12
  309. data/vendor/eigen/Eigen/src/StlSupport/StdList.h +2 -2
  310. data/vendor/eigen/Eigen/src/StlSupport/StdVector.h +2 -2
  311. data/vendor/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +6 -8
  312. data/vendor/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +175 -39
  313. data/vendor/eigen/Eigen/src/misc/lapacke.h +5 -4
  314. data/vendor/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +28 -2
  315. data/vendor/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +155 -11
  316. data/vendor/eigen/Eigen/src/plugins/BlockMethods.h +626 -242
  317. data/vendor/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +14 -0
  318. data/vendor/eigen/Eigen/src/plugins/IndexedViewMethods.h +262 -0
  319. data/vendor/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +4 -4
  320. data/vendor/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +10 -0
  321. data/vendor/eigen/Eigen/src/plugins/ReshapedMethods.h +149 -0
  322. data/vendor/eigen/README.md +2 -0
  323. data/vendor/eigen/bench/btl/README +1 -1
  324. data/vendor/eigen/bench/tensors/README +6 -7
  325. data/vendor/eigen/ci/README.md +56 -0
  326. data/vendor/eigen/demos/mix_eigen_and_c/README +1 -1
  327. data/vendor/eigen/unsupported/Eigen/CXX11/src/Tensor/README.md +213 -158
  328. data/vendor/eigen/unsupported/README.txt +1 -1
  329. data/vendor/tomotopy/README.kr.rst +78 -0
  330. data/vendor/tomotopy/README.rst +75 -0
  331. data/vendor/tomotopy/src/Labeling/FoRelevance.cpp +2 -2
  332. data/vendor/tomotopy/src/Labeling/Phraser.hpp +4 -4
  333. data/vendor/tomotopy/src/TopicModel/CTModel.hpp +7 -3
  334. data/vendor/tomotopy/src/TopicModel/DMRModel.hpp +7 -3
  335. data/vendor/tomotopy/src/TopicModel/DTModel.hpp +6 -3
  336. data/vendor/tomotopy/src/TopicModel/GDMRModel.hpp +2 -2
  337. data/vendor/tomotopy/src/TopicModel/HDP.h +1 -0
  338. data/vendor/tomotopy/src/TopicModel/HDPModel.hpp +57 -6
  339. data/vendor/tomotopy/src/TopicModel/HLDAModel.hpp +6 -3
  340. data/vendor/tomotopy/src/TopicModel/HPAModel.hpp +3 -2
  341. data/vendor/tomotopy/src/TopicModel/LDA.h +3 -3
  342. data/vendor/tomotopy/src/TopicModel/LDACVB0Model.hpp +5 -5
  343. data/vendor/tomotopy/src/TopicModel/LDAModel.hpp +50 -19
  344. data/vendor/tomotopy/src/TopicModel/LLDAModel.hpp +6 -2
  345. data/vendor/tomotopy/src/TopicModel/MGLDAModel.hpp +3 -2
  346. data/vendor/tomotopy/src/TopicModel/PAModel.hpp +1 -1
  347. data/vendor/tomotopy/src/TopicModel/PLDAModel.hpp +6 -2
  348. data/vendor/tomotopy/src/TopicModel/PT.h +3 -1
  349. data/vendor/tomotopy/src/TopicModel/PTModel.hpp +36 -3
  350. data/vendor/tomotopy/src/TopicModel/SLDAModel.hpp +6 -3
  351. data/vendor/tomotopy/src/TopicModel/TopicModel.hpp +55 -26
  352. data/vendor/tomotopy/src/Utils/AliasMethod.hpp +5 -4
  353. data/vendor/tomotopy/src/Utils/Dictionary.h +2 -2
  354. data/vendor/tomotopy/src/Utils/EigenAddonOps.hpp +36 -1
  355. data/vendor/tomotopy/src/Utils/MultiNormalDistribution.hpp +1 -1
  356. data/vendor/tomotopy/src/Utils/TruncMultiNormal.hpp +1 -1
  357. data/vendor/tomotopy/src/Utils/exception.h +6 -0
  358. data/vendor/tomotopy/src/Utils/math.h +2 -2
  359. data/vendor/tomotopy/src/Utils/sample.hpp +14 -12
  360. data/vendor/tomotopy/src/Utils/serializer.hpp +30 -5
  361. data/vendor/tomotopy/src/Utils/sse_gamma.h +0 -3
  362. metadata +64 -18
  363. data/vendor/eigen/Eigen/CMakeLists.txt +0 -19
  364. data/vendor/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -674
  365. data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
  366. data/vendor/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
  367. data/vendor/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
  368. data/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
  369. data/vendor/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
@@ -40,68 +40,126 @@ typedef const VectorBlock<const Derived> ConstSegmentReturnType;
40
40
  template<int Size> struct FixedSegmentReturnType { typedef VectorBlock<Derived, Size> Type; };
41
41
  template<int Size> struct ConstFixedSegmentReturnType { typedef const VectorBlock<const Derived, Size> Type; };
42
42
 
43
+ /// \internal inner-vector
44
+ typedef Block<Derived,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true> InnerVectorReturnType;
45
+ typedef Block<const Derived,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true> ConstInnerVectorReturnType;
46
+
47
+ /// \internal set of inner-vectors
48
+ typedef Block<Derived,Dynamic,Dynamic,true> InnerVectorsReturnType;
49
+ typedef Block<const Derived,Dynamic,Dynamic,true> ConstInnerVectorsReturnType;
50
+
43
51
  #endif // not EIGEN_PARSED_BY_DOXYGEN
44
52
 
45
- /// \returns a dynamic-size expression of a block in *this.
53
+ /// \returns an expression of a block in \c *this with either dynamic or fixed sizes.
46
54
  ///
47
- /// \param startRow the first row in the block
48
- /// \param startCol the first column in the block
49
- /// \param blockRows the number of rows in the block
50
- /// \param blockCols the number of columns in the block
55
+ /// \param startRow the first row in the block
56
+ /// \param startCol the first column in the block
57
+ /// \param blockRows number of rows in the block, specified at either run-time or compile-time
58
+ /// \param blockCols number of columns in the block, specified at either run-time or compile-time
59
+ /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
60
+ /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
51
61
  ///
52
- /// Example: \include MatrixBase_block_int_int_int_int.cpp
62
+ /// Example using runtime (aka dynamic) sizes: \include MatrixBase_block_int_int_int_int.cpp
53
63
  /// Output: \verbinclude MatrixBase_block_int_int_int_int.out
54
64
  ///
55
- /// \note Even though the returned expression has dynamic size, in the case
65
+ /// \newin{3.4}:
66
+ ///
67
+ /// The number of rows \a blockRows and columns \a blockCols can also be specified at compile-time by passing Eigen::fix<N>,
68
+ /// or Eigen::fix<N>(n) as arguments. In the later case, \c n plays the role of a runtime fallback value in case \c N equals Eigen::Dynamic.
69
+ /// Here is an example with a fixed number of rows \c NRows and dynamic number of columns \c cols:
70
+ /// \code
71
+ /// mat.block(i,j,fix<NRows>,cols)
72
+ /// \endcode
73
+ ///
74
+ /// This function thus fully covers the features offered by the following overloads block<NRows,NCols>(Index, Index),
75
+ /// and block<NRows,NCols>(Index, Index, Index, Index) that are thus obsolete. Indeed, this generic version avoids
76
+ /// redundancy, it preserves the argument order, and prevents the need to rely on the template keyword in templated code.
77
+ ///
78
+ /// but with less redundancy and more consistency as it does not modify the argument order
79
+ /// and seamlessly enable hybrid fixed/dynamic sizes.
80
+ ///
81
+ /// \note Even in the case that the returned expression has dynamic size, in the case
56
82
  /// when it is applied to a fixed-size matrix, it inherits a fixed maximal size,
57
83
  /// which means that evaluating it does not cause a dynamic memory allocation.
58
84
  ///
59
85
  EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
60
86
  ///
61
- /// \sa class Block, block(Index,Index)
87
+ /// \sa class Block, fix, fix<N>(int)
62
88
  ///
63
- EIGEN_DEVICE_FUNC
64
- inline BlockXpr block(Index startRow, Index startCol, Index blockRows, Index blockCols)
89
+ template<typename NRowsType, typename NColsType>
90
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
91
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
92
+ typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
93
+ #else
94
+ typename FixedBlockXpr<...,...>::Type
95
+ #endif
96
+ block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols)
65
97
  {
66
- return BlockXpr(derived(), startRow, startCol, blockRows, blockCols);
98
+ return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type(
99
+ derived(), startRow, startCol, internal::get_runtime_value(blockRows), internal::get_runtime_value(blockCols));
67
100
  }
68
101
 
69
- /// This is the const version of block(Index,Index,Index,Index). */
70
- EIGEN_DEVICE_FUNC
71
- inline const ConstBlockXpr block(Index startRow, Index startCol, Index blockRows, Index blockCols) const
102
+ /// This is the const version of block(Index,Index,NRowsType,NColsType)
103
+ template<typename NRowsType, typename NColsType>
104
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
105
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
106
+ const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
107
+ #else
108
+ const typename ConstFixedBlockXpr<...,...>::Type
109
+ #endif
110
+ block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols) const
72
111
  {
73
- return ConstBlockXpr(derived(), startRow, startCol, blockRows, blockCols);
112
+ return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type(
113
+ derived(), startRow, startCol, internal::get_runtime_value(blockRows), internal::get_runtime_value(blockCols));
74
114
  }
75
115
 
76
116
 
77
117
 
78
-
79
- /// \returns a dynamic-size expression of a top-right corner of *this.
118
+ /// \returns a expression of a top-right corner of \c *this with either dynamic or fixed sizes.
80
119
  ///
81
120
  /// \param cRows the number of rows in the corner
82
121
  /// \param cCols the number of columns in the corner
122
+ /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
123
+ /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
83
124
  ///
84
- /// Example: \include MatrixBase_topRightCorner_int_int.cpp
125
+ /// Example with dynamic sizes: \include MatrixBase_topRightCorner_int_int.cpp
85
126
  /// Output: \verbinclude MatrixBase_topRightCorner_int_int.out
86
127
  ///
128
+ /// The number of rows \a blockRows and columns \a blockCols can also be specified at compile-time by passing Eigen::fix<N>,
129
+ /// or Eigen::fix<N>(n) as arguments. See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
130
+ ///
87
131
  EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
88
132
  ///
89
- /// \sa class Block, block(Index,Index,Index,Index)
133
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
90
134
  ///
91
- EIGEN_DEVICE_FUNC
92
- inline BlockXpr topRightCorner(Index cRows, Index cCols)
135
+ template<typename NRowsType, typename NColsType>
136
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
137
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
138
+ typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
139
+ #else
140
+ typename FixedBlockXpr<...,...>::Type
141
+ #endif
142
+ topRightCorner(NRowsType cRows, NColsType cCols)
93
143
  {
94
- return BlockXpr(derived(), 0, cols() - cCols, cRows, cCols);
144
+ return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
145
+ (derived(), 0, cols() - internal::get_runtime_value(cCols), internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
95
146
  }
96
147
 
97
- /// This is the const version of topRightCorner(Index, Index).
98
- EIGEN_DEVICE_FUNC
99
- inline const ConstBlockXpr topRightCorner(Index cRows, Index cCols) const
148
+ /// This is the const version of topRightCorner(NRowsType, NColsType).
149
+ template<typename NRowsType, typename NColsType>
150
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
151
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
152
+ const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
153
+ #else
154
+ const typename ConstFixedBlockXpr<...,...>::Type
155
+ #endif
156
+ topRightCorner(NRowsType cRows, NColsType cCols) const
100
157
  {
101
- return ConstBlockXpr(derived(), 0, cols() - cCols, cRows, cCols);
158
+ return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
159
+ (derived(), 0, cols() - internal::get_runtime_value(cCols), internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
102
160
  }
103
161
 
104
- /// \returns an expression of a fixed-size top-right corner of *this.
162
+ /// \returns an expression of a fixed-size top-right corner of \c *this.
105
163
  ///
106
164
  /// \tparam CRows the number of rows in the corner
107
165
  /// \tparam CCols the number of columns in the corner
@@ -114,21 +172,21 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
114
172
  /// \sa class Block, block<int,int>(Index,Index)
115
173
  ///
116
174
  template<int CRows, int CCols>
117
- EIGEN_DEVICE_FUNC
118
- inline typename FixedBlockXpr<CRows,CCols>::Type topRightCorner()
175
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
176
+ typename FixedBlockXpr<CRows,CCols>::Type topRightCorner()
119
177
  {
120
178
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
121
179
  }
122
180
 
123
181
  /// This is the const version of topRightCorner<int, int>().
124
182
  template<int CRows, int CCols>
125
- EIGEN_DEVICE_FUNC
126
- inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner() const
183
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
184
+ const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner() const
127
185
  {
128
186
  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
129
187
  }
130
188
 
131
- /// \returns an expression of a top-right corner of *this.
189
+ /// \returns an expression of a top-right corner of \c *this.
132
190
  ///
133
191
  /// \tparam CRows number of rows in corner as specified at compile-time
134
192
  /// \tparam CCols number of columns in corner as specified at compile-time
@@ -148,46 +206,67 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
148
206
  /// \sa class Block
149
207
  ///
150
208
  template<int CRows, int CCols>
151
- inline typename FixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols)
209
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
210
+ typename FixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols)
152
211
  {
153
212
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
154
213
  }
155
214
 
156
215
  /// This is the const version of topRightCorner<int, int>(Index, Index).
157
216
  template<int CRows, int CCols>
158
- inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols) const
217
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
218
+ const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols) const
159
219
  {
160
220
  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
161
221
  }
162
222
 
163
223
 
164
224
 
165
- /// \returns a dynamic-size expression of a top-left corner of *this.
225
+ /// \returns an expression of a top-left corner of \c *this with either dynamic or fixed sizes.
166
226
  ///
167
227
  /// \param cRows the number of rows in the corner
168
228
  /// \param cCols the number of columns in the corner
229
+ /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
230
+ /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
169
231
  ///
170
232
  /// Example: \include MatrixBase_topLeftCorner_int_int.cpp
171
233
  /// Output: \verbinclude MatrixBase_topLeftCorner_int_int.out
172
234
  ///
235
+ /// The number of rows \a blockRows and columns \a blockCols can also be specified at compile-time by passing Eigen::fix<N>,
236
+ /// or Eigen::fix<N>(n) as arguments. See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
237
+ ///
173
238
  EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
174
239
  ///
175
- /// \sa class Block, block(Index,Index,Index,Index)
240
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
176
241
  ///
177
- EIGEN_DEVICE_FUNC
178
- inline BlockXpr topLeftCorner(Index cRows, Index cCols)
242
+ template<typename NRowsType, typename NColsType>
243
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
244
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
245
+ typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
246
+ #else
247
+ typename FixedBlockXpr<...,...>::Type
248
+ #endif
249
+ topLeftCorner(NRowsType cRows, NColsType cCols)
179
250
  {
180
- return BlockXpr(derived(), 0, 0, cRows, cCols);
251
+ return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
252
+ (derived(), 0, 0, internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
181
253
  }
182
254
 
183
255
  /// This is the const version of topLeftCorner(Index, Index).
184
- EIGEN_DEVICE_FUNC
185
- inline const ConstBlockXpr topLeftCorner(Index cRows, Index cCols) const
256
+ template<typename NRowsType, typename NColsType>
257
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
258
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
259
+ const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
260
+ #else
261
+ const typename ConstFixedBlockXpr<...,...>::Type
262
+ #endif
263
+ topLeftCorner(NRowsType cRows, NColsType cCols) const
186
264
  {
187
- return ConstBlockXpr(derived(), 0, 0, cRows, cCols);
265
+ return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
266
+ (derived(), 0, 0, internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
188
267
  }
189
268
 
190
- /// \returns an expression of a fixed-size top-left corner of *this.
269
+ /// \returns an expression of a fixed-size top-left corner of \c *this.
191
270
  ///
192
271
  /// The template parameters CRows and CCols are the number of rows and columns in the corner.
193
272
  ///
@@ -196,24 +275,24 @@ inline const ConstBlockXpr topLeftCorner(Index cRows, Index cCols) const
196
275
  ///
197
276
  EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
198
277
  ///
199
- /// \sa class Block, block(Index,Index,Index,Index)
278
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
200
279
  ///
201
280
  template<int CRows, int CCols>
202
- EIGEN_DEVICE_FUNC
203
- inline typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner()
281
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
282
+ typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner()
204
283
  {
205
284
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
206
285
  }
207
286
 
208
287
  /// This is the const version of topLeftCorner<int, int>().
209
288
  template<int CRows, int CCols>
210
- EIGEN_DEVICE_FUNC
211
- inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner() const
289
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
290
+ const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner() const
212
291
  {
213
292
  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
214
293
  }
215
294
 
216
- /// \returns an expression of a top-left corner of *this.
295
+ /// \returns an expression of a top-left corner of \c *this.
217
296
  ///
218
297
  /// \tparam CRows number of rows in corner as specified at compile-time
219
298
  /// \tparam CCols number of columns in corner as specified at compile-time
@@ -233,46 +312,69 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
233
312
  /// \sa class Block
234
313
  ///
235
314
  template<int CRows, int CCols>
236
- inline typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols)
315
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
316
+ typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols)
237
317
  {
238
318
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
239
319
  }
240
320
 
241
321
  /// This is the const version of topLeftCorner<int, int>(Index, Index).
242
322
  template<int CRows, int CCols>
243
- inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols) const
323
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
324
+ const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols) const
244
325
  {
245
326
  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
246
327
  }
247
328
 
248
329
 
249
330
 
250
- /// \returns a dynamic-size expression of a bottom-right corner of *this.
331
+ /// \returns an expression of a bottom-right corner of \c *this with either dynamic or fixed sizes.
251
332
  ///
252
333
  /// \param cRows the number of rows in the corner
253
334
  /// \param cCols the number of columns in the corner
335
+ /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
336
+ /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
254
337
  ///
255
338
  /// Example: \include MatrixBase_bottomRightCorner_int_int.cpp
256
339
  /// Output: \verbinclude MatrixBase_bottomRightCorner_int_int.out
257
340
  ///
341
+ /// The number of rows \a blockRows and columns \a blockCols can also be specified at compile-time by passing Eigen::fix<N>,
342
+ /// or Eigen::fix<N>(n) as arguments. See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
343
+ ///
258
344
  EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
259
345
  ///
260
- /// \sa class Block, block(Index,Index,Index,Index)
346
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
261
347
  ///
262
- EIGEN_DEVICE_FUNC
263
- inline BlockXpr bottomRightCorner(Index cRows, Index cCols)
348
+ template<typename NRowsType, typename NColsType>
349
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
350
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
351
+ typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
352
+ #else
353
+ typename FixedBlockXpr<...,...>::Type
354
+ #endif
355
+ bottomRightCorner(NRowsType cRows, NColsType cCols)
264
356
  {
265
- return BlockXpr(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
357
+ return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
358
+ (derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
359
+ internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
266
360
  }
267
361
 
268
- /// This is the const version of bottomRightCorner(Index, Index).
269
- EIGEN_DEVICE_FUNC
270
- inline const ConstBlockXpr bottomRightCorner(Index cRows, Index cCols) const
362
+ /// This is the const version of bottomRightCorner(NRowsType, NColsType).
363
+ template<typename NRowsType, typename NColsType>
364
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
365
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
366
+ const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
367
+ #else
368
+ const typename ConstFixedBlockXpr<...,...>::Type
369
+ #endif
370
+ bottomRightCorner(NRowsType cRows, NColsType cCols) const
271
371
  {
272
- return ConstBlockXpr(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
372
+ return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
373
+ (derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
374
+ internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
273
375
  }
274
376
 
275
- /// \returns an expression of a fixed-size bottom-right corner of *this.
377
+ /// \returns an expression of a fixed-size bottom-right corner of \c *this.
276
378
  ///
277
379
  /// The template parameters CRows and CCols are the number of rows and columns in the corner.
278
380
  ///
@@ -281,24 +383,24 @@ inline const ConstBlockXpr bottomRightCorner(Index cRows, Index cCols) const
281
383
  ///
282
384
  EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
283
385
  ///
284
- /// \sa class Block, block(Index,Index,Index,Index)
386
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
285
387
  ///
286
388
  template<int CRows, int CCols>
287
- EIGEN_DEVICE_FUNC
288
- inline typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner()
389
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
390
+ typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner()
289
391
  {
290
392
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
291
393
  }
292
394
 
293
395
  /// This is the const version of bottomRightCorner<int, int>().
294
396
  template<int CRows, int CCols>
295
- EIGEN_DEVICE_FUNC
296
- inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner() const
397
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
398
+ const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner() const
297
399
  {
298
400
  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
299
401
  }
300
402
 
301
- /// \returns an expression of a bottom-right corner of *this.
403
+ /// \returns an expression of a bottom-right corner of \c *this.
302
404
  ///
303
405
  /// \tparam CRows number of rows in corner as specified at compile-time
304
406
  /// \tparam CCols number of columns in corner as specified at compile-time
@@ -318,46 +420,69 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
318
420
  /// \sa class Block
319
421
  ///
320
422
  template<int CRows, int CCols>
321
- inline typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols)
423
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
424
+ typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols)
322
425
  {
323
426
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
324
427
  }
325
428
 
326
429
  /// This is the const version of bottomRightCorner<int, int>(Index, Index).
327
430
  template<int CRows, int CCols>
328
- inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols) const
431
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
432
+ const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols) const
329
433
  {
330
434
  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
331
435
  }
332
436
 
333
437
 
334
438
 
335
- /// \returns a dynamic-size expression of a bottom-left corner of *this.
439
+ /// \returns an expression of a bottom-left corner of \c *this with either dynamic or fixed sizes.
336
440
  ///
337
441
  /// \param cRows the number of rows in the corner
338
442
  /// \param cCols the number of columns in the corner
443
+ /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
444
+ /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
339
445
  ///
340
446
  /// Example: \include MatrixBase_bottomLeftCorner_int_int.cpp
341
447
  /// Output: \verbinclude MatrixBase_bottomLeftCorner_int_int.out
342
448
  ///
449
+ /// The number of rows \a blockRows and columns \a blockCols can also be specified at compile-time by passing Eigen::fix<N>,
450
+ /// or Eigen::fix<N>(n) as arguments. See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
451
+ ///
343
452
  EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
344
453
  ///
345
- /// \sa class Block, block(Index,Index,Index,Index)
454
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
346
455
  ///
347
- EIGEN_DEVICE_FUNC
348
- inline BlockXpr bottomLeftCorner(Index cRows, Index cCols)
456
+ template<typename NRowsType, typename NColsType>
457
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
458
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
459
+ typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
460
+ #else
461
+ typename FixedBlockXpr<...,...>::Type
462
+ #endif
463
+ bottomLeftCorner(NRowsType cRows, NColsType cCols)
349
464
  {
350
- return BlockXpr(derived(), rows() - cRows, 0, cRows, cCols);
465
+ return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
466
+ (derived(), rows() - internal::get_runtime_value(cRows), 0,
467
+ internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
351
468
  }
352
469
 
353
- /// This is the const version of bottomLeftCorner(Index, Index).
354
- EIGEN_DEVICE_FUNC
355
- inline const ConstBlockXpr bottomLeftCorner(Index cRows, Index cCols) const
470
+ /// This is the const version of bottomLeftCorner(NRowsType, NColsType).
471
+ template<typename NRowsType, typename NColsType>
472
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
473
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
474
+ typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
475
+ #else
476
+ typename ConstFixedBlockXpr<...,...>::Type
477
+ #endif
478
+ bottomLeftCorner(NRowsType cRows, NColsType cCols) const
356
479
  {
357
- return ConstBlockXpr(derived(), rows() - cRows, 0, cRows, cCols);
480
+ return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
481
+ (derived(), rows() - internal::get_runtime_value(cRows), 0,
482
+ internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
358
483
  }
359
484
 
360
- /// \returns an expression of a fixed-size bottom-left corner of *this.
485
+ /// \returns an expression of a fixed-size bottom-left corner of \c *this.
361
486
  ///
362
487
  /// The template parameters CRows and CCols are the number of rows and columns in the corner.
363
488
  ///
@@ -366,24 +491,24 @@ inline const ConstBlockXpr bottomLeftCorner(Index cRows, Index cCols) const
366
491
  ///
367
492
  EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
368
493
  ///
369
- /// \sa class Block, block(Index,Index,Index,Index)
494
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
370
495
  ///
371
496
  template<int CRows, int CCols>
372
- EIGEN_DEVICE_FUNC
373
- inline typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner()
497
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
498
+ typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner()
374
499
  {
375
500
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
376
501
  }
377
502
 
378
503
  /// This is the const version of bottomLeftCorner<int, int>().
379
504
  template<int CRows, int CCols>
380
- EIGEN_DEVICE_FUNC
381
- inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner() const
505
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
506
+ const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner() const
382
507
  {
383
508
  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
384
509
  }
385
510
 
386
- /// \returns an expression of a bottom-left corner of *this.
511
+ /// \returns an expression of a bottom-left corner of \c *this.
387
512
  ///
388
513
  /// \tparam CRows number of rows in corner as specified at compile-time
389
514
  /// \tparam CCols number of columns in corner as specified at compile-time
@@ -403,45 +528,66 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
403
528
  /// \sa class Block
404
529
  ///
405
530
  template<int CRows, int CCols>
406
- inline typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols)
531
+ EIGEN_STRONG_INLINE
532
+ typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols)
407
533
  {
408
534
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
409
535
  }
410
536
 
411
537
  /// This is the const version of bottomLeftCorner<int, int>(Index, Index).
412
538
  template<int CRows, int CCols>
413
- inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols) const
539
+ EIGEN_STRONG_INLINE
540
+ const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols) const
414
541
  {
415
542
  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
416
543
  }
417
544
 
418
545
 
419
546
 
420
- /// \returns a block consisting of the top rows of *this.
547
+ /// \returns a block consisting of the top rows of \c *this.
421
548
  ///
422
549
  /// \param n the number of rows in the block
550
+ /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
423
551
  ///
424
552
  /// Example: \include MatrixBase_topRows_int.cpp
425
553
  /// Output: \verbinclude MatrixBase_topRows_int.out
426
554
  ///
555
+ /// The number of rows \a n can also be specified at compile-time by passing Eigen::fix<N>,
556
+ /// or Eigen::fix<N>(n) as arguments.
557
+ /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
558
+ ///
427
559
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
428
560
  ///
429
- /// \sa class Block, block(Index,Index,Index,Index)
561
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
430
562
  ///
431
- EIGEN_DEVICE_FUNC
432
- inline RowsBlockXpr topRows(Index n)
563
+ template<typename NRowsType>
564
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
565
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
566
+ typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
567
+ #else
568
+ typename NRowsBlockXpr<...>::Type
569
+ #endif
570
+ topRows(NRowsType n)
433
571
  {
434
- return RowsBlockXpr(derived(), 0, 0, n, cols());
572
+ return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
573
+ (derived(), 0, 0, internal::get_runtime_value(n), cols());
435
574
  }
436
575
 
437
- /// This is the const version of topRows(Index).
438
- EIGEN_DEVICE_FUNC
439
- inline ConstRowsBlockXpr topRows(Index n) const
576
+ /// This is the const version of topRows(NRowsType).
577
+ template<typename NRowsType>
578
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
579
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
580
+ const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
581
+ #else
582
+ const typename ConstNRowsBlockXpr<...>::Type
583
+ #endif
584
+ topRows(NRowsType n) const
440
585
  {
441
- return ConstRowsBlockXpr(derived(), 0, 0, n, cols());
586
+ return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
587
+ (derived(), 0, 0, internal::get_runtime_value(n), cols());
442
588
  }
443
589
 
444
- /// \returns a block consisting of the top rows of *this.
590
+ /// \returns a block consisting of the top rows of \c *this.
445
591
  ///
446
592
  /// \tparam N the number of rows in the block as specified at compile-time
447
593
  /// \param n the number of rows in the block as specified at run-time
@@ -454,50 +600,69 @@ inline ConstRowsBlockXpr topRows(Index n) const
454
600
  ///
455
601
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
456
602
  ///
457
- /// \sa class Block, block(Index,Index,Index,Index)
603
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
458
604
  ///
459
605
  template<int N>
460
- EIGEN_DEVICE_FUNC
461
- inline typename NRowsBlockXpr<N>::Type topRows(Index n = N)
606
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
607
+ typename NRowsBlockXpr<N>::Type topRows(Index n = N)
462
608
  {
463
609
  return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
464
610
  }
465
611
 
466
612
  /// This is the const version of topRows<int>().
467
613
  template<int N>
468
- EIGEN_DEVICE_FUNC
469
- inline typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const
614
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
615
+ typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const
470
616
  {
471
617
  return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
472
618
  }
473
619
 
474
620
 
475
621
 
476
- /// \returns a block consisting of the bottom rows of *this.
622
+ /// \returns a block consisting of the bottom rows of \c *this.
477
623
  ///
478
624
  /// \param n the number of rows in the block
625
+ /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
479
626
  ///
480
627
  /// Example: \include MatrixBase_bottomRows_int.cpp
481
628
  /// Output: \verbinclude MatrixBase_bottomRows_int.out
482
629
  ///
630
+ /// The number of rows \a n can also be specified at compile-time by passing Eigen::fix<N>,
631
+ /// or Eigen::fix<N>(n) as arguments.
632
+ /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
633
+ ///
483
634
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
484
635
  ///
485
- /// \sa class Block, block(Index,Index,Index,Index)
636
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
486
637
  ///
487
- EIGEN_DEVICE_FUNC
488
- inline RowsBlockXpr bottomRows(Index n)
638
+ template<typename NRowsType>
639
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
640
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
641
+ typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
642
+ #else
643
+ typename NRowsBlockXpr<...>::Type
644
+ #endif
645
+ bottomRows(NRowsType n)
489
646
  {
490
- return RowsBlockXpr(derived(), rows() - n, 0, n, cols());
647
+ return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
648
+ (derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
491
649
  }
492
650
 
493
- /// This is the const version of bottomRows(Index).
494
- EIGEN_DEVICE_FUNC
495
- inline ConstRowsBlockXpr bottomRows(Index n) const
651
+ /// This is the const version of bottomRows(NRowsType).
652
+ template<typename NRowsType>
653
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
654
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
655
+ const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
656
+ #else
657
+ const typename ConstNRowsBlockXpr<...>::Type
658
+ #endif
659
+ bottomRows(NRowsType n) const
496
660
  {
497
- return ConstRowsBlockXpr(derived(), rows() - n, 0, n, cols());
661
+ return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
662
+ (derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
498
663
  }
499
664
 
500
- /// \returns a block consisting of the bottom rows of *this.
665
+ /// \returns a block consisting of the bottom rows of \c *this.
501
666
  ///
502
667
  /// \tparam N the number of rows in the block as specified at compile-time
503
668
  /// \param n the number of rows in the block as specified at run-time
@@ -510,51 +675,70 @@ inline ConstRowsBlockXpr bottomRows(Index n) const
510
675
  ///
511
676
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
512
677
  ///
513
- /// \sa class Block, block(Index,Index,Index,Index)
678
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
514
679
  ///
515
680
  template<int N>
516
- EIGEN_DEVICE_FUNC
517
- inline typename NRowsBlockXpr<N>::Type bottomRows(Index n = N)
681
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
682
+ typename NRowsBlockXpr<N>::Type bottomRows(Index n = N)
518
683
  {
519
684
  return typename NRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
520
685
  }
521
686
 
522
687
  /// This is the const version of bottomRows<int>().
523
688
  template<int N>
524
- EIGEN_DEVICE_FUNC
525
- inline typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const
689
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
690
+ typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const
526
691
  {
527
692
  return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
528
693
  }
529
694
 
530
695
 
531
696
 
532
- /// \returns a block consisting of a range of rows of *this.
697
+ /// \returns a block consisting of a range of rows of \c *this.
533
698
  ///
534
699
  /// \param startRow the index of the first row in the block
535
700
  /// \param n the number of rows in the block
701
+ /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
536
702
  ///
537
703
  /// Example: \include DenseBase_middleRows_int.cpp
538
704
  /// Output: \verbinclude DenseBase_middleRows_int.out
539
705
  ///
706
+ /// The number of rows \a n can also be specified at compile-time by passing Eigen::fix<N>,
707
+ /// or Eigen::fix<N>(n) as arguments.
708
+ /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
709
+ ///
540
710
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
541
711
  ///
542
- /// \sa class Block, block(Index,Index,Index,Index)
712
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
543
713
  ///
544
- EIGEN_DEVICE_FUNC
545
- inline RowsBlockXpr middleRows(Index startRow, Index n)
714
+ template<typename NRowsType>
715
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
716
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
717
+ typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
718
+ #else
719
+ typename NRowsBlockXpr<...>::Type
720
+ #endif
721
+ middleRows(Index startRow, NRowsType n)
546
722
  {
547
- return RowsBlockXpr(derived(), startRow, 0, n, cols());
723
+ return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
724
+ (derived(), startRow, 0, internal::get_runtime_value(n), cols());
548
725
  }
549
726
 
550
- /// This is the const version of middleRows(Index,Index).
551
- EIGEN_DEVICE_FUNC
552
- inline ConstRowsBlockXpr middleRows(Index startRow, Index n) const
727
+ /// This is the const version of middleRows(Index,NRowsType).
728
+ template<typename NRowsType>
729
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
730
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
731
+ const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
732
+ #else
733
+ const typename ConstNRowsBlockXpr<...>::Type
734
+ #endif
735
+ middleRows(Index startRow, NRowsType n) const
553
736
  {
554
- return ConstRowsBlockXpr(derived(), startRow, 0, n, cols());
737
+ return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
738
+ (derived(), startRow, 0, internal::get_runtime_value(n), cols());
555
739
  }
556
740
 
557
- /// \returns a block consisting of a range of rows of *this.
741
+ /// \returns a block consisting of a range of rows of \c *this.
558
742
  ///
559
743
  /// \tparam N the number of rows in the block as specified at compile-time
560
744
  /// \param startRow the index of the first row in the block
@@ -568,50 +752,69 @@ inline ConstRowsBlockXpr middleRows(Index startRow, Index n) const
568
752
  ///
569
753
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
570
754
  ///
571
- /// \sa class Block, block(Index,Index,Index,Index)
755
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
572
756
  ///
573
757
  template<int N>
574
- EIGEN_DEVICE_FUNC
575
- inline typename NRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N)
758
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
759
+ typename NRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N)
576
760
  {
577
761
  return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
578
762
  }
579
763
 
580
764
  /// This is the const version of middleRows<int>().
581
765
  template<int N>
582
- EIGEN_DEVICE_FUNC
583
- inline typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N) const
766
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
767
+ typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N) const
584
768
  {
585
769
  return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
586
770
  }
587
771
 
588
772
 
589
773
 
590
- /// \returns a block consisting of the left columns of *this.
774
+ /// \returns a block consisting of the left columns of \c *this.
591
775
  ///
592
776
  /// \param n the number of columns in the block
777
+ /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
593
778
  ///
594
779
  /// Example: \include MatrixBase_leftCols_int.cpp
595
780
  /// Output: \verbinclude MatrixBase_leftCols_int.out
596
781
  ///
782
+ /// The number of columns \a n can also be specified at compile-time by passing Eigen::fix<N>,
783
+ /// or Eigen::fix<N>(n) as arguments.
784
+ /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
785
+ ///
597
786
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
598
787
  ///
599
- /// \sa class Block, block(Index,Index,Index,Index)
788
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
600
789
  ///
601
- EIGEN_DEVICE_FUNC
602
- inline ColsBlockXpr leftCols(Index n)
790
+ template<typename NColsType>
791
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
792
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
793
+ typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
794
+ #else
795
+ typename NColsBlockXpr<...>::Type
796
+ #endif
797
+ leftCols(NColsType n)
603
798
  {
604
- return ColsBlockXpr(derived(), 0, 0, rows(), n);
799
+ return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
800
+ (derived(), 0, 0, rows(), internal::get_runtime_value(n));
605
801
  }
606
802
 
607
- /// This is the const version of leftCols(Index).
608
- EIGEN_DEVICE_FUNC
609
- inline ConstColsBlockXpr leftCols(Index n) const
803
+ /// This is the const version of leftCols(NColsType).
804
+ template<typename NColsType>
805
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
806
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
807
+ const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
808
+ #else
809
+ const typename ConstNColsBlockXpr<...>::Type
810
+ #endif
811
+ leftCols(NColsType n) const
610
812
  {
611
- return ConstColsBlockXpr(derived(), 0, 0, rows(), n);
813
+ return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
814
+ (derived(), 0, 0, rows(), internal::get_runtime_value(n));
612
815
  }
613
816
 
614
- /// \returns a block consisting of the left columns of *this.
817
+ /// \returns a block consisting of the left columns of \c *this.
615
818
  ///
616
819
  /// \tparam N the number of columns in the block as specified at compile-time
617
820
  /// \param n the number of columns in the block as specified at run-time
@@ -624,50 +827,69 @@ inline ConstColsBlockXpr leftCols(Index n) const
624
827
  ///
625
828
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
626
829
  ///
627
- /// \sa class Block, block(Index,Index,Index,Index)
830
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
628
831
  ///
629
832
  template<int N>
630
- EIGEN_DEVICE_FUNC
631
- inline typename NColsBlockXpr<N>::Type leftCols(Index n = N)
833
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
834
+ typename NColsBlockXpr<N>::Type leftCols(Index n = N)
632
835
  {
633
836
  return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
634
837
  }
635
838
 
636
839
  /// This is the const version of leftCols<int>().
637
840
  template<int N>
638
- EIGEN_DEVICE_FUNC
639
- inline typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const
841
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
842
+ typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const
640
843
  {
641
844
  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
642
845
  }
643
846
 
644
847
 
645
848
 
646
- /// \returns a block consisting of the right columns of *this.
849
+ /// \returns a block consisting of the right columns of \c *this.
647
850
  ///
648
851
  /// \param n the number of columns in the block
852
+ /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
649
853
  ///
650
854
  /// Example: \include MatrixBase_rightCols_int.cpp
651
855
  /// Output: \verbinclude MatrixBase_rightCols_int.out
652
856
  ///
857
+ /// The number of columns \a n can also be specified at compile-time by passing Eigen::fix<N>,
858
+ /// or Eigen::fix<N>(n) as arguments.
859
+ /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
860
+ ///
653
861
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
654
862
  ///
655
- /// \sa class Block, block(Index,Index,Index,Index)
863
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
656
864
  ///
657
- EIGEN_DEVICE_FUNC
658
- inline ColsBlockXpr rightCols(Index n)
865
+ template<typename NColsType>
866
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
867
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
868
+ typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
869
+ #else
870
+ typename NColsBlockXpr<...>::Type
871
+ #endif
872
+ rightCols(NColsType n)
659
873
  {
660
- return ColsBlockXpr(derived(), 0, cols() - n, rows(), n);
874
+ return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
875
+ (derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
661
876
  }
662
877
 
663
- /// This is the const version of rightCols(Index).
664
- EIGEN_DEVICE_FUNC
665
- inline ConstColsBlockXpr rightCols(Index n) const
878
+ /// This is the const version of rightCols(NColsType).
879
+ template<typename NColsType>
880
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
881
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
882
+ const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
883
+ #else
884
+ const typename ConstNColsBlockXpr<...>::Type
885
+ #endif
886
+ rightCols(NColsType n) const
666
887
  {
667
- return ConstColsBlockXpr(derived(), 0, cols() - n, rows(), n);
888
+ return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
889
+ (derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
668
890
  }
669
891
 
670
- /// \returns a block consisting of the right columns of *this.
892
+ /// \returns a block consisting of the right columns of \c *this.
671
893
  ///
672
894
  /// \tparam N the number of columns in the block as specified at compile-time
673
895
  /// \param n the number of columns in the block as specified at run-time
@@ -680,51 +902,70 @@ inline ConstColsBlockXpr rightCols(Index n) const
680
902
  ///
681
903
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
682
904
  ///
683
- /// \sa class Block, block(Index,Index,Index,Index)
905
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
684
906
  ///
685
907
  template<int N>
686
- EIGEN_DEVICE_FUNC
687
- inline typename NColsBlockXpr<N>::Type rightCols(Index n = N)
908
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
909
+ typename NColsBlockXpr<N>::Type rightCols(Index n = N)
688
910
  {
689
911
  return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
690
912
  }
691
913
 
692
914
  /// This is the const version of rightCols<int>().
693
915
  template<int N>
694
- EIGEN_DEVICE_FUNC
695
- inline typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const
916
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
917
+ typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const
696
918
  {
697
919
  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
698
920
  }
699
921
 
700
922
 
701
923
 
702
- /// \returns a block consisting of a range of columns of *this.
924
+ /// \returns a block consisting of a range of columns of \c *this.
703
925
  ///
704
926
  /// \param startCol the index of the first column in the block
705
927
  /// \param numCols the number of columns in the block
928
+ /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
706
929
  ///
707
930
  /// Example: \include DenseBase_middleCols_int.cpp
708
931
  /// Output: \verbinclude DenseBase_middleCols_int.out
709
932
  ///
933
+ /// The number of columns \a n can also be specified at compile-time by passing Eigen::fix<N>,
934
+ /// or Eigen::fix<N>(n) as arguments.
935
+ /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
936
+ ///
710
937
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
711
938
  ///
712
- /// \sa class Block, block(Index,Index,Index,Index)
939
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
713
940
  ///
714
- EIGEN_DEVICE_FUNC
715
- inline ColsBlockXpr middleCols(Index startCol, Index numCols)
941
+ template<typename NColsType>
942
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
943
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
944
+ typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
945
+ #else
946
+ typename NColsBlockXpr<...>::Type
947
+ #endif
948
+ middleCols(Index startCol, NColsType numCols)
716
949
  {
717
- return ColsBlockXpr(derived(), 0, startCol, rows(), numCols);
950
+ return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
951
+ (derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
718
952
  }
719
953
 
720
- /// This is the const version of middleCols(Index,Index).
721
- EIGEN_DEVICE_FUNC
722
- inline ConstColsBlockXpr middleCols(Index startCol, Index numCols) const
954
+ /// This is the const version of middleCols(Index,NColsType).
955
+ template<typename NColsType>
956
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
957
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
958
+ const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
959
+ #else
960
+ const typename ConstNColsBlockXpr<...>::Type
961
+ #endif
962
+ middleCols(Index startCol, NColsType numCols) const
723
963
  {
724
- return ConstColsBlockXpr(derived(), 0, startCol, rows(), numCols);
964
+ return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
965
+ (derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
725
966
  }
726
967
 
727
- /// \returns a block consisting of a range of columns of *this.
968
+ /// \returns a block consisting of a range of columns of \c *this.
728
969
  ///
729
970
  /// \tparam N the number of columns in the block as specified at compile-time
730
971
  /// \param startCol the index of the first column in the block
@@ -738,26 +979,26 @@ inline ConstColsBlockXpr middleCols(Index startCol, Index numCols) const
738
979
  ///
739
980
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
740
981
  ///
741
- /// \sa class Block, block(Index,Index,Index,Index)
982
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
742
983
  ///
743
984
  template<int N>
744
- EIGEN_DEVICE_FUNC
745
- inline typename NColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N)
985
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
986
+ typename NColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N)
746
987
  {
747
988
  return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
748
989
  }
749
990
 
750
991
  /// This is the const version of middleCols<int>().
751
992
  template<int N>
752
- EIGEN_DEVICE_FUNC
753
- inline typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N) const
993
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
994
+ typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N) const
754
995
  {
755
996
  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
756
997
  }
757
998
 
758
999
 
759
1000
 
760
- /// \returns a fixed-size expression of a block in *this.
1001
+ /// \returns a fixed-size expression of a block of \c *this.
761
1002
  ///
762
1003
  /// The template parameters \a NRows and \a NCols are the number of
763
1004
  /// rows and columns in the block.
@@ -768,29 +1009,35 @@ inline typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol, Index n =
768
1009
  /// Example: \include MatrixBase_block_int_int.cpp
769
1010
  /// Output: \verbinclude MatrixBase_block_int_int.out
770
1011
  ///
1012
+ /// \note The usage of of this overload is discouraged from %Eigen 3.4, better used the generic
1013
+ /// block(Index,Index,NRowsType,NColsType), here is the one-to-one equivalence:
1014
+ /// \code
1015
+ /// mat.template block<NRows,NCols>(i,j) <--> mat.block(i,j,fix<NRows>,fix<NCols>)
1016
+ /// \endcode
1017
+ ///
771
1018
  /// \note since block is a templated member, the keyword template has to be used
772
1019
  /// if the matrix type is also a template parameter: \code m.template block<3,3>(1,1); \endcode
773
1020
  ///
774
1021
  EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
775
1022
  ///
776
- /// \sa class Block, block(Index,Index,Index,Index)
1023
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
777
1024
  ///
778
1025
  template<int NRows, int NCols>
779
- EIGEN_DEVICE_FUNC
780
- inline typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol)
1026
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1027
+ typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol)
781
1028
  {
782
1029
  return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
783
1030
  }
784
1031
 
785
1032
  /// This is the const version of block<>(Index, Index). */
786
1033
  template<int NRows, int NCols>
787
- EIGEN_DEVICE_FUNC
788
- inline const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol) const
1034
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1035
+ const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol) const
789
1036
  {
790
1037
  return typename ConstFixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
791
1038
  }
792
1039
 
793
- /// \returns an expression of a block in *this.
1040
+ /// \returns an expression of a block of \c *this.
794
1041
  ///
795
1042
  /// \tparam NRows number of rows in block as specified at compile-time
796
1043
  /// \tparam NCols number of columns in block as specified at compile-time
@@ -805,14 +1052,25 @@ inline const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow
805
1052
  /// \a NRows is \a Dynamic, and the same for the number of columns.
806
1053
  ///
807
1054
  /// Example: \include MatrixBase_template_int_int_block_int_int_int_int.cpp
808
- /// Output: \verbinclude MatrixBase_template_int_int_block_int_int_int_int.cpp
1055
+ /// Output: \verbinclude MatrixBase_template_int_int_block_int_int_int_int.out
1056
+ ///
1057
+ /// \note The usage of of this overload is discouraged from %Eigen 3.4, better used the generic
1058
+ /// block(Index,Index,NRowsType,NColsType), here is the one-to-one complete equivalence:
1059
+ /// \code
1060
+ /// mat.template block<NRows,NCols>(i,j,rows,cols) <--> mat.block(i,j,fix<NRows>(rows),fix<NCols>(cols))
1061
+ /// \endcode
1062
+ /// If we known that, e.g., NRows==Dynamic and NCols!=Dynamic, then the equivalence becomes:
1063
+ /// \code
1064
+ /// mat.template block<Dynamic,NCols>(i,j,rows,NCols) <--> mat.block(i,j,rows,fix<NCols>)
1065
+ /// \endcode
809
1066
  ///
810
1067
  EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
811
1068
  ///
812
- /// \sa class Block, block(Index,Index,Index,Index)
1069
+ /// \sa block(Index,Index,NRowsType,NColsType), class Block
813
1070
  ///
814
1071
  template<int NRows, int NCols>
815
- inline typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
1072
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1073
+ typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
816
1074
  Index blockRows, Index blockCols)
817
1075
  {
818
1076
  return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
@@ -820,13 +1078,14 @@ inline typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index sta
820
1078
 
821
1079
  /// This is the const version of block<>(Index, Index, Index, Index).
822
1080
  template<int NRows, int NCols>
823
- inline const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
1081
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1082
+ const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
824
1083
  Index blockRows, Index blockCols) const
825
1084
  {
826
1085
  return typename ConstFixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
827
1086
  }
828
1087
 
829
- /// \returns an expression of the \a i-th column of *this. Note that the numbering starts at 0.
1088
+ /// \returns an expression of the \a i-th column of \c *this. Note that the numbering starts at 0.
830
1089
  ///
831
1090
  /// Example: \include MatrixBase_col.cpp
832
1091
  /// Output: \verbinclude MatrixBase_col.out
@@ -834,20 +1093,20 @@ inline const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow
834
1093
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
835
1094
  /**
836
1095
  * \sa row(), class Block */
837
- EIGEN_DEVICE_FUNC
838
- inline ColXpr col(Index i)
1096
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1097
+ ColXpr col(Index i)
839
1098
  {
840
1099
  return ColXpr(derived(), i);
841
1100
  }
842
1101
 
843
1102
  /// This is the const version of col().
844
- EIGEN_DEVICE_FUNC
845
- inline ConstColXpr col(Index i) const
1103
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1104
+ ConstColXpr col(Index i) const
846
1105
  {
847
1106
  return ConstColXpr(derived(), i);
848
1107
  }
849
1108
 
850
- /// \returns an expression of the \a i-th row of *this. Note that the numbering starts at 0.
1109
+ /// \returns an expression of the \a i-th row of \c *this. Note that the numbering starts at 0.
851
1110
  ///
852
1111
  /// Example: \include MatrixBase_row.cpp
853
1112
  /// Output: \verbinclude MatrixBase_row.out
@@ -855,109 +1114,166 @@ inline ConstColXpr col(Index i) const
855
1114
  EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
856
1115
  /**
857
1116
  * \sa col(), class Block */
858
- EIGEN_DEVICE_FUNC
859
- inline RowXpr row(Index i)
1117
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1118
+ RowXpr row(Index i)
860
1119
  {
861
1120
  return RowXpr(derived(), i);
862
1121
  }
863
1122
 
864
1123
  /// This is the const version of row(). */
865
- EIGEN_DEVICE_FUNC
866
- inline ConstRowXpr row(Index i) const
1124
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1125
+ ConstRowXpr row(Index i) const
867
1126
  {
868
1127
  return ConstRowXpr(derived(), i);
869
1128
  }
870
1129
 
871
- /// \returns a dynamic-size expression of a segment (i.e. a vector block) in *this.
1130
+ /// \returns an expression of a segment (i.e. a vector block) in \c *this with either dynamic or fixed sizes.
872
1131
  ///
873
1132
  /// \only_for_vectors
874
1133
  ///
875
1134
  /// \param start the first coefficient in the segment
876
1135
  /// \param n the number of coefficients in the segment
1136
+ /// \tparam NType the type of the value handling the number of coefficients in the segment, typically Index.
877
1137
  ///
878
1138
  /// Example: \include MatrixBase_segment_int_int.cpp
879
1139
  /// Output: \verbinclude MatrixBase_segment_int_int.out
880
1140
  ///
881
- /// \note Even though the returned expression has dynamic size, in the case
1141
+ /// The number of coefficients \a n can also be specified at compile-time by passing Eigen::fix<N>,
1142
+ /// or Eigen::fix<N>(n) as arguments.
1143
+ /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
1144
+ ///
1145
+ /// \note Even in the case that the returned expression has dynamic size, in the case
882
1146
  /// when it is applied to a fixed-size vector, it inherits a fixed maximal size,
883
1147
  /// which means that evaluating it does not cause a dynamic memory allocation.
884
1148
  ///
885
- /// \sa class Block, segment(Index)
1149
+ /// \sa block(Index,Index,NRowsType,NColsType), fix<N>, fix<N>(int), class Block
886
1150
  ///
887
- EIGEN_DEVICE_FUNC
888
- inline SegmentReturnType segment(Index start, Index n)
1151
+ template<typename NType>
1152
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1153
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
1154
+ typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1155
+ #else
1156
+ typename FixedSegmentReturnType<...>::Type
1157
+ #endif
1158
+ segment(Index start, NType n)
889
1159
  {
890
1160
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
891
- return SegmentReturnType(derived(), start, n);
1161
+ return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1162
+ (derived(), start, internal::get_runtime_value(n));
892
1163
  }
893
1164
 
894
1165
 
895
- /// This is the const version of segment(Index,Index).
896
- EIGEN_DEVICE_FUNC
897
- inline ConstSegmentReturnType segment(Index start, Index n) const
1166
+ /// This is the const version of segment(Index,NType).
1167
+ template<typename NType>
1168
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1169
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
1170
+ const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1171
+ #else
1172
+ const typename ConstFixedSegmentReturnType<...>::Type
1173
+ #endif
1174
+ segment(Index start, NType n) const
898
1175
  {
899
1176
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
900
- return ConstSegmentReturnType(derived(), start, n);
1177
+ return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1178
+ (derived(), start, internal::get_runtime_value(n));
901
1179
  }
902
1180
 
903
- /// \returns a dynamic-size expression of the first coefficients of *this.
1181
+ /// \returns an expression of the first coefficients of \c *this with either dynamic or fixed sizes.
904
1182
  ///
905
1183
  /// \only_for_vectors
906
1184
  ///
907
1185
  /// \param n the number of coefficients in the segment
1186
+ /// \tparam NType the type of the value handling the number of coefficients in the segment, typically Index.
908
1187
  ///
909
1188
  /// Example: \include MatrixBase_start_int.cpp
910
1189
  /// Output: \verbinclude MatrixBase_start_int.out
911
1190
  ///
912
- /// \note Even though the returned expression has dynamic size, in the case
1191
+ /// The number of coefficients \a n can also be specified at compile-time by passing Eigen::fix<N>,
1192
+ /// or Eigen::fix<N>(n) as arguments.
1193
+ /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
1194
+ ///
1195
+ /// \note Even in the case that the returned expression has dynamic size, in the case
913
1196
  /// when it is applied to a fixed-size vector, it inherits a fixed maximal size,
914
1197
  /// which means that evaluating it does not cause a dynamic memory allocation.
915
1198
  ///
916
1199
  /// \sa class Block, block(Index,Index)
917
1200
  ///
918
- EIGEN_DEVICE_FUNC
919
- inline SegmentReturnType head(Index n)
1201
+ template<typename NType>
1202
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1203
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
1204
+ typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1205
+ #else
1206
+ typename FixedSegmentReturnType<...>::Type
1207
+ #endif
1208
+ head(NType n)
920
1209
  {
921
1210
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
922
- return SegmentReturnType(derived(), 0, n);
1211
+ return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1212
+ (derived(), 0, internal::get_runtime_value(n));
923
1213
  }
924
1214
 
925
- /// This is the const version of head(Index).
926
- EIGEN_DEVICE_FUNC
927
- inline ConstSegmentReturnType head(Index n) const
1215
+ /// This is the const version of head(NType).
1216
+ template<typename NType>
1217
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1218
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
1219
+ const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1220
+ #else
1221
+ const typename ConstFixedSegmentReturnType<...>::Type
1222
+ #endif
1223
+ head(NType n) const
928
1224
  {
929
1225
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
930
- return ConstSegmentReturnType(derived(), 0, n);
1226
+ return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1227
+ (derived(), 0, internal::get_runtime_value(n));
931
1228
  }
932
1229
 
933
- /// \returns a dynamic-size expression of the last coefficients of *this.
1230
+ /// \returns an expression of a last coefficients of \c *this with either dynamic or fixed sizes.
934
1231
  ///
935
1232
  /// \only_for_vectors
936
1233
  ///
937
1234
  /// \param n the number of coefficients in the segment
1235
+ /// \tparam NType the type of the value handling the number of coefficients in the segment, typically Index.
938
1236
  ///
939
1237
  /// Example: \include MatrixBase_end_int.cpp
940
1238
  /// Output: \verbinclude MatrixBase_end_int.out
941
1239
  ///
942
- /// \note Even though the returned expression has dynamic size, in the case
1240
+ /// The number of coefficients \a n can also be specified at compile-time by passing Eigen::fix<N>,
1241
+ /// or Eigen::fix<N>(n) as arguments.
1242
+ /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
1243
+ ///
1244
+ /// \note Even in the case that the returned expression has dynamic size, in the case
943
1245
  /// when it is applied to a fixed-size vector, it inherits a fixed maximal size,
944
1246
  /// which means that evaluating it does not cause a dynamic memory allocation.
945
1247
  ///
946
1248
  /// \sa class Block, block(Index,Index)
947
1249
  ///
948
- EIGEN_DEVICE_FUNC
949
- inline SegmentReturnType tail(Index n)
1250
+ template<typename NType>
1251
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1252
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
1253
+ typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1254
+ #else
1255
+ typename FixedSegmentReturnType<...>::Type
1256
+ #endif
1257
+ tail(NType n)
950
1258
  {
951
1259
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
952
- return SegmentReturnType(derived(), this->size() - n, n);
1260
+ return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1261
+ (derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
953
1262
  }
954
1263
 
955
1264
  /// This is the const version of tail(Index).
956
- EIGEN_DEVICE_FUNC
957
- inline ConstSegmentReturnType tail(Index n) const
1265
+ template<typename NType>
1266
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1267
+ #ifndef EIGEN_PARSED_BY_DOXYGEN
1268
+ const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1269
+ #else
1270
+ const typename ConstFixedSegmentReturnType<...>::Type
1271
+ #endif
1272
+ tail(NType n) const
958
1273
  {
959
1274
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
960
- return ConstSegmentReturnType(derived(), this->size() - n, n);
1275
+ return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1276
+ (derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
961
1277
  }
962
1278
 
963
1279
  /// \returns a fixed-size expression of a segment (i.e. a vector block) in \c *this
@@ -974,11 +1290,11 @@ inline ConstSegmentReturnType tail(Index n) const
974
1290
  /// Example: \include MatrixBase_template_int_segment.cpp
975
1291
  /// Output: \verbinclude MatrixBase_template_int_segment.out
976
1292
  ///
977
- /// \sa class Block
1293
+ /// \sa segment(Index,NType), class Block
978
1294
  ///
979
1295
  template<int N>
980
- EIGEN_DEVICE_FUNC
981
- inline typename FixedSegmentReturnType<N>::Type segment(Index start, Index n = N)
1296
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1297
+ typename FixedSegmentReturnType<N>::Type segment(Index start, Index n = N)
982
1298
  {
983
1299
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
984
1300
  return typename FixedSegmentReturnType<N>::Type(derived(), start, n);
@@ -986,14 +1302,14 @@ inline typename FixedSegmentReturnType<N>::Type segment(Index start, Index n = N
986
1302
 
987
1303
  /// This is the const version of segment<int>(Index).
988
1304
  template<int N>
989
- EIGEN_DEVICE_FUNC
990
- inline typename ConstFixedSegmentReturnType<N>::Type segment(Index start, Index n = N) const
1305
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1306
+ typename ConstFixedSegmentReturnType<N>::Type segment(Index start, Index n = N) const
991
1307
  {
992
1308
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
993
1309
  return typename ConstFixedSegmentReturnType<N>::Type(derived(), start, n);
994
1310
  }
995
1311
 
996
- /// \returns a fixed-size expression of the first coefficients of *this.
1312
+ /// \returns a fixed-size expression of the first coefficients of \c *this.
997
1313
  ///
998
1314
  /// \only_for_vectors
999
1315
  ///
@@ -1006,11 +1322,11 @@ inline typename ConstFixedSegmentReturnType<N>::Type segment(Index start, Index
1006
1322
  /// Example: \include MatrixBase_template_int_start.cpp
1007
1323
  /// Output: \verbinclude MatrixBase_template_int_start.out
1008
1324
  ///
1009
- /// \sa class Block
1325
+ /// \sa head(NType), class Block
1010
1326
  ///
1011
1327
  template<int N>
1012
- EIGEN_DEVICE_FUNC
1013
- inline typename FixedSegmentReturnType<N>::Type head(Index n = N)
1328
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1329
+ typename FixedSegmentReturnType<N>::Type head(Index n = N)
1014
1330
  {
1015
1331
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1016
1332
  return typename FixedSegmentReturnType<N>::Type(derived(), 0, n);
@@ -1018,14 +1334,14 @@ inline typename FixedSegmentReturnType<N>::Type head(Index n = N)
1018
1334
 
1019
1335
  /// This is the const version of head<int>().
1020
1336
  template<int N>
1021
- EIGEN_DEVICE_FUNC
1022
- inline typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const
1337
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1338
+ typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const
1023
1339
  {
1024
1340
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1025
1341
  return typename ConstFixedSegmentReturnType<N>::Type(derived(), 0, n);
1026
1342
  }
1027
1343
 
1028
- /// \returns a fixed-size expression of the last coefficients of *this.
1344
+ /// \returns a fixed-size expression of the last coefficients of \c *this.
1029
1345
  ///
1030
1346
  /// \only_for_vectors
1031
1347
  ///
@@ -1038,11 +1354,11 @@ inline typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const
1038
1354
  /// Example: \include MatrixBase_template_int_end.cpp
1039
1355
  /// Output: \verbinclude MatrixBase_template_int_end.out
1040
1356
  ///
1041
- /// \sa class Block
1357
+ /// \sa tail(NType), class Block
1042
1358
  ///
1043
1359
  template<int N>
1044
- EIGEN_DEVICE_FUNC
1045
- inline typename FixedSegmentReturnType<N>::Type tail(Index n = N)
1360
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1361
+ typename FixedSegmentReturnType<N>::Type tail(Index n = N)
1046
1362
  {
1047
1363
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1048
1364
  return typename FixedSegmentReturnType<N>::Type(derived(), size() - n);
@@ -1050,9 +1366,77 @@ inline typename FixedSegmentReturnType<N>::Type tail(Index n = N)
1050
1366
 
1051
1367
  /// This is the const version of tail<int>.
1052
1368
  template<int N>
1053
- EIGEN_DEVICE_FUNC
1054
- inline typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const
1369
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1370
+ typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const
1055
1371
  {
1056
1372
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1057
1373
  return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n);
1058
1374
  }
1375
+
1376
+ /// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
1377
+ /// is col-major (resp. row-major).
1378
+ ///
1379
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1380
+ InnerVectorReturnType innerVector(Index outer)
1381
+ { return InnerVectorReturnType(derived(), outer); }
1382
+
1383
+ /// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
1384
+ /// is col-major (resp. row-major). Read-only.
1385
+ ///
1386
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1387
+ const ConstInnerVectorReturnType innerVector(Index outer) const
1388
+ { return ConstInnerVectorReturnType(derived(), outer); }
1389
+
1390
+ /// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
1391
+ /// is col-major (resp. row-major).
1392
+ ///
1393
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1394
+ InnerVectorsReturnType
1395
+ innerVectors(Index outerStart, Index outerSize)
1396
+ {
1397
+ return Block<Derived,Dynamic,Dynamic,true>(derived(),
1398
+ IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
1399
+ IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
1400
+
1401
+ }
1402
+
1403
+ /// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
1404
+ /// is col-major (resp. row-major). Read-only.
1405
+ ///
1406
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1407
+ const ConstInnerVectorsReturnType
1408
+ innerVectors(Index outerStart, Index outerSize) const
1409
+ {
1410
+ return Block<const Derived,Dynamic,Dynamic,true>(derived(),
1411
+ IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
1412
+ IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
1413
+
1414
+ }
1415
+
1416
+ /** \returns the i-th subvector (column or vector) according to the \c Direction
1417
+ * \sa subVectors()
1418
+ */
1419
+ template<DirectionType Direction>
1420
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1421
+ typename internal::conditional<Direction==Vertical,ColXpr,RowXpr>::type
1422
+ subVector(Index i)
1423
+ {
1424
+ return typename internal::conditional<Direction==Vertical,ColXpr,RowXpr>::type(derived(),i);
1425
+ }
1426
+
1427
+ /** This is the const version of subVector(Index) */
1428
+ template<DirectionType Direction>
1429
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1430
+ typename internal::conditional<Direction==Vertical,ConstColXpr,ConstRowXpr>::type
1431
+ subVector(Index i) const
1432
+ {
1433
+ return typename internal::conditional<Direction==Vertical,ConstColXpr,ConstRowXpr>::type(derived(),i);
1434
+ }
1435
+
1436
+ /** \returns the number of subvectors (rows or columns) in the direction \c Direction
1437
+ * \sa subVector(Index)
1438
+ */
1439
+ template<DirectionType Direction>
1440
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
1441
+ Index subVectors() const
1442
+ { return (Direction==Vertical)?cols():rows(); }