@smake/eigen 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (431) hide show
  1. package/README.md +1 -1
  2. package/eigen/Eigen/AccelerateSupport +52 -0
  3. package/eigen/Eigen/Cholesky +18 -20
  4. package/eigen/Eigen/CholmodSupport +28 -28
  5. package/eigen/Eigen/Core +187 -120
  6. package/eigen/Eigen/Eigenvalues +16 -13
  7. package/eigen/Eigen/Geometry +18 -18
  8. package/eigen/Eigen/Householder +9 -7
  9. package/eigen/Eigen/IterativeLinearSolvers +8 -4
  10. package/eigen/Eigen/Jacobi +14 -13
  11. package/eigen/Eigen/KLUSupport +23 -21
  12. package/eigen/Eigen/LU +15 -16
  13. package/eigen/Eigen/MetisSupport +12 -12
  14. package/eigen/Eigen/OrderingMethods +54 -51
  15. package/eigen/Eigen/PaStiXSupport +23 -21
  16. package/eigen/Eigen/PardisoSupport +17 -14
  17. package/eigen/Eigen/QR +18 -20
  18. package/eigen/Eigen/QtAlignedMalloc +5 -12
  19. package/eigen/Eigen/SPQRSupport +21 -14
  20. package/eigen/Eigen/SVD +23 -17
  21. package/eigen/Eigen/Sparse +1 -2
  22. package/eigen/Eigen/SparseCholesky +18 -15
  23. package/eigen/Eigen/SparseCore +18 -17
  24. package/eigen/Eigen/SparseLU +9 -9
  25. package/eigen/Eigen/SparseQR +16 -14
  26. package/eigen/Eigen/StdDeque +5 -2
  27. package/eigen/Eigen/StdList +5 -2
  28. package/eigen/Eigen/StdVector +5 -2
  29. package/eigen/Eigen/SuperLUSupport +30 -24
  30. package/eigen/Eigen/ThreadPool +80 -0
  31. package/eigen/Eigen/UmfPackSupport +19 -17
  32. package/eigen/Eigen/Version +14 -0
  33. package/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
  34. package/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
  35. package/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
  36. package/eigen/Eigen/src/Cholesky/LDLT.h +366 -405
  37. package/eigen/Eigen/src/Cholesky/LLT.h +323 -367
  38. package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
  39. package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +585 -529
  40. package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
  41. package/eigen/Eigen/src/Core/ArithmeticSequence.h +143 -317
  42. package/eigen/Eigen/src/Core/Array.h +329 -370
  43. package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
  44. package/eigen/Eigen/src/Core/ArrayWrapper.h +126 -170
  45. package/eigen/Eigen/src/Core/Assign.h +30 -40
  46. package/eigen/Eigen/src/Core/AssignEvaluator.h +651 -604
  47. package/eigen/Eigen/src/Core/Assign_MKL.h +125 -120
  48. package/eigen/Eigen/src/Core/BandMatrix.h +267 -282
  49. package/eigen/Eigen/src/Core/Block.h +371 -390
  50. package/eigen/Eigen/src/Core/CommaInitializer.h +85 -100
  51. package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
  52. package/eigen/Eigen/src/Core/CoreEvaluators.h +1214 -937
  53. package/eigen/Eigen/src/Core/CoreIterators.h +72 -63
  54. package/eigen/Eigen/src/Core/CwiseBinaryOp.h +112 -129
  55. package/eigen/Eigen/src/Core/CwiseNullaryOp.h +676 -702
  56. package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
  57. package/eigen/Eigen/src/Core/CwiseUnaryOp.h +55 -67
  58. package/eigen/Eigen/src/Core/CwiseUnaryView.h +127 -92
  59. package/eigen/Eigen/src/Core/DenseBase.h +630 -658
  60. package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -628
  61. package/eigen/Eigen/src/Core/DenseStorage.h +511 -590
  62. package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
  63. package/eigen/Eigen/src/Core/Diagonal.h +168 -207
  64. package/eigen/Eigen/src/Core/DiagonalMatrix.h +346 -317
  65. package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
  66. package/eigen/Eigen/src/Core/Dot.h +167 -217
  67. package/eigen/Eigen/src/Core/EigenBase.h +74 -85
  68. package/eigen/Eigen/src/Core/Fill.h +138 -0
  69. package/eigen/Eigen/src/Core/FindCoeff.h +464 -0
  70. package/eigen/Eigen/src/Core/ForceAlignedAccess.h +90 -113
  71. package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
  72. package/eigen/Eigen/src/Core/GeneralProduct.h +315 -261
  73. package/eigen/Eigen/src/Core/GenericPacketMath.h +1182 -520
  74. package/eigen/Eigen/src/Core/GlobalFunctions.h +193 -157
  75. package/eigen/Eigen/src/Core/IO.h +131 -156
  76. package/eigen/Eigen/src/Core/IndexedView.h +209 -125
  77. package/eigen/Eigen/src/Core/InnerProduct.h +260 -0
  78. package/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
  79. package/eigen/Eigen/src/Core/Inverse.h +50 -59
  80. package/eigen/Eigen/src/Core/Map.h +123 -141
  81. package/eigen/Eigen/src/Core/MapBase.h +255 -282
  82. package/eigen/Eigen/src/Core/MathFunctions.h +1247 -1201
  83. package/eigen/Eigen/src/Core/MathFunctionsImpl.h +162 -99
  84. package/eigen/Eigen/src/Core/Matrix.h +463 -494
  85. package/eigen/Eigen/src/Core/MatrixBase.h +468 -470
  86. package/eigen/Eigen/src/Core/NestByValue.h +58 -52
  87. package/eigen/Eigen/src/Core/NoAlias.h +79 -86
  88. package/eigen/Eigen/src/Core/NumTraits.h +206 -206
  89. package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +163 -142
  90. package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
  91. package/eigen/Eigen/src/Core/PlainObjectBase.h +858 -972
  92. package/eigen/Eigen/src/Core/Product.h +246 -130
  93. package/eigen/Eigen/src/Core/ProductEvaluators.h +779 -671
  94. package/eigen/Eigen/src/Core/Random.h +153 -164
  95. package/eigen/Eigen/src/Core/RandomImpl.h +262 -0
  96. package/eigen/Eigen/src/Core/RealView.h +250 -0
  97. package/eigen/Eigen/src/Core/Redux.h +334 -314
  98. package/eigen/Eigen/src/Core/Ref.h +259 -257
  99. package/eigen/Eigen/src/Core/Replicate.h +92 -104
  100. package/eigen/Eigen/src/Core/Reshaped.h +215 -271
  101. package/eigen/Eigen/src/Core/ReturnByValue.h +47 -55
  102. package/eigen/Eigen/src/Core/Reverse.h +133 -148
  103. package/eigen/Eigen/src/Core/Select.h +68 -140
  104. package/eigen/Eigen/src/Core/SelfAdjointView.h +254 -290
  105. package/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +23 -20
  106. package/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
  107. package/eigen/Eigen/src/Core/Solve.h +88 -102
  108. package/eigen/Eigen/src/Core/SolveTriangular.h +126 -124
  109. package/eigen/Eigen/src/Core/SolverBase.h +132 -133
  110. package/eigen/Eigen/src/Core/StableNorm.h +113 -147
  111. package/eigen/Eigen/src/Core/StlIterators.h +404 -248
  112. package/eigen/Eigen/src/Core/Stride.h +90 -92
  113. package/eigen/Eigen/src/Core/Swap.h +70 -39
  114. package/eigen/Eigen/src/Core/Transpose.h +258 -295
  115. package/eigen/Eigen/src/Core/Transpositions.h +270 -333
  116. package/eigen/Eigen/src/Core/TriangularMatrix.h +642 -743
  117. package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
  118. package/eigen/Eigen/src/Core/VectorwiseOp.h +653 -704
  119. package/eigen/Eigen/src/Core/Visitor.h +464 -308
  120. package/eigen/Eigen/src/Core/arch/AVX/Complex.h +380 -187
  121. package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +65 -163
  122. package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2145 -638
  123. package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
  124. package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +253 -60
  125. package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +278 -228
  126. package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
  127. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +48 -269
  128. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
  129. package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1597 -754
  130. package/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
  131. package/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
  132. package/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
  133. package/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
  134. package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +229 -41
  135. package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
  136. package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +420 -184
  137. package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +40 -49
  138. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2962 -2213
  139. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +196 -212
  140. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +713 -441
  141. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
  142. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
  143. package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2380 -1362
  144. package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
  145. package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +390 -224
  146. package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +78 -67
  147. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1784 -799
  148. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +167 -50
  149. package/eigen/Eigen/src/Core/arch/Default/Half.h +528 -379
  150. package/eigen/Eigen/src/Core/arch/Default/Settings.h +10 -12
  151. package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
  152. package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +41 -40
  153. package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +550 -523
  154. package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
  155. package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +27 -30
  156. package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +8 -8
  157. package/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
  158. package/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
  159. package/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
  160. package/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
  161. package/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
  162. package/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
  163. package/eigen/Eigen/src/Core/arch/MSA/Complex.h +54 -82
  164. package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +84 -92
  165. package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +51 -47
  166. package/eigen/Eigen/src/Core/arch/NEON/Complex.h +454 -306
  167. package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +175 -115
  168. package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +23 -30
  169. package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4366 -2857
  170. package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +616 -393
  171. package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
  172. package/eigen/Eigen/src/Core/arch/SSE/Complex.h +350 -198
  173. package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +38 -149
  174. package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +1791 -912
  175. package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
  176. package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +128 -40
  177. package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +10 -6
  178. package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +156 -234
  179. package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +6 -3
  180. package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +27 -32
  181. package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +119 -117
  182. package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +325 -419
  183. package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +15 -17
  184. package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +325 -181
  185. package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +94 -83
  186. package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +811 -458
  187. package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +121 -124
  188. package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +576 -370
  189. package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +194 -109
  190. package/eigen/Eigen/src/Core/functors/StlFunctors.h +95 -112
  191. package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
  192. package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1038 -749
  193. package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1883 -1375
  194. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +312 -370
  195. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +189 -176
  196. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +84 -81
  197. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
  198. package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +292 -337
  199. package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
  200. package/eigen/Eigen/src/Core/products/Parallelizer.h +207 -105
  201. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +327 -388
  202. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
  203. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +138 -147
  204. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +58 -61
  205. package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +71 -71
  206. package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +48 -47
  207. package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +294 -369
  208. package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +246 -238
  209. package/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +244 -247
  210. package/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +212 -192
  211. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +328 -277
  212. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
  213. package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +68 -94
  214. package/eigen/Eigen/src/Core/util/Assert.h +158 -0
  215. package/eigen/Eigen/src/Core/util/BlasUtil.h +342 -303
  216. package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +348 -317
  217. package/eigen/Eigen/src/Core/util/Constants.h +297 -262
  218. package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -90
  219. package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
  220. package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +449 -247
  221. package/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
  222. package/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
  223. package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +417 -116
  224. package/eigen/Eigen/src/Core/util/IntegralConstant.h +211 -204
  225. package/eigen/Eigen/src/Core/util/MKL_support.h +39 -37
  226. package/eigen/Eigen/src/Core/util/Macros.h +655 -773
  227. package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
  228. package/eigen/Eigen/src/Core/util/Memory.h +970 -748
  229. package/eigen/Eigen/src/Core/util/Meta.h +581 -633
  230. package/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
  231. package/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +32 -19
  232. package/eigen/Eigen/src/Core/util/ReshapedHelper.h +17 -17
  233. package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
  234. package/eigen/Eigen/src/Core/util/StaticAssert.h +50 -166
  235. package/eigen/Eigen/src/Core/util/SymbolicIndex.h +377 -225
  236. package/eigen/Eigen/src/Core/util/XprHelper.h +784 -547
  237. package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +246 -277
  238. package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +299 -319
  239. package/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +52 -48
  240. package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +413 -456
  241. package/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +309 -325
  242. package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +157 -171
  243. package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +292 -310
  244. package/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
  245. package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +89 -105
  246. package/eigen/Eigen/src/Eigenvalues/RealQZ.h +537 -607
  247. package/eigen/Eigen/src/Eigenvalues/RealSchur.h +342 -381
  248. package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
  249. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +541 -595
  250. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
  251. package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +430 -462
  252. package/eigen/Eigen/src/Geometry/AlignedBox.h +226 -227
  253. package/eigen/Eigen/src/Geometry/AngleAxis.h +131 -133
  254. package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
  255. package/eigen/Eigen/src/Geometry/Homogeneous.h +285 -333
  256. package/eigen/Eigen/src/Geometry/Hyperplane.h +151 -160
  257. package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
  258. package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -146
  259. package/eigen/Eigen/src/Geometry/ParametrizedLine.h +127 -127
  260. package/eigen/Eigen/src/Geometry/Quaternion.h +566 -506
  261. package/eigen/Eigen/src/Geometry/Rotation2D.h +107 -105
  262. package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
  263. package/eigen/Eigen/src/Geometry/Scaling.h +113 -106
  264. package/eigen/Eigen/src/Geometry/Transform.h +858 -936
  265. package/eigen/Eigen/src/Geometry/Translation.h +94 -92
  266. package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
  267. package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +90 -104
  268. package/eigen/Eigen/src/Householder/BlockHouseholder.h +51 -46
  269. package/eigen/Eigen/src/Householder/Householder.h +102 -124
  270. package/eigen/Eigen/src/Householder/HouseholderSequence.h +412 -453
  271. package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
  272. package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +149 -162
  273. package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +124 -119
  274. package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +92 -104
  275. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +251 -243
  276. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +224 -228
  277. package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
  278. package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +178 -227
  279. package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +79 -84
  280. package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +54 -60
  281. package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
  282. package/eigen/Eigen/src/Jacobi/Jacobi.h +252 -308
  283. package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
  284. package/eigen/Eigen/src/KLUSupport/KLUSupport.h +208 -227
  285. package/eigen/Eigen/src/LU/Determinant.h +50 -69
  286. package/eigen/Eigen/src/LU/FullPivLU.h +545 -596
  287. package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
  288. package/eigen/Eigen/src/LU/InverseImpl.h +206 -285
  289. package/eigen/Eigen/src/LU/PartialPivLU.h +390 -428
  290. package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
  291. package/eigen/Eigen/src/LU/arch/InverseSize4.h +72 -70
  292. package/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
  293. package/eigen/Eigen/src/MetisSupport/MetisSupport.h +81 -93
  294. package/eigen/Eigen/src/OrderingMethods/Amd.h +243 -265
  295. package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +831 -1004
  296. package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
  297. package/eigen/Eigen/src/OrderingMethods/Ordering.h +112 -119
  298. package/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
  299. package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +524 -570
  300. package/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
  301. package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +385 -430
  302. package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +479 -479
  303. package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
  304. package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +166 -153
  305. package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +495 -475
  306. package/eigen/Eigen/src/QR/HouseholderQR.h +394 -285
  307. package/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +32 -23
  308. package/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
  309. package/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
  310. package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +244 -264
  311. package/eigen/Eigen/src/SVD/BDCSVD.h +817 -713
  312. package/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
  313. package/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
  314. package/eigen/Eigen/src/SVD/JacobiSVD.h +577 -543
  315. package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
  316. package/eigen/Eigen/src/SVD/SVDBase.h +242 -182
  317. package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +200 -235
  318. package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
  319. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +765 -594
  320. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +308 -94
  321. package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
  322. package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -252
  323. package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +134 -178
  324. package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
  325. package/eigen/Eigen/src/SparseCore/SparseAssign.h +149 -140
  326. package/eigen/Eigen/src/SparseCore/SparseBlock.h +403 -440
  327. package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
  328. package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +525 -303
  329. package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +555 -339
  330. package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
  331. package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +169 -197
  332. package/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +71 -71
  333. package/eigen/Eigen/src/SparseCore/SparseDot.h +49 -47
  334. package/eigen/Eigen/src/SparseCore/SparseFuzzy.h +13 -11
  335. package/eigen/Eigen/src/SparseCore/SparseMap.h +243 -253
  336. package/eigen/Eigen/src/SparseCore/SparseMatrix.h +1603 -1245
  337. package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -350
  338. package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
  339. package/eigen/Eigen/src/SparseCore/SparseProduct.h +94 -97
  340. package/eigen/Eigen/src/SparseCore/SparseRedux.h +22 -24
  341. package/eigen/Eigen/src/SparseCore/SparseRef.h +268 -295
  342. package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +370 -416
  343. package/eigen/Eigen/src/SparseCore/SparseSolverBase.h +78 -87
  344. package/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +81 -95
  345. package/eigen/Eigen/src/SparseCore/SparseTranspose.h +62 -71
  346. package/eigen/Eigen/src/SparseCore/SparseTriangularView.h +132 -144
  347. package/eigen/Eigen/src/SparseCore/SparseUtil.h +138 -115
  348. package/eigen/Eigen/src/SparseCore/SparseVector.h +426 -372
  349. package/eigen/Eigen/src/SparseCore/SparseView.h +164 -193
  350. package/eigen/Eigen/src/SparseCore/TriangularSolver.h +129 -170
  351. package/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
  352. package/eigen/Eigen/src/SparseLU/SparseLU.h +756 -710
  353. package/eigen/Eigen/src/SparseLU/SparseLUImpl.h +61 -48
  354. package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +102 -118
  355. package/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +38 -35
  356. package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +245 -301
  357. package/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +44 -49
  358. package/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +104 -108
  359. package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +89 -100
  360. package/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +57 -58
  361. package/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +43 -55
  362. package/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +74 -71
  363. package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +124 -132
  364. package/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +136 -159
  365. package/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +51 -52
  366. package/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +67 -73
  367. package/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +24 -26
  368. package/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
  369. package/eigen/Eigen/src/SparseQR/SparseQR.h +450 -502
  370. package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -93
  371. package/eigen/Eigen/src/StlSupport/StdList.h +28 -84
  372. package/eigen/Eigen/src/StlSupport/StdVector.h +28 -108
  373. package/eigen/Eigen/src/StlSupport/details.h +48 -50
  374. package/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
  375. package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +634 -730
  376. package/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
  377. package/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
  378. package/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
  379. package/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
  380. package/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
  381. package/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
  382. package/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
  383. package/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
  384. package/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
  385. package/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
  386. package/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
  387. package/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
  388. package/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
  389. package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +428 -464
  390. package/eigen/Eigen/src/misc/Image.h +41 -43
  391. package/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
  392. package/eigen/Eigen/src/misc/Kernel.h +39 -41
  393. package/eigen/Eigen/src/misc/RealSvd2x2.h +19 -21
  394. package/eigen/Eigen/src/misc/blas.h +83 -426
  395. package/eigen/Eigen/src/misc/lapacke.h +9972 -16179
  396. package/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
  397. package/eigen/Eigen/src/misc/lapacke_mangling.h +4 -5
  398. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
  399. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
  400. package/eigen/Eigen/src/plugins/{BlockMethods.h → BlockMethods.inc} +434 -506
  401. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
  402. package/eigen/Eigen/src/plugins/{CommonCwiseUnaryOps.h → CommonCwiseUnaryOps.inc} +58 -68
  403. package/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
  404. package/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
  405. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
  406. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
  407. package/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
  408. package/package.json +1 -1
  409. package/eigen/COPYING.APACHE +0 -203
  410. package/eigen/COPYING.BSD +0 -26
  411. package/eigen/COPYING.GPL +0 -674
  412. package/eigen/COPYING.LGPL +0 -502
  413. package/eigen/COPYING.MINPACK +0 -51
  414. package/eigen/COPYING.MPL2 +0 -373
  415. package/eigen/COPYING.README +0 -18
  416. package/eigen/Eigen/src/Core/BooleanRedux.h +0 -162
  417. package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -258
  418. package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +0 -120
  419. package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +0 -694
  420. package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
  421. package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
  422. package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
  423. package/eigen/Eigen/src/misc/lapack.h +0 -152
  424. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -358
  425. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -696
  426. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
  427. package/eigen/Eigen/src/plugins/IndexedViewMethods.h +0 -262
  428. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
  429. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -95
  430. package/eigen/Eigen/src/plugins/ReshapedMethods.h +0 -149
  431. package/eigen/README.md +0 -5
@@ -10,18 +10,18 @@
10
10
  #ifndef EIGEN_CWISE_NULLARY_OP_H
11
11
  #define EIGEN_CWISE_NULLARY_OP_H
12
12
 
13
+ // IWYU pragma: private
14
+ #include "./InternalHeaderCheck.h"
15
+
13
16
  namespace Eigen {
14
17
 
15
18
  namespace internal {
16
- template<typename NullaryOp, typename PlainObjectType>
17
- struct traits<CwiseNullaryOp<NullaryOp, PlainObjectType> > : traits<PlainObjectType>
18
- {
19
- enum {
20
- Flags = traits<PlainObjectType>::Flags & RowMajorBit
21
- };
19
+ template <typename NullaryOp, typename PlainObjectType>
20
+ struct traits<CwiseNullaryOp<NullaryOp, PlainObjectType> > : traits<PlainObjectType> {
21
+ enum { Flags = traits<PlainObjectType>::Flags & RowMajorBit };
22
22
  };
23
23
 
24
- } // namespace internal
24
+ } // namespace internal
25
25
 
26
26
  /** \class CwiseNullaryOp
27
27
  * \ingroup Core_Module
@@ -40,11 +40,14 @@ struct traits<CwiseNullaryOp<NullaryOp, PlainObjectType> > : traits<PlainObjectT
40
40
  *
41
41
  * The functor NullaryOp must expose one of the following method:
42
42
  <table class="manual">
43
- <tr ><td>\c operator()() </td><td>if the procedural generation does not depend on the coefficient entries (e.g., random numbers)</td></tr>
44
- <tr class="alt"><td>\c operator()(Index i)</td><td>if the procedural generation makes sense for vectors only and that it depends on the coefficient index \c i (e.g., linspace) </td></tr>
45
- <tr ><td>\c operator()(Index i,Index j)</td><td>if the procedural generation depends on the matrix coordinates \c i, \c j (e.g., to generate a checkerboard with 0 and 1)</td></tr>
43
+ <tr ><td>\c operator()() </td><td>if the procedural generation does not depend on the coefficient entries
44
+ (e.g., random numbers)</td></tr> <tr class="alt"><td>\c operator()(Index i)</td><td>if the procedural generation makes
45
+ sense for vectors only and that it depends on the coefficient index \c i (e.g., linspace) </td></tr> <tr ><td>\c
46
+ operator()(Index i,Index j)</td><td>if the procedural generation depends on the matrix coordinates \c i, \c j (e.g.,
47
+ to generate a checkerboard with 0 and 1)</td></tr>
46
48
  </table>
47
- * It is also possible to expose the last two operators if the generation makes sense for matrices but can be optimized for vectors.
49
+ * It is also possible to expose the last two operators if the generation makes sense for matrices but can be optimized
50
+ for vectors.
48
51
  *
49
52
  * See DenseBase::NullaryExpr(Index,const CustomNullaryOp&) for an example binding
50
53
  * C++11 random number generators.
@@ -56,779 +59,752 @@ struct traits<CwiseNullaryOp<NullaryOp, PlainObjectType> > : traits<PlainObjectT
56
59
  *
57
60
  * \sa class CwiseUnaryOp, class CwiseBinaryOp, DenseBase::NullaryExpr
58
61
  */
59
- template<typename NullaryOp, typename PlainObjectType>
60
- class CwiseNullaryOp : public internal::dense_xpr_base< CwiseNullaryOp<NullaryOp, PlainObjectType> >::type, internal::no_assignment_operator
61
- {
62
- public:
63
-
64
- typedef typename internal::dense_xpr_base<CwiseNullaryOp>::type Base;
65
- EIGEN_DENSE_PUBLIC_INTERFACE(CwiseNullaryOp)
66
-
67
- EIGEN_DEVICE_FUNC
68
- CwiseNullaryOp(Index rows, Index cols, const NullaryOp& func = NullaryOp())
69
- : m_rows(rows), m_cols(cols), m_functor(func)
70
- {
71
- eigen_assert(rows >= 0
72
- && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows)
73
- && cols >= 0
74
- && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols));
75
- }
62
+ template <typename NullaryOp, typename PlainObjectType>
63
+ class CwiseNullaryOp : public internal::dense_xpr_base<CwiseNullaryOp<NullaryOp, PlainObjectType> >::type,
64
+ internal::no_assignment_operator {
65
+ public:
66
+ typedef typename internal::dense_xpr_base<CwiseNullaryOp>::type Base;
67
+ EIGEN_DENSE_PUBLIC_INTERFACE(CwiseNullaryOp)
68
+
69
+ EIGEN_DEVICE_FUNC CwiseNullaryOp(Index rows, Index cols, const NullaryOp& func = NullaryOp())
70
+ : m_rows(rows), m_cols(cols), m_functor(func) {
71
+ eigen_assert(rows >= 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows) && cols >= 0 &&
72
+ (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols));
73
+ }
74
+ EIGEN_DEVICE_FUNC CwiseNullaryOp(Index size, const NullaryOp& func = NullaryOp())
75
+ : CwiseNullaryOp(RowsAtCompileTime == 1 ? 1 : size, RowsAtCompileTime == 1 ? size : 1, func) {
76
+ EIGEN_STATIC_ASSERT(CwiseNullaryOp::IsVectorAtCompileTime, YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
77
+ }
76
78
 
77
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
78
- Index rows() const { return m_rows.value(); }
79
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
80
- Index cols() const { return m_cols.value(); }
79
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return m_rows.value(); }
80
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return m_cols.value(); }
81
81
 
82
- /** \returns the functor representing the nullary operation */
83
- EIGEN_DEVICE_FUNC
84
- const NullaryOp& functor() const { return m_functor; }
82
+ /** \returns the functor representing the nullary operation */
83
+ EIGEN_DEVICE_FUNC const NullaryOp& functor() const { return m_functor; }
85
84
 
86
- protected:
87
- const internal::variable_if_dynamic<Index, RowsAtCompileTime> m_rows;
88
- const internal::variable_if_dynamic<Index, ColsAtCompileTime> m_cols;
89
- const NullaryOp m_functor;
85
+ protected:
86
+ const internal::variable_if_dynamic<Index, RowsAtCompileTime> m_rows;
87
+ const internal::variable_if_dynamic<Index, ColsAtCompileTime> m_cols;
88
+ const NullaryOp m_functor;
90
89
  };
91
90
 
92
-
93
91
  /** \returns an expression of a matrix defined by a custom functor \a func
94
- *
95
- * The parameters \a rows and \a cols are the number of rows and of columns of
96
- * the returned matrix. Must be compatible with this MatrixBase type.
97
- *
98
- * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
99
- * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used
100
- * instead.
101
- *
102
- * The template parameter \a CustomNullaryOp is the type of the functor.
103
- *
104
- * \sa class CwiseNullaryOp
105
- */
106
- template<typename Derived>
107
- template<typename CustomNullaryOp>
92
+ *
93
+ * The parameters \a rows and \a cols are the number of rows and of columns of
94
+ * the returned matrix. Must be compatible with this MatrixBase type.
95
+ *
96
+ * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
97
+ * it is redundant to pass \a rows and \a cols as arguments, so NullaryExpr(const CustomNullaryOp&) should be used
98
+ * instead.
99
+ *
100
+ * The template parameter \a CustomNullaryOp is the type of the functor.
101
+ *
102
+ * \sa class CwiseNullaryOp
103
+ */
104
+ template <typename Derived>
105
+ template <typename CustomNullaryOp>
108
106
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
109
107
  #ifndef EIGEN_PARSED_BY_DOXYGEN
110
- const CwiseNullaryOp<CustomNullaryOp,typename DenseBase<Derived>::PlainObject>
108
+ const CwiseNullaryOp<CustomNullaryOp, typename DenseBase<Derived>::PlainObject>
111
109
  #else
112
- const CwiseNullaryOp<CustomNullaryOp,PlainObject>
110
+ const CwiseNullaryOp<CustomNullaryOp, PlainObject>
113
111
  #endif
114
- DenseBase<Derived>::NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func)
115
- {
112
+ DenseBase<Derived>::NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func) {
116
113
  return CwiseNullaryOp<CustomNullaryOp, PlainObject>(rows, cols, func);
117
114
  }
118
115
 
119
116
  /** \returns an expression of a matrix defined by a custom functor \a func
120
- *
121
- * The parameter \a size is the size of the returned vector.
122
- * Must be compatible with this MatrixBase type.
123
- *
124
- * \only_for_vectors
125
- *
126
- * This variant is meant to be used for dynamic-size vector types. For fixed-size types,
127
- * it is redundant to pass \a size as argument, so Zero() should be used
128
- * instead.
129
- *
130
- * The template parameter \a CustomNullaryOp is the type of the functor.
131
- *
132
- * Here is an example with C++11 random generators: \include random_cpp11.cpp
133
- * Output: \verbinclude random_cpp11.out
134
- *
135
- * \sa class CwiseNullaryOp
136
- */
137
- template<typename Derived>
138
- template<typename CustomNullaryOp>
117
+ *
118
+ * The parameter \a size is the size of the returned vector.
119
+ * Must be compatible with this MatrixBase type.
120
+ *
121
+ * \only_for_vectors
122
+ *
123
+ * This variant is meant to be used for dynamic-size vector types. For fixed-size types,
124
+ * it is redundant to pass \a size as argument, so NullaryExpr(const CustomNullaryOp&) should be used
125
+ * instead.
126
+ *
127
+ * The template parameter \a CustomNullaryOp is the type of the functor.
128
+ *
129
+ * Here is an example with C++11 random generators: \include random_cpp11.cpp
130
+ * Output: \verbinclude random_cpp11.out
131
+ *
132
+ * \sa class CwiseNullaryOp
133
+ */
134
+ template <typename Derived>
135
+ template <typename CustomNullaryOp>
139
136
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
140
137
  #ifndef EIGEN_PARSED_BY_DOXYGEN
141
- const CwiseNullaryOp<CustomNullaryOp, typename DenseBase<Derived>::PlainObject>
138
+ const CwiseNullaryOp<CustomNullaryOp, typename DenseBase<Derived>::PlainObject>
142
139
  #else
143
- const CwiseNullaryOp<CustomNullaryOp, PlainObject>
140
+ const CwiseNullaryOp<CustomNullaryOp, PlainObject>
144
141
  #endif
145
- DenseBase<Derived>::NullaryExpr(Index size, const CustomNullaryOp& func)
146
- {
142
+ DenseBase<Derived>::NullaryExpr(Index size, const CustomNullaryOp& func) {
147
143
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
148
- if(RowsAtCompileTime == 1) return CwiseNullaryOp<CustomNullaryOp, PlainObject>(1, size, func);
149
- else return CwiseNullaryOp<CustomNullaryOp, PlainObject>(size, 1, func);
144
+ if (RowsAtCompileTime == 1)
145
+ return CwiseNullaryOp<CustomNullaryOp, PlainObject>(1, size, func);
146
+ else
147
+ return CwiseNullaryOp<CustomNullaryOp, PlainObject>(size, 1, func);
150
148
  }
151
149
 
152
150
  /** \returns an expression of a matrix defined by a custom functor \a func
153
- *
154
- * This variant is only for fixed-size DenseBase types. For dynamic-size types, you
155
- * need to use the variants taking size arguments.
156
- *
157
- * The template parameter \a CustomNullaryOp is the type of the functor.
158
- *
159
- * \sa class CwiseNullaryOp
160
- */
161
- template<typename Derived>
162
- template<typename CustomNullaryOp>
151
+ *
152
+ * This variant is only for fixed-size DenseBase types. For dynamic-size types, you
153
+ * need to use the variants taking size arguments.
154
+ *
155
+ * The template parameter \a CustomNullaryOp is the type of the functor.
156
+ *
157
+ * \sa class CwiseNullaryOp
158
+ */
159
+ template <typename Derived>
160
+ template <typename CustomNullaryOp>
163
161
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
164
162
  #ifndef EIGEN_PARSED_BY_DOXYGEN
165
- const CwiseNullaryOp<CustomNullaryOp, typename DenseBase<Derived>::PlainObject>
163
+ const CwiseNullaryOp<CustomNullaryOp, typename DenseBase<Derived>::PlainObject>
166
164
  #else
167
- const CwiseNullaryOp<CustomNullaryOp, PlainObject>
165
+ const CwiseNullaryOp<CustomNullaryOp, PlainObject>
168
166
  #endif
169
- DenseBase<Derived>::NullaryExpr(const CustomNullaryOp& func)
170
- {
167
+ DenseBase<Derived>::NullaryExpr(const CustomNullaryOp& func) {
171
168
  return CwiseNullaryOp<CustomNullaryOp, PlainObject>(RowsAtCompileTime, ColsAtCompileTime, func);
172
169
  }
173
170
 
174
171
  /** \returns an expression of a constant matrix of value \a value
175
- *
176
- * The parameters \a rows and \a cols are the number of rows and of columns of
177
- * the returned matrix. Must be compatible with this DenseBase type.
178
- *
179
- * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
180
- * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used
181
- * instead.
182
- *
183
- * The template parameter \a CustomNullaryOp is the type of the functor.
184
- *
185
- * \sa class CwiseNullaryOp
186
- */
187
- template<typename Derived>
172
+ *
173
+ * The parameters \a rows and \a cols are the number of rows and of columns of
174
+ * the returned matrix. Must be compatible with this DenseBase type.
175
+ *
176
+ * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
177
+ * it is redundant to pass \a rows and \a cols as arguments, so Constant(const Scalar&) should be used
178
+ * instead.
179
+ *
180
+ * The template parameter \a CustomNullaryOp is the type of the functor.
181
+ *
182
+ * \sa class CwiseNullaryOp
183
+ */
184
+ template <typename Derived>
188
185
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType
189
- DenseBase<Derived>::Constant(Index rows, Index cols, const Scalar& value)
190
- {
186
+ DenseBase<Derived>::Constant(Index rows, Index cols, const Scalar& value) {
191
187
  return DenseBase<Derived>::NullaryExpr(rows, cols, internal::scalar_constant_op<Scalar>(value));
192
188
  }
193
189
 
194
190
  /** \returns an expression of a constant matrix of value \a value
195
- *
196
- * The parameter \a size is the size of the returned vector.
197
- * Must be compatible with this DenseBase type.
198
- *
199
- * \only_for_vectors
200
- *
201
- * This variant is meant to be used for dynamic-size vector types. For fixed-size types,
202
- * it is redundant to pass \a size as argument, so Zero() should be used
203
- * instead.
204
- *
205
- * The template parameter \a CustomNullaryOp is the type of the functor.
206
- *
207
- * \sa class CwiseNullaryOp
208
- */
209
- template<typename Derived>
191
+ *
192
+ * The parameter \a size is the size of the returned vector.
193
+ * Must be compatible with this DenseBase type.
194
+ *
195
+ * \only_for_vectors
196
+ *
197
+ * This variant is meant to be used for dynamic-size vector types. For fixed-size types,
198
+ * it is redundant to pass \a size as argument, so Constant(const Scalar&) should be used
199
+ * instead.
200
+ *
201
+ * The template parameter \a CustomNullaryOp is the type of the functor.
202
+ *
203
+ * \sa class CwiseNullaryOp
204
+ */
205
+ template <typename Derived>
210
206
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType
211
- DenseBase<Derived>::Constant(Index size, const Scalar& value)
212
- {
207
+ DenseBase<Derived>::Constant(Index size, const Scalar& value) {
213
208
  return DenseBase<Derived>::NullaryExpr(size, internal::scalar_constant_op<Scalar>(value));
214
209
  }
215
210
 
216
211
  /** \returns an expression of a constant matrix of value \a value
217
- *
218
- * This variant is only for fixed-size DenseBase types. For dynamic-size types, you
219
- * need to use the variants taking size arguments.
220
- *
221
- * The template parameter \a CustomNullaryOp is the type of the functor.
222
- *
223
- * \sa class CwiseNullaryOp
224
- */
225
- template<typename Derived>
212
+ *
213
+ * This variant is only for fixed-size DenseBase types. For dynamic-size types, you
214
+ * need to use the variants taking size arguments.
215
+ *
216
+ * The template parameter \a CustomNullaryOp is the type of the functor.
217
+ *
218
+ * \sa class CwiseNullaryOp
219
+ */
220
+ template <typename Derived>
226
221
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType
227
- DenseBase<Derived>::Constant(const Scalar& value)
228
- {
222
+ DenseBase<Derived>::Constant(const Scalar& value) {
229
223
  EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived)
230
- return DenseBase<Derived>::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_constant_op<Scalar>(value));
224
+ return DenseBase<Derived>::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime,
225
+ internal::scalar_constant_op<Scalar>(value));
231
226
  }
232
227
 
233
228
  /** \deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(Index,const Scalar&,const Scalar&)
234
- *
235
- * \only_for_vectors
236
- *
237
- * Example: \include DenseBase_LinSpaced_seq_deprecated.cpp
238
- * Output: \verbinclude DenseBase_LinSpaced_seq_deprecated.out
239
- *
240
- * \sa LinSpaced(Index,const Scalar&, const Scalar&), setLinSpaced(Index,const Scalar&,const Scalar&)
241
- */
242
- template<typename Derived>
243
- EIGEN_DEPRECATED EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::RandomAccessLinSpacedReturnType
244
- DenseBase<Derived>::LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high)
245
- {
229
+ *
230
+ * \only_for_vectors
231
+ *
232
+ * Example: \include DenseBase_LinSpaced_seq_deprecated.cpp
233
+ * Output: \verbinclude DenseBase_LinSpaced_seq_deprecated.out
234
+ *
235
+ * \sa LinSpaced(Index,const Scalar&, const Scalar&), setLinSpaced(Index,const Scalar&,const Scalar&)
236
+ */
237
+ template <typename Derived>
238
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::RandomAccessLinSpacedReturnType
239
+ DenseBase<Derived>::LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high) {
246
240
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
247
- return DenseBase<Derived>::NullaryExpr(size, internal::linspaced_op<Scalar>(low,high,size));
241
+ return DenseBase<Derived>::NullaryExpr(size, internal::linspaced_op<Scalar>(low, high, size));
248
242
  }
249
243
 
250
244
  /** \deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(const Scalar&,const Scalar&)
251
- *
252
- * \sa LinSpaced(const Scalar&, const Scalar&)
253
- */
254
- template<typename Derived>
255
- EIGEN_DEPRECATED EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::RandomAccessLinSpacedReturnType
256
- DenseBase<Derived>::LinSpaced(Sequential_t, const Scalar& low, const Scalar& high)
257
- {
245
+ *
246
+ * \sa LinSpaced(const Scalar&, const Scalar&)
247
+ */
248
+ template <typename Derived>
249
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::RandomAccessLinSpacedReturnType
250
+ DenseBase<Derived>::LinSpaced(Sequential_t, const Scalar& low, const Scalar& high) {
258
251
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
259
252
  EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived)
260
- return DenseBase<Derived>::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op<Scalar>(low,high,Derived::SizeAtCompileTime));
253
+ return DenseBase<Derived>::NullaryExpr(Derived::SizeAtCompileTime,
254
+ internal::linspaced_op<Scalar>(low, high, Derived::SizeAtCompileTime));
261
255
  }
262
256
 
263
257
  /**
264
- * \brief Sets a linearly spaced vector.
265
- *
266
- * The function generates 'size' equally spaced values in the closed interval [low,high].
267
- * When size is set to 1, a vector of length 1 containing 'high' is returned.
268
- *
269
- * \only_for_vectors
270
- *
271
- * Example: \include DenseBase_LinSpaced.cpp
272
- * Output: \verbinclude DenseBase_LinSpaced.out
273
- *
274
- * For integer scalar types, an even spacing is possible if and only if the length of the range,
275
- * i.e., \c high-low is a scalar multiple of \c size-1, or if \c size is a scalar multiple of the
276
- * number of values \c high-low+1 (meaning each value can be repeated the same number of time).
277
- * If one of these two considions is not satisfied, then \c high is lowered to the largest value
278
- * satisfying one of this constraint.
279
- * Here are some examples:
280
- *
281
- * Example: \include DenseBase_LinSpacedInt.cpp
282
- * Output: \verbinclude DenseBase_LinSpacedInt.out
283
- *
284
- * \sa setLinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp
285
- */
286
- template<typename Derived>
258
+ * \brief Sets a linearly spaced vector.
259
+ *
260
+ * The function generates 'size' equally spaced values in the closed interval [low,high].
261
+ * When size is set to 1, a vector of length 1 containing 'high' is returned.
262
+ *
263
+ * \only_for_vectors
264
+ *
265
+ * Example: \include DenseBase_LinSpaced.cpp
266
+ * Output: \verbinclude DenseBase_LinSpaced.out
267
+ *
268
+ * For integer scalar types, an even spacing is possible if and only if the length of the range,
269
+ * i.e., \c high-low is a scalar multiple of \c size-1, or if \c size is a scalar multiple of the
270
+ * number of values \c high-low+1 (meaning each value can be repeated the same number of time).
271
+ * If one of these two considions is not satisfied, then \c high is lowered to the largest value
272
+ * satisfying one of this constraint.
273
+ * Here are some examples:
274
+ *
275
+ * Example: \include DenseBase_LinSpacedInt.cpp
276
+ * Output: \verbinclude DenseBase_LinSpacedInt.out
277
+ *
278
+ * \sa setLinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp
279
+ */
280
+ template <typename Derived>
287
281
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::RandomAccessLinSpacedReturnType
288
- DenseBase<Derived>::LinSpaced(Index size, const Scalar& low, const Scalar& high)
289
- {
282
+ DenseBase<Derived>::LinSpaced(Index size, const Scalar& low, const Scalar& high) {
290
283
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
291
- return DenseBase<Derived>::NullaryExpr(size, internal::linspaced_op<Scalar>(low,high,size));
284
+ return DenseBase<Derived>::NullaryExpr(size, internal::linspaced_op<Scalar>(low, high, size));
292
285
  }
293
286
 
294
287
  /**
295
- * \copydoc DenseBase::LinSpaced(Index, const Scalar&, const Scalar&)
296
- * Special version for fixed size types which does not require the size parameter.
297
- */
298
- template<typename Derived>
288
+ * \copydoc DenseBase::LinSpaced(Index, const DenseBase::Scalar&, const DenseBase::Scalar&)
289
+ * Special version for fixed size types which does not require the size parameter.
290
+ */
291
+ template <typename Derived>
299
292
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::RandomAccessLinSpacedReturnType
300
- DenseBase<Derived>::LinSpaced(const Scalar& low, const Scalar& high)
301
- {
293
+ DenseBase<Derived>::LinSpaced(const Scalar& low, const Scalar& high) {
302
294
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
303
295
  EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived)
304
- return DenseBase<Derived>::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op<Scalar>(low,high,Derived::SizeAtCompileTime));
296
+ return DenseBase<Derived>::NullaryExpr(Derived::SizeAtCompileTime,
297
+ internal::linspaced_op<Scalar>(low, high, Derived::SizeAtCompileTime));
298
+ }
299
+
300
+ template <typename Derived>
301
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::RandomAccessEqualSpacedReturnType
302
+ DenseBase<Derived>::EqualSpaced(Index size, const Scalar& low, const Scalar& step) {
303
+ EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
304
+ return DenseBase<Derived>::NullaryExpr(size, internal::equalspaced_op<Scalar>(low, step));
305
+ }
306
+
307
+ template <typename Derived>
308
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::RandomAccessEqualSpacedReturnType
309
+ DenseBase<Derived>::EqualSpaced(const Scalar& low, const Scalar& step) {
310
+ EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
311
+ return DenseBase<Derived>::NullaryExpr(Derived::SizeAtCompileTime, internal::equalspaced_op<Scalar>(low, step));
305
312
  }
306
313
 
307
314
  /** \returns true if all coefficients in this matrix are approximately equal to \a val, to within precision \a prec */
308
- template<typename Derived>
309
- EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isApproxToConstant
310
- (const Scalar& val, const RealScalar& prec) const
311
- {
312
- typename internal::nested_eval<Derived,1>::type self(derived());
313
- for(Index j = 0; j < cols(); ++j)
314
- for(Index i = 0; i < rows(); ++i)
315
- if(!internal::isApprox(self.coeff(i, j), val, prec))
316
- return false;
315
+ template <typename Derived>
316
+ EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isApproxToConstant(const Scalar& val, const RealScalar& prec) const {
317
+ typename internal::nested_eval<Derived, 1>::type self(derived());
318
+ for (Index j = 0; j < cols(); ++j)
319
+ for (Index i = 0; i < rows(); ++i)
320
+ if (!internal::isApprox(self.coeff(i, j), val, prec)) return false;
317
321
  return true;
318
322
  }
319
323
 
320
324
  /** This is just an alias for isApproxToConstant().
321
- *
322
- * \returns true if all coefficients in this matrix are approximately equal to \a value, to within precision \a prec */
323
- template<typename Derived>
324
- EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isConstant
325
- (const Scalar& val, const RealScalar& prec) const
326
- {
325
+ *
326
+ * \returns true if all coefficients in this matrix are approximately equal to \a value, to within precision \a prec */
327
+ template <typename Derived>
328
+ EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isConstant(const Scalar& val, const RealScalar& prec) const {
327
329
  return isApproxToConstant(val, prec);
328
330
  }
329
331
 
330
332
  /** Alias for setConstant(): sets all coefficients in this expression to \a val.
331
- *
332
- * \sa setConstant(), Constant(), class CwiseNullaryOp
333
- */
334
- template<typename Derived>
335
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void DenseBase<Derived>::fill(const Scalar& val)
336
- {
333
+ *
334
+ * \sa setConstant(), Constant(), class CwiseNullaryOp
335
+ */
336
+ template <typename Derived>
337
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void DenseBase<Derived>::fill(const Scalar& val) {
337
338
  setConstant(val);
338
339
  }
339
340
 
340
341
  /** Sets all coefficients in this expression to value \a val.
341
- *
342
- * \sa fill(), setConstant(Index,const Scalar&), setConstant(Index,Index,const Scalar&), setZero(), setOnes(), Constant(), class CwiseNullaryOp, setZero(), setOnes()
343
- */
344
- template<typename Derived>
345
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setConstant(const Scalar& val)
346
- {
347
- return derived() = Constant(rows(), cols(), val);
342
+ *
343
+ * \sa fill(), setConstant(Index,const Scalar&), setConstant(Index,Index,const Scalar&), setZero(), setOnes(),
344
+ * Constant(), class CwiseNullaryOp, setZero(), setOnes()
345
+ */
346
+ template <typename Derived>
347
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setConstant(const Scalar& val) {
348
+ internal::eigen_fill_impl<Derived>::run(derived(), val);
349
+ return derived();
348
350
  }
349
351
 
350
352
  /** Resizes to the given \a size, and sets all coefficients in this expression to the given value \a val.
351
- *
352
- * \only_for_vectors
353
- *
354
- * Example: \include Matrix_setConstant_int.cpp
355
- * Output: \verbinclude Matrix_setConstant_int.out
356
- *
357
- * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&)
358
- */
359
- template<typename Derived>
360
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
361
- PlainObjectBase<Derived>::setConstant(Index size, const Scalar& val)
362
- {
353
+ *
354
+ * \only_for_vectors
355
+ *
356
+ * Example: \include Matrix_setConstant_int.cpp
357
+ * Output: \verbinclude Matrix_setConstant_int.out
358
+ *
359
+ * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,Index,const Scalar&), class CwiseNullaryOp,
360
+ * MatrixBase::Constant(const Scalar&)
361
+ */
362
+ template <typename Derived>
363
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setConstant(Index size, const Scalar& val) {
363
364
  resize(size);
364
365
  return setConstant(val);
365
366
  }
366
367
 
367
368
  /** Resizes to the given size, and sets all coefficients in this expression to the given value \a val.
368
- *
369
- * \param rows the new number of rows
370
- * \param cols the new number of columns
371
- * \param val the value to which all coefficients are set
372
- *
373
- * Example: \include Matrix_setConstant_int_int.cpp
374
- * Output: \verbinclude Matrix_setConstant_int_int.out
375
- *
376
- * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&)
377
- */
378
- template<typename Derived>
379
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
380
- PlainObjectBase<Derived>::setConstant(Index rows, Index cols, const Scalar& val)
381
- {
369
+ *
370
+ * \param rows the new number of rows
371
+ * \param cols the new number of columns
372
+ * \param val the value to which all coefficients are set
373
+ *
374
+ * Example: \include Matrix_setConstant_int_int.cpp
375
+ * Output: \verbinclude Matrix_setConstant_int_int.out
376
+ *
377
+ * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp,
378
+ * MatrixBase::Constant(const Scalar&)
379
+ */
380
+ template <typename Derived>
381
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setConstant(Index rows, Index cols,
382
+ const Scalar& val) {
382
383
  resize(rows, cols);
383
384
  return setConstant(val);
384
385
  }
385
386
 
386
387
  /** Resizes to the given size, changing only the number of columns, and sets all
387
- * coefficients in this expression to the given value \a val. For the parameter
388
- * of type NoChange_t, just pass the special value \c NoChange.
389
- *
390
- * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&)
391
- */
392
- template<typename Derived>
393
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
394
- PlainObjectBase<Derived>::setConstant(NoChange_t, Index cols, const Scalar& val)
395
- {
388
+ * coefficients in this expression to the given value \a val. For the parameter
389
+ * of type NoChange_t, just pass the special value \c NoChange.
390
+ *
391
+ * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp,
392
+ * MatrixBase::Constant(const Scalar&)
393
+ */
394
+ template <typename Derived>
395
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setConstant(NoChange_t, Index cols,
396
+ const Scalar& val) {
396
397
  return setConstant(rows(), cols, val);
397
398
  }
398
399
 
399
400
  /** Resizes to the given size, changing only the number of rows, and sets all
400
- * coefficients in this expression to the given value \a val. For the parameter
401
- * of type NoChange_t, just pass the special value \c NoChange.
402
- *
403
- * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&)
404
- */
405
- template<typename Derived>
406
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
407
- PlainObjectBase<Derived>::setConstant(Index rows, NoChange_t, const Scalar& val)
408
- {
401
+ * coefficients in this expression to the given value \a val. For the parameter
402
+ * of type NoChange_t, just pass the special value \c NoChange.
403
+ *
404
+ * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp,
405
+ * MatrixBase::Constant(const Scalar&)
406
+ */
407
+ template <typename Derived>
408
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setConstant(Index rows, NoChange_t,
409
+ const Scalar& val) {
409
410
  return setConstant(rows, cols(), val);
410
411
  }
411
412
 
412
-
413
413
  /**
414
- * \brief Sets a linearly spaced vector.
415
- *
416
- * The function generates 'size' equally spaced values in the closed interval [low,high].
417
- * When size is set to 1, a vector of length 1 containing 'high' is returned.
418
- *
419
- * \only_for_vectors
420
- *
421
- * Example: \include DenseBase_setLinSpaced.cpp
422
- * Output: \verbinclude DenseBase_setLinSpaced.out
423
- *
424
- * For integer scalar types, do not miss the explanations on the definition
425
- * of \link LinSpaced(Index,const Scalar&,const Scalar&) even spacing \endlink.
426
- *
427
- * \sa LinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp
428
- */
429
- template<typename Derived>
430
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setLinSpaced(Index newSize, const Scalar& low, const Scalar& high)
431
- {
414
+ * \brief Sets a linearly spaced vector.
415
+ *
416
+ * The function generates 'size' equally spaced values in the closed interval [low,high].
417
+ * When size is set to 1, a vector of length 1 containing 'high' is returned.
418
+ *
419
+ * \only_for_vectors
420
+ *
421
+ * Example: \include DenseBase_setLinSpaced.cpp
422
+ * Output: \verbinclude DenseBase_setLinSpaced.out
423
+ *
424
+ * For integer scalar types, do not miss the explanations on the definition
425
+ * of \link LinSpaced(Index,const Scalar&,const Scalar&) even spacing \endlink.
426
+ *
427
+ * \sa LinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp
428
+ */
429
+ template <typename Derived>
430
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setLinSpaced(Index newSize, const Scalar& low,
431
+ const Scalar& high) {
432
432
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
433
- return derived() = Derived::NullaryExpr(newSize, internal::linspaced_op<Scalar>(low,high,newSize));
433
+ return derived() = Derived::NullaryExpr(newSize, internal::linspaced_op<Scalar>(low, high, newSize));
434
434
  }
435
435
 
436
436
  /**
437
- * \brief Sets a linearly spaced vector.
438
- *
439
- * The function fills \c *this with equally spaced values in the closed interval [low,high].
440
- * When size is set to 1, a vector of length 1 containing 'high' is returned.
441
- *
442
- * \only_for_vectors
443
- *
444
- * For integer scalar types, do not miss the explanations on the definition
445
- * of \link LinSpaced(Index,const Scalar&,const Scalar&) even spacing \endlink.
446
- *
447
- * \sa LinSpaced(Index,const Scalar&,const Scalar&), setLinSpaced(Index, const Scalar&, const Scalar&), CwiseNullaryOp
448
- */
449
- template<typename Derived>
450
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setLinSpaced(const Scalar& low, const Scalar& high)
451
- {
437
+ * \brief Sets a linearly spaced vector.
438
+ *
439
+ * The function fills \c *this with equally spaced values in the closed interval [low,high].
440
+ * When size is set to 1, a vector of length 1 containing 'high' is returned.
441
+ *
442
+ * \only_for_vectors
443
+ *
444
+ * For integer scalar types, do not miss the explanations on the definition
445
+ * of \link LinSpaced(Index,const Scalar&,const Scalar&) even spacing \endlink.
446
+ *
447
+ * \sa LinSpaced(Index,const Scalar&,const Scalar&), setLinSpaced(Index, const Scalar&, const Scalar&), CwiseNullaryOp
448
+ */
449
+ template <typename Derived>
450
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setLinSpaced(const Scalar& low, const Scalar& high) {
452
451
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
453
452
  return setLinSpaced(size(), low, high);
454
453
  }
455
454
 
455
+ template <typename Derived>
456
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setEqualSpaced(Index newSize, const Scalar& low,
457
+ const Scalar& step) {
458
+ EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
459
+ return derived() = Derived::NullaryExpr(newSize, internal::equalspaced_op<Scalar>(low, step));
460
+ }
461
+ template <typename Derived>
462
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setEqualSpaced(const Scalar& low,
463
+ const Scalar& step) {
464
+ EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
465
+ return setEqualSpaced(size(), low, step);
466
+ }
467
+
456
468
  // zero:
457
469
 
458
470
  /** \returns an expression of a zero matrix.
459
- *
460
- * The parameters \a rows and \a cols are the number of rows and of columns of
461
- * the returned matrix. Must be compatible with this MatrixBase type.
462
- *
463
- * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
464
- * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used
465
- * instead.
466
- *
467
- * Example: \include MatrixBase_zero_int_int.cpp
468
- * Output: \verbinclude MatrixBase_zero_int_int.out
469
- *
470
- * \sa Zero(), Zero(Index)
471
- */
472
- template<typename Derived>
473
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType
474
- DenseBase<Derived>::Zero(Index rows, Index cols)
475
- {
476
- return Constant(rows, cols, Scalar(0));
471
+ *
472
+ * The parameters \a rows and \a cols are the number of rows and of columns of
473
+ * the returned matrix. Must be compatible with this MatrixBase type.
474
+ *
475
+ * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
476
+ * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used
477
+ * instead.
478
+ *
479
+ * Example: \include MatrixBase_zero_int_int.cpp
480
+ * Output: \verbinclude MatrixBase_zero_int_int.out
481
+ *
482
+ * \sa Zero(), Zero(Index)
483
+ */
484
+ template <typename Derived>
485
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ZeroReturnType DenseBase<Derived>::Zero(
486
+ Index rows, Index cols) {
487
+ return ZeroReturnType(rows, cols);
477
488
  }
478
489
 
479
490
  /** \returns an expression of a zero vector.
480
- *
481
- * The parameter \a size is the size of the returned vector.
482
- * Must be compatible with this MatrixBase type.
483
- *
484
- * \only_for_vectors
485
- *
486
- * This variant is meant to be used for dynamic-size vector types. For fixed-size types,
487
- * it is redundant to pass \a size as argument, so Zero() should be used
488
- * instead.
489
- *
490
- * Example: \include MatrixBase_zero_int.cpp
491
- * Output: \verbinclude MatrixBase_zero_int.out
492
- *
493
- * \sa Zero(), Zero(Index,Index)
494
- */
495
- template<typename Derived>
496
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType
497
- DenseBase<Derived>::Zero(Index size)
498
- {
499
- return Constant(size, Scalar(0));
491
+ *
492
+ * The parameter \a size is the size of the returned vector.
493
+ * Must be compatible with this MatrixBase type.
494
+ *
495
+ * \only_for_vectors
496
+ *
497
+ * This variant is meant to be used for dynamic-size vector types. For fixed-size types,
498
+ * it is redundant to pass \a size as argument, so Zero() should be used
499
+ * instead.
500
+ *
501
+ * Example: \include MatrixBase_zero_int.cpp
502
+ * Output: \verbinclude MatrixBase_zero_int.out
503
+ *
504
+ * \sa Zero(), Zero(Index,Index)
505
+ */
506
+ template <typename Derived>
507
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ZeroReturnType DenseBase<Derived>::Zero(
508
+ Index size) {
509
+ return ZeroReturnType(size);
500
510
  }
501
511
 
502
512
  /** \returns an expression of a fixed-size zero matrix or vector.
503
- *
504
- * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you
505
- * need to use the variants taking size arguments.
506
- *
507
- * Example: \include MatrixBase_zero.cpp
508
- * Output: \verbinclude MatrixBase_zero.out
509
- *
510
- * \sa Zero(Index), Zero(Index,Index)
511
- */
512
- template<typename Derived>
513
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType
514
- DenseBase<Derived>::Zero()
515
- {
516
- return Constant(Scalar(0));
513
+ *
514
+ * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you
515
+ * need to use the variants taking size arguments.
516
+ *
517
+ * Example: \include MatrixBase_zero.cpp
518
+ * Output: \verbinclude MatrixBase_zero.out
519
+ *
520
+ * \sa Zero(Index), Zero(Index,Index)
521
+ */
522
+ template <typename Derived>
523
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ZeroReturnType DenseBase<Derived>::Zero() {
524
+ return ZeroReturnType(RowsAtCompileTime, ColsAtCompileTime);
517
525
  }
518
526
 
519
527
  /** \returns true if *this is approximately equal to the zero matrix,
520
- * within the precision given by \a prec.
521
- *
522
- * Example: \include MatrixBase_isZero.cpp
523
- * Output: \verbinclude MatrixBase_isZero.out
524
- *
525
- * \sa class CwiseNullaryOp, Zero()
526
- */
527
- template<typename Derived>
528
- EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isZero(const RealScalar& prec) const
529
- {
530
- typename internal::nested_eval<Derived,1>::type self(derived());
531
- for(Index j = 0; j < cols(); ++j)
532
- for(Index i = 0; i < rows(); ++i)
533
- if(!internal::isMuchSmallerThan(self.coeff(i, j), static_cast<Scalar>(1), prec))
534
- return false;
528
+ * within the precision given by \a prec.
529
+ *
530
+ * Example: \include MatrixBase_isZero.cpp
531
+ * Output: \verbinclude MatrixBase_isZero.out
532
+ *
533
+ * \sa class CwiseNullaryOp, Zero()
534
+ */
535
+ template <typename Derived>
536
+ EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isZero(const RealScalar& prec) const {
537
+ typename internal::nested_eval<Derived, 1>::type self(derived());
538
+ for (Index j = 0; j < cols(); ++j)
539
+ for (Index i = 0; i < rows(); ++i)
540
+ if (!internal::isMuchSmallerThan(self.coeff(i, j), static_cast<Scalar>(1), prec)) return false;
535
541
  return true;
536
542
  }
537
543
 
538
544
  /** Sets all coefficients in this expression to zero.
539
- *
540
- * Example: \include MatrixBase_setZero.cpp
541
- * Output: \verbinclude MatrixBase_setZero.out
542
- *
543
- * \sa class CwiseNullaryOp, Zero()
544
- */
545
- template<typename Derived>
546
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setZero()
547
- {
548
- return setConstant(Scalar(0));
545
+ *
546
+ * Example: \include MatrixBase_setZero.cpp
547
+ * Output: \verbinclude MatrixBase_setZero.out
548
+ *
549
+ * \sa class CwiseNullaryOp, Zero()
550
+ */
551
+ template <typename Derived>
552
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setZero() {
553
+ internal::eigen_zero_impl<Derived>::run(derived());
554
+ return derived();
549
555
  }
550
556
 
551
557
  /** Resizes to the given \a size, and sets all coefficients in this expression to zero.
552
- *
553
- * \only_for_vectors
554
- *
555
- * Example: \include Matrix_setZero_int.cpp
556
- * Output: \verbinclude Matrix_setZero_int.out
557
- *
558
- * \sa DenseBase::setZero(), setZero(Index,Index), class CwiseNullaryOp, DenseBase::Zero()
559
- */
560
- template<typename Derived>
561
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
562
- PlainObjectBase<Derived>::setZero(Index newSize)
563
- {
558
+ *
559
+ * \only_for_vectors
560
+ *
561
+ * Example: \include Matrix_setZero_int.cpp
562
+ * Output: \verbinclude Matrix_setZero_int.out
563
+ *
564
+ * \sa DenseBase::setZero(), setZero(Index,Index), class CwiseNullaryOp, DenseBase::Zero()
565
+ */
566
+ template <typename Derived>
567
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setZero(Index newSize) {
564
568
  resize(newSize);
565
- return setConstant(Scalar(0));
569
+ return setZero();
566
570
  }
567
571
 
568
572
  /** Resizes to the given size, and sets all coefficients in this expression to zero.
569
- *
570
- * \param rows the new number of rows
571
- * \param cols the new number of columns
572
- *
573
- * Example: \include Matrix_setZero_int_int.cpp
574
- * Output: \verbinclude Matrix_setZero_int_int.out
575
- *
576
- * \sa DenseBase::setZero(), setZero(Index), class CwiseNullaryOp, DenseBase::Zero()
577
- */
578
- template<typename Derived>
579
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
580
- PlainObjectBase<Derived>::setZero(Index rows, Index cols)
581
- {
573
+ *
574
+ * \param rows the new number of rows
575
+ * \param cols the new number of columns
576
+ *
577
+ * Example: \include Matrix_setZero_int_int.cpp
578
+ * Output: \verbinclude Matrix_setZero_int_int.out
579
+ *
580
+ * \sa DenseBase::setZero(), setZero(Index), class CwiseNullaryOp, DenseBase::Zero()
581
+ */
582
+ template <typename Derived>
583
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setZero(Index rows, Index cols) {
582
584
  resize(rows, cols);
583
- return setConstant(Scalar(0));
585
+ return setZero();
584
586
  }
585
587
 
586
588
  /** Resizes to the given size, changing only the number of columns, and sets all
587
- * coefficients in this expression to zero. For the parameter of type NoChange_t,
588
- * just pass the special value \c NoChange.
589
- *
590
- * \sa DenseBase::setZero(), setZero(Index), setZero(Index, Index), setZero(Index, NoChange_t), class CwiseNullaryOp, DenseBase::Zero()
591
- */
592
- template<typename Derived>
593
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
594
- PlainObjectBase<Derived>::setZero(NoChange_t, Index cols)
595
- {
589
+ * coefficients in this expression to zero. For the parameter of type NoChange_t,
590
+ * just pass the special value \c NoChange.
591
+ *
592
+ * \sa DenseBase::setZero(), setZero(Index), setZero(Index, Index), setZero(Index, NoChange_t), class CwiseNullaryOp,
593
+ * DenseBase::Zero()
594
+ */
595
+ template <typename Derived>
596
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setZero(NoChange_t, Index cols) {
596
597
  return setZero(rows(), cols);
597
598
  }
598
599
 
599
600
  /** Resizes to the given size, changing only the number of rows, and sets all
600
- * coefficients in this expression to zero. For the parameter of type NoChange_t,
601
- * just pass the special value \c NoChange.
602
- *
603
- * \sa DenseBase::setZero(), setZero(Index), setZero(Index, Index), setZero(NoChange_t, Index), class CwiseNullaryOp, DenseBase::Zero()
604
- */
605
- template<typename Derived>
606
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
607
- PlainObjectBase<Derived>::setZero(Index rows, NoChange_t)
608
- {
601
+ * coefficients in this expression to zero. For the parameter of type NoChange_t,
602
+ * just pass the special value \c NoChange.
603
+ *
604
+ * \sa DenseBase::setZero(), setZero(Index), setZero(Index, Index), setZero(NoChange_t, Index), class CwiseNullaryOp,
605
+ * DenseBase::Zero()
606
+ */
607
+ template <typename Derived>
608
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setZero(Index rows, NoChange_t) {
609
609
  return setZero(rows, cols());
610
610
  }
611
611
 
612
612
  // ones:
613
613
 
614
614
  /** \returns an expression of a matrix where all coefficients equal one.
615
- *
616
- * The parameters \a rows and \a cols are the number of rows and of columns of
617
- * the returned matrix. Must be compatible with this MatrixBase type.
618
- *
619
- * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
620
- * it is redundant to pass \a rows and \a cols as arguments, so Ones() should be used
621
- * instead.
622
- *
623
- * Example: \include MatrixBase_ones_int_int.cpp
624
- * Output: \verbinclude MatrixBase_ones_int_int.out
625
- *
626
- * \sa Ones(), Ones(Index), isOnes(), class Ones
627
- */
628
- template<typename Derived>
629
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType
630
- DenseBase<Derived>::Ones(Index rows, Index cols)
631
- {
615
+ *
616
+ * The parameters \a rows and \a cols are the number of rows and of columns of
617
+ * the returned matrix. Must be compatible with this MatrixBase type.
618
+ *
619
+ * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
620
+ * it is redundant to pass \a rows and \a cols as arguments, so Ones() should be used
621
+ * instead.
622
+ *
623
+ * Example: \include MatrixBase_ones_int_int.cpp
624
+ * Output: \verbinclude MatrixBase_ones_int_int.out
625
+ *
626
+ * \sa Ones(), Ones(Index), isOnes(), class Ones
627
+ */
628
+ template <typename Derived>
629
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType DenseBase<Derived>::Ones(
630
+ Index rows, Index cols) {
632
631
  return Constant(rows, cols, Scalar(1));
633
632
  }
634
633
 
635
634
  /** \returns an expression of a vector where all coefficients equal one.
636
- *
637
- * The parameter \a newSize is the size of the returned vector.
638
- * Must be compatible with this MatrixBase type.
639
- *
640
- * \only_for_vectors
641
- *
642
- * This variant is meant to be used for dynamic-size vector types. For fixed-size types,
643
- * it is redundant to pass \a size as argument, so Ones() should be used
644
- * instead.
645
- *
646
- * Example: \include MatrixBase_ones_int.cpp
647
- * Output: \verbinclude MatrixBase_ones_int.out
648
- *
649
- * \sa Ones(), Ones(Index,Index), isOnes(), class Ones
650
- */
651
- template<typename Derived>
652
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType
653
- DenseBase<Derived>::Ones(Index newSize)
654
- {
635
+ *
636
+ * The parameter \a newSize is the size of the returned vector.
637
+ * Must be compatible with this MatrixBase type.
638
+ *
639
+ * \only_for_vectors
640
+ *
641
+ * This variant is meant to be used for dynamic-size vector types. For fixed-size types,
642
+ * it is redundant to pass \a size as argument, so Ones() should be used
643
+ * instead.
644
+ *
645
+ * Example: \include MatrixBase_ones_int.cpp
646
+ * Output: \verbinclude MatrixBase_ones_int.out
647
+ *
648
+ * \sa Ones(), Ones(Index,Index), isOnes(), class Ones
649
+ */
650
+ template <typename Derived>
651
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType DenseBase<Derived>::Ones(
652
+ Index newSize) {
655
653
  return Constant(newSize, Scalar(1));
656
654
  }
657
655
 
658
656
  /** \returns an expression of a fixed-size matrix or vector where all coefficients equal one.
659
- *
660
- * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you
661
- * need to use the variants taking size arguments.
662
- *
663
- * Example: \include MatrixBase_ones.cpp
664
- * Output: \verbinclude MatrixBase_ones.out
665
- *
666
- * \sa Ones(Index), Ones(Index,Index), isOnes(), class Ones
667
- */
668
- template<typename Derived>
669
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType
670
- DenseBase<Derived>::Ones()
671
- {
657
+ *
658
+ * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you
659
+ * need to use the variants taking size arguments.
660
+ *
661
+ * Example: \include MatrixBase_ones.cpp
662
+ * Output: \verbinclude MatrixBase_ones.out
663
+ *
664
+ * \sa Ones(Index), Ones(Index,Index), isOnes(), class Ones
665
+ */
666
+ template <typename Derived>
667
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::ConstantReturnType DenseBase<Derived>::Ones() {
672
668
  return Constant(Scalar(1));
673
669
  }
674
670
 
675
671
  /** \returns true if *this is approximately equal to the matrix where all coefficients
676
- * are equal to 1, within the precision given by \a prec.
677
- *
678
- * Example: \include MatrixBase_isOnes.cpp
679
- * Output: \verbinclude MatrixBase_isOnes.out
680
- *
681
- * \sa class CwiseNullaryOp, Ones()
682
- */
683
- template<typename Derived>
684
- EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isOnes
685
- (const RealScalar& prec) const
686
- {
672
+ * are equal to 1, within the precision given by \a prec.
673
+ *
674
+ * Example: \include MatrixBase_isOnes.cpp
675
+ * Output: \verbinclude MatrixBase_isOnes.out
676
+ *
677
+ * \sa class CwiseNullaryOp, Ones()
678
+ */
679
+ template <typename Derived>
680
+ EIGEN_DEVICE_FUNC bool DenseBase<Derived>::isOnes(const RealScalar& prec) const {
687
681
  return isApproxToConstant(Scalar(1), prec);
688
682
  }
689
683
 
690
684
  /** Sets all coefficients in this expression to one.
691
- *
692
- * Example: \include MatrixBase_setOnes.cpp
693
- * Output: \verbinclude MatrixBase_setOnes.out
694
- *
695
- * \sa class CwiseNullaryOp, Ones()
696
- */
697
- template<typename Derived>
698
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setOnes()
699
- {
685
+ *
686
+ * Example: \include MatrixBase_setOnes.cpp
687
+ * Output: \verbinclude MatrixBase_setOnes.out
688
+ *
689
+ * \sa class CwiseNullaryOp, Ones()
690
+ */
691
+ template <typename Derived>
692
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::setOnes() {
700
693
  return setConstant(Scalar(1));
701
694
  }
702
695
 
703
696
  /** Resizes to the given \a newSize, and sets all coefficients in this expression to one.
704
- *
705
- * \only_for_vectors
706
- *
707
- * Example: \include Matrix_setOnes_int.cpp
708
- * Output: \verbinclude Matrix_setOnes_int.out
709
- *
710
- * \sa MatrixBase::setOnes(), setOnes(Index,Index), class CwiseNullaryOp, MatrixBase::Ones()
711
- */
712
- template<typename Derived>
713
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
714
- PlainObjectBase<Derived>::setOnes(Index newSize)
715
- {
697
+ *
698
+ * \only_for_vectors
699
+ *
700
+ * Example: \include Matrix_setOnes_int.cpp
701
+ * Output: \verbinclude Matrix_setOnes_int.out
702
+ *
703
+ * \sa MatrixBase::setOnes(), setOnes(Index,Index), class CwiseNullaryOp, MatrixBase::Ones()
704
+ */
705
+ template <typename Derived>
706
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setOnes(Index newSize) {
716
707
  resize(newSize);
717
708
  return setConstant(Scalar(1));
718
709
  }
719
710
 
720
711
  /** Resizes to the given size, and sets all coefficients in this expression to one.
721
- *
722
- * \param rows the new number of rows
723
- * \param cols the new number of columns
724
- *
725
- * Example: \include Matrix_setOnes_int_int.cpp
726
- * Output: \verbinclude Matrix_setOnes_int_int.out
727
- *
728
- * \sa MatrixBase::setOnes(), setOnes(Index), class CwiseNullaryOp, MatrixBase::Ones()
729
- */
730
- template<typename Derived>
731
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
732
- PlainObjectBase<Derived>::setOnes(Index rows, Index cols)
733
- {
712
+ *
713
+ * \param rows the new number of rows
714
+ * \param cols the new number of columns
715
+ *
716
+ * Example: \include Matrix_setOnes_int_int.cpp
717
+ * Output: \verbinclude Matrix_setOnes_int_int.out
718
+ *
719
+ * \sa MatrixBase::setOnes(), setOnes(Index), class CwiseNullaryOp, MatrixBase::Ones()
720
+ */
721
+ template <typename Derived>
722
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setOnes(Index rows, Index cols) {
734
723
  resize(rows, cols);
735
724
  return setConstant(Scalar(1));
736
725
  }
737
726
 
738
727
  /** Resizes to the given size, changing only the number of rows, and sets all
739
- * coefficients in this expression to one. For the parameter of type NoChange_t,
740
- * just pass the special value \c NoChange.
741
- *
742
- * \sa MatrixBase::setOnes(), setOnes(Index), setOnes(Index, Index), setOnes(NoChange_t, Index), class CwiseNullaryOp, MatrixBase::Ones()
743
- */
744
- template<typename Derived>
745
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
746
- PlainObjectBase<Derived>::setOnes(Index rows, NoChange_t)
747
- {
728
+ * coefficients in this expression to one. For the parameter of type NoChange_t,
729
+ * just pass the special value \c NoChange.
730
+ *
731
+ * \sa MatrixBase::setOnes(), setOnes(Index), setOnes(Index, Index), setOnes(NoChange_t, Index), class CwiseNullaryOp,
732
+ * MatrixBase::Ones()
733
+ */
734
+ template <typename Derived>
735
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setOnes(Index rows, NoChange_t) {
748
736
  return setOnes(rows, cols());
749
737
  }
750
738
 
751
739
  /** Resizes to the given size, changing only the number of columns, and sets all
752
- * coefficients in this expression to one. For the parameter of type NoChange_t,
753
- * just pass the special value \c NoChange.
754
- *
755
- * \sa MatrixBase::setOnes(), setOnes(Index), setOnes(Index, Index), setOnes(Index, NoChange_t) class CwiseNullaryOp, MatrixBase::Ones()
756
- */
757
- template<typename Derived>
758
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived&
759
- PlainObjectBase<Derived>::setOnes(NoChange_t, Index cols)
760
- {
740
+ * coefficients in this expression to one. For the parameter of type NoChange_t,
741
+ * just pass the special value \c NoChange.
742
+ *
743
+ * \sa MatrixBase::setOnes(), setOnes(Index), setOnes(Index, Index), setOnes(Index, NoChange_t) class CwiseNullaryOp,
744
+ * MatrixBase::Ones()
745
+ */
746
+ template <typename Derived>
747
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& PlainObjectBase<Derived>::setOnes(NoChange_t, Index cols) {
761
748
  return setOnes(rows(), cols);
762
749
  }
763
750
 
764
751
  // Identity:
765
752
 
766
753
  /** \returns an expression of the identity matrix (not necessarily square).
767
- *
768
- * The parameters \a rows and \a cols are the number of rows and of columns of
769
- * the returned matrix. Must be compatible with this MatrixBase type.
770
- *
771
- * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
772
- * it is redundant to pass \a rows and \a cols as arguments, so Identity() should be used
773
- * instead.
774
- *
775
- * Example: \include MatrixBase_identity_int_int.cpp
776
- * Output: \verbinclude MatrixBase_identity_int_int.out
777
- *
778
- * \sa Identity(), setIdentity(), isIdentity()
779
- */
780
- template<typename Derived>
754
+ *
755
+ * The parameters \a rows and \a cols are the number of rows and of columns of
756
+ * the returned matrix. Must be compatible with this MatrixBase type.
757
+ *
758
+ * This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
759
+ * it is redundant to pass \a rows and \a cols as arguments, so Identity() should be used
760
+ * instead.
761
+ *
762
+ * Example: \include MatrixBase_identity_int_int.cpp
763
+ * Output: \verbinclude MatrixBase_identity_int_int.out
764
+ *
765
+ * \sa Identity(), setIdentity(), isIdentity()
766
+ */
767
+ template <typename Derived>
781
768
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::IdentityReturnType
782
- MatrixBase<Derived>::Identity(Index rows, Index cols)
783
- {
769
+ MatrixBase<Derived>::Identity(Index rows, Index cols) {
784
770
  return DenseBase<Derived>::NullaryExpr(rows, cols, internal::scalar_identity_op<Scalar>());
785
771
  }
786
772
 
787
773
  /** \returns an expression of the identity matrix (not necessarily square).
788
- *
789
- * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you
790
- * need to use the variant taking size arguments.
791
- *
792
- * Example: \include MatrixBase_identity.cpp
793
- * Output: \verbinclude MatrixBase_identity.out
794
- *
795
- * \sa Identity(Index,Index), setIdentity(), isIdentity()
796
- */
797
- template<typename Derived>
774
+ *
775
+ * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you
776
+ * need to use the variant taking size arguments.
777
+ *
778
+ * Example: \include MatrixBase_identity.cpp
779
+ * Output: \verbinclude MatrixBase_identity.out
780
+ *
781
+ * \sa Identity(Index,Index), setIdentity(), isIdentity()
782
+ */
783
+ template <typename Derived>
798
784
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::IdentityReturnType
799
- MatrixBase<Derived>::Identity()
800
- {
785
+ MatrixBase<Derived>::Identity() {
801
786
  EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived)
802
787
  return MatrixBase<Derived>::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_identity_op<Scalar>());
803
788
  }
804
789
 
805
790
  /** \returns true if *this is approximately equal to the identity matrix
806
- * (not necessarily square),
807
- * within the precision given by \a prec.
808
- *
809
- * Example: \include MatrixBase_isIdentity.cpp
810
- * Output: \verbinclude MatrixBase_isIdentity.out
811
- *
812
- * \sa class CwiseNullaryOp, Identity(), Identity(Index,Index), setIdentity()
813
- */
814
- template<typename Derived>
815
- bool MatrixBase<Derived>::isIdentity
816
- (const RealScalar& prec) const
817
- {
818
- typename internal::nested_eval<Derived,1>::type self(derived());
819
- for(Index j = 0; j < cols(); ++j)
820
- {
821
- for(Index i = 0; i < rows(); ++i)
822
- {
823
- if(i == j)
824
- {
825
- if(!internal::isApprox(self.coeff(i, j), static_cast<Scalar>(1), prec))
826
- return false;
827
- }
828
- else
829
- {
830
- if(!internal::isMuchSmallerThan(self.coeff(i, j), static_cast<RealScalar>(1), prec))
831
- return false;
791
+ * (not necessarily square),
792
+ * within the precision given by \a prec.
793
+ *
794
+ * Example: \include MatrixBase_isIdentity.cpp
795
+ * Output: \verbinclude MatrixBase_isIdentity.out
796
+ *
797
+ * \sa class CwiseNullaryOp, Identity(), Identity(Index,Index), setIdentity()
798
+ */
799
+ template <typename Derived>
800
+ bool MatrixBase<Derived>::isIdentity(const RealScalar& prec) const {
801
+ typename internal::nested_eval<Derived, 1>::type self(derived());
802
+ for (Index j = 0; j < cols(); ++j) {
803
+ for (Index i = 0; i < rows(); ++i) {
804
+ if (i == j) {
805
+ if (!internal::isApprox(self.coeff(i, j), static_cast<Scalar>(1), prec)) return false;
806
+ } else {
807
+ if (!internal::isMuchSmallerThan(self.coeff(i, j), static_cast<RealScalar>(1), prec)) return false;
832
808
  }
833
809
  }
834
810
  }
@@ -837,165 +813,163 @@ bool MatrixBase<Derived>::isIdentity
837
813
 
838
814
  namespace internal {
839
815
 
840
- template<typename Derived, bool Big = (Derived::SizeAtCompileTime>=16)>
841
- struct setIdentity_impl
842
- {
843
- EIGEN_DEVICE_FUNC
844
- static EIGEN_STRONG_INLINE Derived& run(Derived& m)
845
- {
816
+ template <typename Derived, bool Big = (Derived::SizeAtCompileTime >= 16)>
817
+ struct setIdentity_impl {
818
+ EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Derived& run(Derived& m) {
846
819
  return m = Derived::Identity(m.rows(), m.cols());
847
820
  }
848
821
  };
849
822
 
850
- template<typename Derived>
851
- struct setIdentity_impl<Derived, true>
852
- {
853
- EIGEN_DEVICE_FUNC
854
- static EIGEN_STRONG_INLINE Derived& run(Derived& m)
855
- {
823
+ template <typename Derived>
824
+ struct setIdentity_impl<Derived, true> {
825
+ EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Derived& run(Derived& m) {
856
826
  m.setZero();
857
827
  const Index size = numext::mini(m.rows(), m.cols());
858
- for(Index i = 0; i < size; ++i) m.coeffRef(i,i) = typename Derived::Scalar(1);
828
+ for (Index i = 0; i < size; ++i) m.coeffRef(i, i) = typename Derived::Scalar(1);
859
829
  return m;
860
830
  }
861
831
  };
862
832
 
863
- } // end namespace internal
833
+ } // end namespace internal
864
834
 
865
835
  /** Writes the identity expression (not necessarily square) into *this.
866
- *
867
- * Example: \include MatrixBase_setIdentity.cpp
868
- * Output: \verbinclude MatrixBase_setIdentity.out
869
- *
870
- * \sa class CwiseNullaryOp, Identity(), Identity(Index,Index), isIdentity()
871
- */
872
- template<typename Derived>
873
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::setIdentity()
874
- {
836
+ *
837
+ * Example: \include MatrixBase_setIdentity.cpp
838
+ * Output: \verbinclude MatrixBase_setIdentity.out
839
+ *
840
+ * \sa class CwiseNullaryOp, Identity(), Identity(Index,Index), isIdentity()
841
+ */
842
+ template <typename Derived>
843
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::setIdentity() {
875
844
  return internal::setIdentity_impl<Derived>::run(derived());
876
845
  }
877
846
 
878
847
  /** \brief Resizes to the given size, and writes the identity expression (not necessarily square) into *this.
879
- *
880
- * \param rows the new number of rows
881
- * \param cols the new number of columns
882
- *
883
- * Example: \include Matrix_setIdentity_int_int.cpp
884
- * Output: \verbinclude Matrix_setIdentity_int_int.out
885
- *
886
- * \sa MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Identity()
887
- */
888
- template<typename Derived>
889
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::setIdentity(Index rows, Index cols)
890
- {
848
+ *
849
+ * \param rows the new number of rows
850
+ * \param cols the new number of columns
851
+ *
852
+ * Example: \include Matrix_setIdentity_int_int.cpp
853
+ * Output: \verbinclude Matrix_setIdentity_int_int.out
854
+ *
855
+ * \sa MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Identity()
856
+ */
857
+ template <typename Derived>
858
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::setIdentity(Index rows, Index cols) {
891
859
  derived().resize(rows, cols);
892
860
  return setIdentity();
893
861
  }
894
862
 
895
863
  /** \returns an expression of the i-th unit (basis) vector.
896
- *
897
- * \only_for_vectors
898
- *
899
- * \sa MatrixBase::Unit(Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
900
- */
901
- template<typename Derived>
902
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::Unit(Index newSize, Index i)
903
- {
864
+ *
865
+ * \only_for_vectors
866
+ *
867
+ * \sa MatrixBase::Unit(Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
868
+ */
869
+ template <typename Derived>
870
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::Unit(
871
+ Index newSize, Index i) {
904
872
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
905
- return BasisReturnType(SquareMatrixType::Identity(newSize,newSize), i);
873
+ return BasisReturnType(SquareMatrixType::Identity(newSize, newSize), i);
906
874
  }
907
875
 
908
876
  /** \returns an expression of the i-th unit (basis) vector.
909
- *
910
- * \only_for_vectors
911
- *
912
- * This variant is for fixed-size vector only.
913
- *
914
- * \sa MatrixBase::Unit(Index,Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
915
- */
916
- template<typename Derived>
917
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::Unit(Index i)
918
- {
877
+ *
878
+ * \only_for_vectors
879
+ *
880
+ * This variant is for fixed-size vector only.
881
+ *
882
+ * \sa MatrixBase::Unit(Index,Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
883
+ */
884
+ template <typename Derived>
885
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::Unit(
886
+ Index i) {
919
887
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
920
- return BasisReturnType(SquareMatrixType::Identity(),i);
888
+ return BasisReturnType(SquareMatrixType::Identity(), i);
921
889
  }
922
890
 
923
891
  /** \returns an expression of the X axis unit vector (1{,0}^*)
924
- *
925
- * \only_for_vectors
926
- *
927
- * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
928
- */
929
- template<typename Derived>
930
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::UnitX()
931
- { return Derived::Unit(0); }
892
+ *
893
+ * \only_for_vectors
894
+ *
895
+ * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(),
896
+ * MatrixBase::UnitW()
897
+ */
898
+ template <typename Derived>
899
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::UnitX() {
900
+ return Derived::Unit(0);
901
+ }
932
902
 
933
903
  /** \returns an expression of the Y axis unit vector (0,1{,0}^*)
934
- *
935
- * \only_for_vectors
936
- *
937
- * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
938
- */
939
- template<typename Derived>
940
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::UnitY()
941
- { return Derived::Unit(1); }
904
+ *
905
+ * \only_for_vectors
906
+ *
907
+ * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(),
908
+ * MatrixBase::UnitW()
909
+ */
910
+ template <typename Derived>
911
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::UnitY() {
912
+ return Derived::Unit(1);
913
+ }
942
914
 
943
915
  /** \returns an expression of the Z axis unit vector (0,0,1{,0}^*)
944
- *
945
- * \only_for_vectors
946
- *
947
- * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
948
- */
949
- template<typename Derived>
950
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::UnitZ()
951
- { return Derived::Unit(2); }
916
+ *
917
+ * \only_for_vectors
918
+ *
919
+ * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(),
920
+ * MatrixBase::UnitW()
921
+ */
922
+ template <typename Derived>
923
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::UnitZ() {
924
+ return Derived::Unit(2);
925
+ }
952
926
 
953
927
  /** \returns an expression of the W axis unit vector (0,0,0,1)
954
- *
955
- * \only_for_vectors
956
- *
957
- * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
958
- */
959
- template<typename Derived>
960
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::UnitW()
961
- { return Derived::Unit(3); }
928
+ *
929
+ * \only_for_vectors
930
+ *
931
+ * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(),
932
+ * MatrixBase::UnitW()
933
+ */
934
+ template <typename Derived>
935
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::UnitW() {
936
+ return Derived::Unit(3);
937
+ }
962
938
 
963
939
  /** \brief Set the coefficients of \c *this to the i-th unit (basis) vector
964
- *
965
- * \param i index of the unique coefficient to be set to 1
966
- *
967
- * \only_for_vectors
968
- *
969
- * \sa MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Unit(Index,Index)
970
- */
971
- template<typename Derived>
972
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::setUnit(Index i)
973
- {
940
+ *
941
+ * \param i index of the unique coefficient to be set to 1
942
+ *
943
+ * \only_for_vectors
944
+ *
945
+ * \sa MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Unit(Index,Index)
946
+ */
947
+ template <typename Derived>
948
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::setUnit(Index i) {
974
949
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
975
- eigen_assert(i<size());
950
+ eigen_assert(i < size());
976
951
  derived().setZero();
977
952
  derived().coeffRef(i) = Scalar(1);
978
953
  return derived();
979
954
  }
980
955
 
981
956
  /** \brief Resizes to the given \a newSize, and writes the i-th unit (basis) vector into *this.
982
- *
983
- * \param newSize the new size of the vector
984
- * \param i index of the unique coefficient to be set to 1
985
- *
986
- * \only_for_vectors
987
- *
988
- * \sa MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Unit(Index,Index)
989
- */
990
- template<typename Derived>
991
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::setUnit(Index newSize, Index i)
992
- {
957
+ *
958
+ * \param newSize the new size of the vector
959
+ * \param i index of the unique coefficient to be set to 1
960
+ *
961
+ * \only_for_vectors
962
+ *
963
+ * \sa MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Unit(Index,Index)
964
+ */
965
+ template <typename Derived>
966
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>::setUnit(Index newSize, Index i) {
993
967
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
994
- eigen_assert(i<newSize);
968
+ eigen_assert(i < newSize);
995
969
  derived().resize(newSize);
996
970
  return setUnit(i);
997
971
  }
998
972
 
999
- } // end namespace Eigen
973
+ } // end namespace Eigen
1000
974
 
1001
- #endif // EIGEN_CWISE_NULLARY_OP_H
975
+ #endif // EIGEN_CWISE_NULLARY_OP_H