mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-10-10 15:16:31 +08:00
Merge branch 'master' into RVV_Chip
This commit is contained in:
commit
edfccf78ea
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.sh eol=lf
|
||||
debug/msvc/*.dat eol=crlf
|
||||
debug/msvc/*.natvis eol=crlf
|
@ -7,6 +7,10 @@
|
||||
# Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
default:
|
||||
# automatically cancels a job when a new pipeline for the same branch is triggered
|
||||
interruptible: true
|
||||
|
||||
stages:
|
||||
- checkformat
|
||||
- build
|
||||
|
11
.hgeol
11
.hgeol
@ -1,11 +0,0 @@
|
||||
[patterns]
|
||||
*.sh = LF
|
||||
*.MINPACK = CRLF
|
||||
scripts/*.in = LF
|
||||
debug/msvc/*.dat = CRLF
|
||||
debug/msvc/*.natvis = CRLF
|
||||
unsupported/test/mpreal/*.* = CRLF
|
||||
** = native
|
||||
|
||||
[repository]
|
||||
native = LF
|
329
CHANGELOG.md
329
CHANGELOG.md
@ -2,9 +2,49 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [3.4.0]
|
||||
## [5.0.0] - 2025-09-30
|
||||
|
||||
Released on August 18, 2021
|
||||
Eigen 5.0 provides many new features, performance enhancements, and bugfixes throughout Eigen’s core template expression infrastructure and linear algebra facilities. The full set of changes and related issues are too large to list here, but can be accessed via the release milestone %"5.0".
|
||||
|
||||
This is the last major release to support the C++14 language standard. The master branch and subsequent releases will require support for C++17.
|
||||
|
||||
### Versioning
|
||||
|
||||
This release marks a transition to [Semantic Versioning](https://semver.org/). Previously, Eigen used a WORLD.MAJOR.MINOR scheme. From now on, version numbers will follow the MAJOR.MINOR.PATCH format, indicating breaking changes, new features, and bug fixes, respectively. The WORLD version will remain 3 for this and subsequent releases for posterity. See the table below:
|
||||
```
|
||||
╔═════════╦═════╦═════╗
|
||||
║ Release ║ 3.4 ║ 5.0 ║
|
||||
╠═════════╬═════╬═════╣
|
||||
║ WORLD ║ 3 ║ 3 ║
|
||||
║ MAJOR ║ 4 ║ 5 ║
|
||||
║ MINOR ║ 0 ║ 0 ║
|
||||
║ PATCH ║ - ║ 0 ║
|
||||
╚═════════╩═════╩═════╝
|
||||
```
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Eigen 5.X.X requires C++14. When building with GNU-compatible compilers, set `-std=c++14` or later. As part of this change, some macros such as `EIGEN_HAS_CXX11` have also been removed.
|
||||
* The CMake build system has been modernized and older properties have been removed - projects relying on CMake may need to update their configurations [!485].
|
||||
* All LGPL-licensed code has been removed (i.e. Constrained Conjugate Gradient) [!1197]. These were "unsupported" anyways, and weren't widely used.
|
||||
* Due to name conflicts with other projects, `Eigen::all` and `Eigen::last` have been moved to `Eigen::placeholders::all` and `Eigen::placeholders::last` [!649].
|
||||
* Any direct inclusion of an internal header (i.e. under a `../src/..` path) will result in a compilation error [!631].
|
||||
* Runtime SVD options for computing thin/full U/V have been deprecated: use compile-time options instead [!826].
|
||||
* Scalar (i.e. non-vectorized) comparisons now return masks with values of `Scalar(1)` rather than having all bits set to avoid undefined behavior [!1862].
|
||||
* BLAS return types have been changed for Eigen BLAS to `void` instead of `int` for compatibility with other BLAS implementations [!1497].
|
||||
* `Eigen::aligned_allocator` no longer inherits from `std::allocator` due to a change in the standard and the use of `allocate_at_least` [!1795].
|
||||
* Euler angles are now returned in a more canonical form, potentially resulting in a change of behavior [!1301, !1314].
|
||||
* Eigen's random number generation has changed, resulting in a change of behavior. Please do not rely on specific random numbers from Eigen - these were never guaranteed to be consistent across Eigen versions, nor are they generally consistent across platforms [!1437].
|
||||
|
||||
## [3.4.1] - 2025-09-30
|
||||
|
||||
Many bug fixes have been backported from the main branch.
|
||||
|
||||
A list of new issues addressed can be found via the [3.4.1](https://gitlab.com/libeigen/eigen/-/issues?state=all&label_name%5B%5D=3.4.1) label on GitLab.
|
||||
|
||||
Check the [git commit history](https://gitlab.com/libeigen/eigen/-/commits/3.4.1) for the full list of changes.
|
||||
|
||||
## [3.4.0] - 2021-08-18
|
||||
|
||||
**Notice:** 3.4.x will be the last major release series of Eigen that will support c++03.
|
||||
|
||||
@ -160,9 +200,7 @@ Released on August 18, 2021
|
||||
|
||||
See the [announcement](https://www.eigen.tuxfamily.org/index.php?title=3.4) for more details.
|
||||
|
||||
## [3.3.9]
|
||||
|
||||
Released on December 4, 2020.
|
||||
## [3.3.9] - 2020-12-04
|
||||
|
||||
Changes since 3.3.8:
|
||||
|
||||
@ -175,9 +213,7 @@ Changes since 3.3.8:
|
||||
* #2012: Define coeff-wise binary array operators for base class to fix an issue when using Eigen with C++20
|
||||
* Commit bfdd4a990: Fix an issue with Intel® MKL PARDISO support.
|
||||
|
||||
## [3.3.8]
|
||||
|
||||
Released on October 5, 2020.
|
||||
## [3.3.8] - 2020-10-05
|
||||
|
||||
Changes since 3.3.7:
|
||||
|
||||
@ -243,9 +279,7 @@ Changes since 3.3.7:
|
||||
* Commit 6c4d57dc9: Fix a gcc7 warning about bool * bool in abs2 default implementation.
|
||||
* Commit 89a86ed42: Fix a warning in SparseSelfAdjointView about a branch statement always evaluation to false.
|
||||
|
||||
## [3.3.8-rc1]
|
||||
|
||||
Released on September 14, 2020.
|
||||
## [3.3.8-rc1] - 2020-09-14
|
||||
|
||||
Changes since 3.3.7:
|
||||
|
||||
@ -308,17 +342,13 @@ Changes since 3.3.7:
|
||||
* Commit 89a86ed42: Fix a warning in SparseSelfAdjointView about a branch statement always evaluation to false.
|
||||
* Commit dd6de618: Fix a bug with half-precision floats on GPUs.
|
||||
|
||||
## [3.3.7]
|
||||
|
||||
Released on December 11, 2018.
|
||||
## [3.3.7] - 2018-12-11
|
||||
|
||||
Changes since 3.3.6:
|
||||
|
||||
* #1643: Fix compilation with GCC>=6 and compiler optimization turned off.
|
||||
|
||||
## [3.3.6]
|
||||
|
||||
Released on December 10, 2018.
|
||||
## [3.3.6] - 2018-12-10
|
||||
|
||||
Changes since 3.3.5:
|
||||
|
||||
@ -340,9 +370,7 @@ Changes since 3.3.5:
|
||||
* Various fixes in the doc.
|
||||
* Various minor warning fixes/workarounds.
|
||||
|
||||
## [3.3.5]
|
||||
|
||||
Released on July 23, 2018.
|
||||
## [3.3.5] - 2018-07-23
|
||||
|
||||
Changes since 3.3.4:
|
||||
|
||||
@ -436,9 +464,7 @@ Changes since 3.3.4:
|
||||
* Changeset 12c9ece47d14: `SelfAdjointView<...,Mode>` causes a static assert since commit c73a77e47db8
|
||||
* Changeset 899fd2ef704f: weird compilation issue in `mapped_matrix.cpp`
|
||||
|
||||
## [3.3.4]
|
||||
|
||||
Released on June 15, 2017.
|
||||
## [3.3.4] - 2017-06-15
|
||||
|
||||
Changes since 3.3.3:
|
||||
|
||||
@ -469,9 +495,7 @@ Changes since 3.3.3:
|
||||
* Add specializations of `std::numeric_limits` for `Eigen::half` and and `AutoDiffScalar`
|
||||
* Fix compilation of streaming nested Array, i.e., `std::cout << Array<Array<...>>`
|
||||
|
||||
## [3.3.3]
|
||||
|
||||
Released on February 21, 2017.
|
||||
## [3.3.3] - 2017-02-21
|
||||
|
||||
Changes since 3.3.2:
|
||||
|
||||
@ -502,9 +526,7 @@ Changes since 3.3.2:
|
||||
* Fix usage of `size_t` instead of Index in sefl-adjoint `matrix * vector`
|
||||
* #1378: fix doc (`DiagonalIndex` vs `Diagonal`).
|
||||
|
||||
## [3.3.2]
|
||||
|
||||
Released on January 18, 2017.
|
||||
## [3.3.2] - 2017-01-18
|
||||
|
||||
Changes since 3.3.1:
|
||||
|
||||
@ -535,9 +557,7 @@ Changes since 3.3.1:
|
||||
* Fix some warnings with ICC, Power8, etc.
|
||||
* Fix compilation with MSVC 2017
|
||||
|
||||
## [3.3.1]
|
||||
|
||||
Released on December 06, 2016.
|
||||
## [3.3.1] - 2016-12-06
|
||||
|
||||
Changes since 3.3.0:
|
||||
|
||||
@ -558,9 +578,7 @@ Changes since 3.3.0:
|
||||
* Bugs #1346,#1347: make Eigen's installation relocatable.
|
||||
* Fix some harmless compilation warnings.
|
||||
|
||||
## [3.3]
|
||||
|
||||
Released on November 10, 2016
|
||||
## [3.3] - 2016-11-10
|
||||
|
||||
For a comprehensive list of change since the 3.2 series, see this [page](https://www.eigen.tuxfamily.org/index.php?title=3.3).
|
||||
|
||||
@ -569,9 +587,7 @@ Main changes since 3.3-rc2:
|
||||
* Fix regression in printing sparse expressions.
|
||||
* Fix sparse solvers when using a SparseVector as the result and/or right-hand-side.
|
||||
|
||||
## [3.3-rc2]
|
||||
|
||||
Released on November 04, 2016
|
||||
## [3.3-rc2] - 2016-11-04
|
||||
|
||||
For a comprehensive list of change since the 3.2 series, see this [page](https://www.eigen.tuxfamily.org/index.php?title=3.3).
|
||||
|
||||
@ -600,9 +616,7 @@ Main changes since 3.3-rc1:
|
||||
* SuiteSparse, fix SPQR for rectangular matrices
|
||||
* Fix compilation of `qr.inverse()` for column and full pivoting variants
|
||||
|
||||
## [3.2.10]
|
||||
|
||||
Released on October 04, 2016
|
||||
## [3.2.10] - 2016-10-04
|
||||
|
||||
Changes since 3.2.9:
|
||||
|
||||
@ -621,9 +635,7 @@ Main fixes and improvements:
|
||||
* #1249: disable the use of `__builtin_prefetch` for compilers other than GCC, clang, and ICC.
|
||||
* #1265: fix doc of QR decompositions
|
||||
|
||||
## [3.3-rc1]
|
||||
|
||||
Released on September 22, 2016
|
||||
## [3.3-rc1] - 2016-09-22
|
||||
|
||||
For a comprehensive list of change since the 3.2 series, see this [page](https://www.eigen.tuxfamily.org/index.php?title=3.3).
|
||||
|
||||
@ -662,9 +674,7 @@ Main changes since 3.3-beta2:
|
||||
* Fix vectorization logic for coeff-based product for some corner cases
|
||||
* Bugs #1260, #1261, #1264: several fixes in AutoDiffScalar.
|
||||
|
||||
## [3.3-beta2]
|
||||
|
||||
Released on July 26, 2016
|
||||
## [3.3-beta2] - 2016-08-26
|
||||
|
||||
For a comprehensive list of change since the 3.2 series, see this [page](https://www.eigen.tuxfamily.org/index.php?title=3.3).
|
||||
|
||||
@ -800,9 +810,7 @@ Main changes since 3.3-beta1:
|
||||
* #1249: fix compilation with compilers that do not support `__builtin_prefetch` .
|
||||
* #1250: fix `pow()` for `AutoDiffScalar` with custom nested scalar type.
|
||||
|
||||
## [3.2.9]
|
||||
|
||||
Released on July 18, 2016
|
||||
## [3.2.9] - 2016-08-18
|
||||
|
||||
Changes since 3.2.8:
|
||||
|
||||
@ -836,9 +844,7 @@ Changes since 3.2.8:
|
||||
* #1221: shutdown some GCC6's warnings.
|
||||
* #1175: fix index type conversion warnings in sparse to dense conversion.
|
||||
|
||||
## [3.2.8]
|
||||
|
||||
Released on February 16, 2016
|
||||
## [3.2.8] - 2016-02-16
|
||||
|
||||
Changes since 3.2.7:
|
||||
|
||||
@ -869,9 +875,7 @@ Changes since 3.2.7:
|
||||
* Some warning fixes.
|
||||
* Several other documentation clarifications.
|
||||
|
||||
## [3.3-beta1]
|
||||
|
||||
Released on December 16, 2015
|
||||
## [3.3-beta1] - 2015-12-16
|
||||
|
||||
For a comprehensive list of change since the 3.2 series, see this [page](https://www.eigen.tuxfamily.org/index.php?title=3.3).
|
||||
|
||||
@ -938,9 +942,7 @@ Main changes since 3.3-alpha1:
|
||||
* Fix ICE with VC2015 Update1.
|
||||
* Improve cmake install scripts.
|
||||
|
||||
## [3.2.7]
|
||||
|
||||
Released on November 5, 2015
|
||||
## [3.2.7] - 2015-11-05
|
||||
|
||||
Changes since 3.2.6:
|
||||
|
||||
@ -966,9 +968,7 @@ Changes since 3.2.6:
|
||||
* unsupported/ArpackSupport is now properly installed by make install.
|
||||
* #1080: warning fixes
|
||||
|
||||
## [3.2.6]
|
||||
|
||||
Released on October 1, 2015
|
||||
## [3.2.6] - 2015-10-01
|
||||
|
||||
Changes since 3.2.5:
|
||||
|
||||
@ -984,15 +984,11 @@ Changes since 3.2.5:
|
||||
* MKL: fix support for the 11.2 version, and fix a naming conflict (#1067)
|
||||
* #1033: explicit type conversion from 0 to RealScalar
|
||||
|
||||
## [3.3-alpha1]
|
||||
|
||||
Released on September 4, 2015
|
||||
## [3.3-alpha1] - 2015-09-04
|
||||
|
||||
See the [announcement](https://www.eigen.tuxfamily.org/index.php?title=3.3).
|
||||
|
||||
## [3.2.5]
|
||||
|
||||
Released on June 16, 2015
|
||||
## [3.2.5] - 2015-06-16
|
||||
|
||||
Changes since 3.2.4:
|
||||
|
||||
@ -1036,9 +1032,7 @@ Changes since 3.2.4:
|
||||
* #1012: enable alloca on Mac OS or if alloca is defined as macro
|
||||
* Doc and build system: #733, #914, #952, #961, #999
|
||||
|
||||
## [3.2.4]
|
||||
|
||||
Released on January 21, 2015
|
||||
## [3.2.4] - 2015-01-21
|
||||
|
||||
Changes since 3.2.3:
|
||||
|
||||
@ -1047,9 +1041,7 @@ Changes since 3.2.3:
|
||||
* #921: fix utilization of bitwise operation on enums in `first_aligned`.
|
||||
* Fix compilation with NEON on some platforms.
|
||||
|
||||
## [3.2.3]
|
||||
|
||||
Released on December 16, 2014
|
||||
## [3.2.3] - 2014-12-16
|
||||
|
||||
Changes since 3.2.2:
|
||||
|
||||
@ -1088,9 +1080,7 @@ Changes since 3.2.2:
|
||||
* #861: enable posix_memalign with PGI.
|
||||
* Fix BiCGSTAB doc example.
|
||||
|
||||
## [3.2.2]
|
||||
|
||||
Released on August 4, 2014
|
||||
## [3.2.2] - 2014-08-04
|
||||
|
||||
Changes since 3.2.1:
|
||||
|
||||
@ -1134,9 +1124,7 @@ Changes since 3.2.1:
|
||||
* #632: doc: Note that `dm2 = sm1 + dm1` is not possible
|
||||
* Extend AsciiQuickReference (real, imag, conjugate, rot90)
|
||||
|
||||
## [3.2.1]
|
||||
|
||||
Released on February 26, 2014
|
||||
## [3.2.1] - 2014-02-26
|
||||
|
||||
Changes since 3.2.0:
|
||||
|
||||
@ -1181,9 +1169,7 @@ Changes since 3.2.0:
|
||||
* Fix a few compiler warnings (bug #317 and more).
|
||||
* Documentation fixes (bugs #609, #638 and #739 and more).
|
||||
|
||||
## [3.1.4]
|
||||
|
||||
Released on August 02, 2013
|
||||
## [3.1.4] - 2013-08-02
|
||||
|
||||
Changes since 3.1.3:
|
||||
|
||||
@ -1196,18 +1182,14 @@ Changes since 3.1.3:
|
||||
* Fix a few warnings and compilation issues with recent compiler versions.
|
||||
* Documentation fixes.
|
||||
|
||||
## [3.0.7]
|
||||
|
||||
Released on August 02, 2013
|
||||
## [3.0.7] - 2013-08-02
|
||||
|
||||
Changes since 3.0.6:
|
||||
|
||||
* Fix traits of `Map<Quaternion>`.
|
||||
* Fix a few warnings (#507) and documentation (#531).
|
||||
|
||||
## [3.2.0]
|
||||
|
||||
Released on July 24, 2013.
|
||||
## [3.2.0] - 2013-07-24
|
||||
|
||||
Major new features and optimizations since 3.1:
|
||||
|
||||
@ -1234,18 +1216,14 @@ Major new features and optimizations since 3.1:
|
||||
|
||||
Eigen 3.2 represents about 600 commits since Eigen 3.1.
|
||||
|
||||
## [3.2-rc2]
|
||||
|
||||
Released on July 19, 2013.
|
||||
## [3.2-rc2] - 2013-07-19
|
||||
|
||||
Changes since 3.2-rc1:
|
||||
|
||||
* Rename `DenseBase::isFinite()` to `allFinite()` to avoid a future naming collision.
|
||||
* Fix an ICE with ICC 11.1.
|
||||
|
||||
## [3.2-rc1]
|
||||
|
||||
Released on July 17, 2013.
|
||||
## [3.2-rc1] - 2013-07-17
|
||||
|
||||
Main changes since 3.2-beta1:
|
||||
* New features:
|
||||
@ -1290,9 +1268,7 @@ Main changes since 3.2-beta1:
|
||||
* Fix many warnings and compilation issues with recent compiler versions.
|
||||
* Many other fixes including #230, #482, #542, #561, #564, #565, #566, #578, #581, #595, #597, #598, #599, #605, #606, #615.
|
||||
|
||||
## [3.1.3]
|
||||
|
||||
Released on April 16, 2013
|
||||
## [3.1.3] - 2013-04-16
|
||||
|
||||
Changes since 3.1.2:
|
||||
|
||||
@ -1310,9 +1286,7 @@ Changes since 3.1.2:
|
||||
* Enable SSE with ICC even when it mimics a gcc version lower than 4.2
|
||||
* Workaround [gcc-4.7 bug #53900](http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53900) (too aggressive optimization in our alignment check)
|
||||
|
||||
## [3.2-beta1]
|
||||
|
||||
Released on March 07, 2013
|
||||
## [3.2-beta1] - 2013-03-07
|
||||
|
||||
Main changes since 3.1:
|
||||
|
||||
@ -1338,9 +1312,7 @@ Main changes since 3.1:
|
||||
* New compilation token `EIGEN_INITIALIZE_MATRICES_BY_NAN` to help debugging.
|
||||
* All bug fixes of the 3.1 branch, plus a couple of other fixes (including 211, 479, 496, 508, 552)
|
||||
|
||||
## [3.1.2]
|
||||
|
||||
Released on Nov 05, 2012
|
||||
## [3.1.2] - 2012-11-05
|
||||
|
||||
Changes since 3.1.1:
|
||||
|
||||
@ -1364,9 +1336,7 @@ Changes since 3.1.1:
|
||||
* Remove stupid assert in blue norm.
|
||||
* Workaround a weird compilation error with MSVC.
|
||||
|
||||
## [3.1.1]
|
||||
|
||||
Released on July 22, 2012
|
||||
## [3.1.1] - 2012-07-22
|
||||
|
||||
Changes since 3.1.0:
|
||||
* [relicense to MPL2](https://www.eigen.tuxfamily.org/index.php?title=Main_Page#License)
|
||||
@ -1382,9 +1352,7 @@ Changes since 3.1.0:
|
||||
* Fixed Geometry module compilation under MSVC
|
||||
* Fixed Sparse module compilation under MSVC 2005
|
||||
|
||||
## [3.0.6]
|
||||
|
||||
Released on July 9, 2012
|
||||
## [3.0.6] - 2012-07-09
|
||||
|
||||
Changes since 3.0.5:
|
||||
* #447 - fix infinite recursion in `ProductBase::coeff()`
|
||||
@ -1404,9 +1372,7 @@ Changes since 3.0.5:
|
||||
* Fix typo in NumericalDiff (unsupported module)
|
||||
* Fix LevenbergMarquart for non double scalar type (unsupported module)
|
||||
|
||||
## [3.1.0]
|
||||
|
||||
Released on June 24, 2012.
|
||||
## [3.1.0] - 2012-06-24
|
||||
|
||||
Major changes between Eigen 3.0 and Eigen 3.1:
|
||||
* New features
|
||||
@ -1429,9 +1395,7 @@ Major changes between Eigen 3.0 and Eigen 3.1:
|
||||
|
||||
Eigen 3.1 represents about 600 commits since Eigen 3.0.
|
||||
|
||||
## [3.1.0-rc2]
|
||||
|
||||
Released on June 21, 2012.
|
||||
## [3.1.0-rc2] - 2012-06-21
|
||||
|
||||
Changes since 3.1.0-rc1:
|
||||
* Fix a couple of compilation warnings
|
||||
@ -1440,9 +1404,7 @@ Changes since 3.1.0-rc1:
|
||||
* #466: `RealSchur` failed on a zero matrix
|
||||
* Update Adolc and MPReal support modules
|
||||
|
||||
## [3.1.0-rc1]
|
||||
|
||||
Released on June 14, 2012
|
||||
## [3.1.0-rc1] - 2012-06-14
|
||||
|
||||
Main changes since 3.1.0-beta1:
|
||||
* #466: fix a possible race condition issue. from now, multithreaded applications that call Eigen from multiple thread must initialize Eigen by calling `initParallel()`.
|
||||
@ -1454,9 +1416,7 @@ Main changes since 3.1.0-beta1:
|
||||
* Fix ambiguous calls in the math functors
|
||||
* Fix BTL interface.
|
||||
|
||||
## [3.1.0-beta1]
|
||||
|
||||
Released on June 7, 2012
|
||||
## [3.1.0-beta1] - 2012-06-07
|
||||
|
||||
Main changes since 3.1.0-alpha2:
|
||||
* **API changes**
|
||||
@ -1487,9 +1447,7 @@ Main changes since 3.1.0-alpha2:
|
||||
* New tutorial page on Map
|
||||
* and many other bug fixes such as: #417, #419, #450
|
||||
|
||||
## [3.0.5]
|
||||
|
||||
Released February 10, 2012
|
||||
## [3.0.5] - 2012-02-10
|
||||
|
||||
Changes since 3.0.4:
|
||||
* #417 - fix nesting of `Map` expressions
|
||||
@ -1503,9 +1461,7 @@ Changes since 3.0.4:
|
||||
* Changeset 4432 - fix asserts in eigenvalue decompositions
|
||||
* Changeset 4416 - fix MSVC integer overflow warning
|
||||
|
||||
## [3.1.0-alpha2]
|
||||
|
||||
Released February 6, 2012
|
||||
## [3.1.0-alpha2] - 2012-02-06
|
||||
|
||||
Main changes since 3.0.1-alpha1:
|
||||
* New optional support for Intel MKL and other BLAS including: ([details](http://eigen.tuxfamily.org/dox-devel/TopicUsingIntelMKL.html))
|
||||
@ -1532,9 +1488,7 @@ Main changes since 3.0.1-alpha1:
|
||||
* and many other bug fixes such as: #406, #410, #398, #396, #394, #354, #352, #301,
|
||||
|
||||
|
||||
## [3.1.0-alpha1]
|
||||
|
||||
Released December 6, 2011
|
||||
## [3.1.0-alpha1] - 2011-12-06
|
||||
|
||||
Main changes since 3.0:
|
||||
* Officially supported set of sparse modules. See this [page](http://eigen.tuxfamily.org/dox-devel/TutorialSparse.html) for an overview of the features. Main changes:
|
||||
@ -1555,10 +1509,7 @@ Main changes since 3.0:
|
||||
* All the fixes and improvements of the 3.0 branch up to the 3.0.4 release (see below)
|
||||
|
||||
|
||||
|
||||
## [3.0.4]
|
||||
|
||||
Released December 6, 2011
|
||||
## [3.0.4] - 2011-12-06
|
||||
|
||||
Changes since 3.0.3:
|
||||
|
||||
@ -1572,9 +1523,7 @@ Changes since 3.0.3:
|
||||
* Fix compilation issue with `QuaternionBase::cast`
|
||||
|
||||
|
||||
## [2.0.17]
|
||||
|
||||
Released December 6, 2011
|
||||
## [2.0.17] - 2011-12-06
|
||||
|
||||
Changes since 2.0.16:
|
||||
|
||||
@ -1582,9 +1531,7 @@ Changes since 2.0.16:
|
||||
* Fix a typo in ParametrizedLine documentation
|
||||
|
||||
|
||||
## [3.0.3]
|
||||
|
||||
Released October 6, 2011
|
||||
## [3.0.3] - 2011-10-06
|
||||
|
||||
Changes since 3.0.2:
|
||||
|
||||
@ -1596,9 +1543,7 @@ Changes since 3.0.2:
|
||||
* Several improvements to the documentation.
|
||||
|
||||
|
||||
## [3.0.2]
|
||||
|
||||
Released August 26, 2011
|
||||
## [3.0.2] - 2011-08-26
|
||||
|
||||
Changes since 3.0.1:
|
||||
|
||||
@ -1615,9 +1560,7 @@ Changes since 3.0.1:
|
||||
* fix a few documentation issues.
|
||||
|
||||
|
||||
## [3.0.1]
|
||||
|
||||
Released May 30, 2011
|
||||
## [3.0.1] - 2011-05-30
|
||||
|
||||
Changes since 3.0.0:
|
||||
|
||||
@ -1634,9 +1577,7 @@ Changes since 3.0.0:
|
||||
* Fix Qt support in Transform.
|
||||
* Improved documentation.
|
||||
|
||||
## [2.0.16]
|
||||
|
||||
Released May 28, 2011
|
||||
## [2.0.16] - 2011-05-28
|
||||
|
||||
Changes since 2.0.15:
|
||||
|
||||
@ -1647,18 +1588,16 @@ Changes since 2.0.15:
|
||||
* New feature: support for `part<SelfAdjoint>`.
|
||||
* Fix bug in SparseLU::setOrderingMethod.
|
||||
|
||||
## [3.0.0]
|
||||
## [3.0.0] - 2011-03-19
|
||||
|
||||
Released March 19, 2011, at the [meeting](https://www.eigen.tuxfamily.org/index.php?title=Paris_2011_Meeting).
|
||||
Released at the [meeting](https://www.eigen.tuxfamily.org/index.php?title=Paris_2011_Meeting).
|
||||
|
||||
See the [Eigen 3.0 release notes](https://www.eigen.tuxfamily.org/index.php?title=3.0).
|
||||
|
||||
Only change since 3.0-rc1:
|
||||
* Fixed compilation of the unsupported 'openglsupport' test.
|
||||
|
||||
## [3.0-rc1]
|
||||
|
||||
Released March 14, 2011.
|
||||
## [3.0-rc1] - 2011-03-14
|
||||
|
||||
Main changes since 3.0-beta4:
|
||||
|
||||
@ -1677,9 +1616,7 @@ Main changes since 3.0-beta4:
|
||||
* more compiler warnings fixes
|
||||
* fixed GDB pretty-printer for dynamic-size matrices (#210)
|
||||
|
||||
## [3.0-beta4]
|
||||
|
||||
Released February 28, 2011.
|
||||
## [3.0-beta4] - 2011-02-28
|
||||
|
||||
Main changes since 3.0-beta3:
|
||||
|
||||
@ -1715,9 +1652,7 @@ Main changes since 3.0-beta3:
|
||||
* misc documentation improvements
|
||||
* improve documentation of plugins
|
||||
|
||||
## [3.0-beta3]
|
||||
|
||||
Released February 12, 2011.
|
||||
## [3.0-beta3] - 2011-02-12
|
||||
|
||||
The biggest news is that the API is now **100% stable**.
|
||||
|
||||
@ -1763,9 +1698,7 @@ Main changes since 3.0-beta2:
|
||||
* imported a copy of the Eigen 2 test suite, made sure that Eigen 3 passes it. That also allowed to fix several issues.
|
||||
|
||||
|
||||
## [3.0-beta2]
|
||||
|
||||
Released October 15, 2010.
|
||||
## [3.0-beta2] - 2010-10-15
|
||||
|
||||
Main changes since 3.0-beta1:
|
||||
|
||||
@ -1790,9 +1723,7 @@ Main changes since 3.0-beta1:
|
||||
* Remove the Taucs backend (obsolete).
|
||||
* Remove the old SVD class (was causing too much troubles, a new decompozition based on bidiagonalisation/householder should come back soon, `JacobiSVD` can be used meanwhile).
|
||||
|
||||
## [2.0.15]
|
||||
|
||||
Released July 16, 2010
|
||||
## [2.0.15] - 2010-07-16
|
||||
|
||||
Changes since 2.0.14:
|
||||
|
||||
@ -1803,15 +1734,11 @@ Changes since 2.0.14:
|
||||
* Fix for ICC in SSE code.
|
||||
* Fix some C++ issues found by Clang (patch by Nick Lewycky).
|
||||
|
||||
## [3.0-beta1]
|
||||
|
||||
Released July 5, 2010
|
||||
## [3.0-beta1] - 2010-07-05
|
||||
|
||||
See the [announcement](https://www.eigen.tuxfamily.org/index.php?title=3.0).
|
||||
|
||||
## [2.0.14]
|
||||
|
||||
Released June 22, 2010
|
||||
## [2.0.14] - 2010-06-22
|
||||
|
||||
Changes since 2.0.13:
|
||||
|
||||
@ -1819,9 +1746,7 @@ Changes since 2.0.13:
|
||||
* Fix #142: LU of fixed-size matrices was causing dynamic memory allocation (patch by Stuart Glaser).
|
||||
* Fix #127: remove useless static keywords (also fixes warnings with clang++).
|
||||
|
||||
## [2.0.13]
|
||||
|
||||
Released June 10, 2010
|
||||
## [2.0.13] - 2010-06-10
|
||||
|
||||
Changes since 2.0.12:
|
||||
|
||||
@ -1836,9 +1761,7 @@ Changes since 2.0.12:
|
||||
* Fix compilation of the BTL benchmarks.
|
||||
* Some dox updates.
|
||||
|
||||
## [2.0.12]
|
||||
|
||||
Released February 12, 2010
|
||||
## [2.0.12] - 2010-02-12
|
||||
|
||||
Changes since 2.0.11:
|
||||
|
||||
@ -1854,9 +1777,7 @@ Changes since 2.0.11:
|
||||
* Backport improvements to benchmarking code.
|
||||
* Documentation fixes
|
||||
|
||||
## [2.0.11]
|
||||
|
||||
Released January 10, 2010
|
||||
## [2.0.11] - 2010-01-10
|
||||
|
||||
Changes since 2.0.10:
|
||||
|
||||
@ -1869,9 +1790,7 @@ Changes since 2.0.10:
|
||||
* Fix MSVC 2010 compatibility.
|
||||
* Some documentation improvements.
|
||||
|
||||
## [2.0.10]
|
||||
|
||||
Released November 25, 2009
|
||||
## [2.0.10] - 2009-11-25
|
||||
|
||||
Changes since 2.0.9:
|
||||
|
||||
@ -1887,27 +1806,21 @@ Changes since 2.0.9:
|
||||
* fix compilation with MSVC 2010
|
||||
* adjust to repository name change
|
||||
|
||||
## [2.0.9]
|
||||
|
||||
Released October 24, 2009
|
||||
## [2.0.9] - 2009-10-24
|
||||
|
||||
Changes since 2.0.8:
|
||||
|
||||
* Really fix installation and the pkg-config file.
|
||||
* Install the `NewStdVector` header that was introduced in 2.0.6.
|
||||
|
||||
## [2.0.8]
|
||||
|
||||
Released October 23, 2009
|
||||
## [2.0.8] - 2009-10-23
|
||||
|
||||
Changes since 2.0.7:
|
||||
|
||||
* fix installation error introduced in 2.0.7: it was choking on the pkg-config file eigen2.pc not being found. The fix had been proposed long ago by Ingmar Vanhassel for the development branch, and when recently the pkg-config support was back-ported to the 2.0 branch, nobody thought of backporting this fix too, and apparently nobody tested "make install" !
|
||||
* SVD: add default constructor. Users were relying on the compiler to generate one, and apparenty 2.0.7 triggered a little MSVC 2008 subtlety in this respect. Also added an assert.
|
||||
|
||||
## [2.0.7]
|
||||
|
||||
Released October 22, 2009
|
||||
## [2.0.7] - 2009-10-22
|
||||
|
||||
Changes since 2.0.6:
|
||||
|
||||
@ -1922,9 +1835,7 @@ Changes since 2.0.6:
|
||||
* add pkg-config support by Rhys Ulerich.
|
||||
* documentation fix and doc-generation-script updates by Thomas Capricelli
|
||||
|
||||
## [2.0.6]
|
||||
|
||||
Released September 23, 2009
|
||||
## [2.0.6] - 2009-09-23
|
||||
|
||||
Changes since 2.0.5:
|
||||
|
||||
@ -1938,9 +1849,7 @@ Changes since 2.0.5:
|
||||
* fix a warning in `ei_aligned_malloc`; fixed by backporting the body from the devel branch; may result in a different choice of system aligned malloc function.
|
||||
* update the documentation.
|
||||
|
||||
## [2.0.5]
|
||||
|
||||
Released August 22, 2009
|
||||
## [2.0.5] - 2009-08-22
|
||||
|
||||
Changes since 2.0.4:
|
||||
|
||||
@ -1959,9 +1868,7 @@ Changes since 2.0.4:
|
||||
* fix the option to build a binary library, although it's not very useful and will be removed
|
||||
* add basic .hgignore file and script to build the docs (thanks to Thomas Capricelli)
|
||||
|
||||
## [2.0.4]
|
||||
|
||||
Released August 1, 2009
|
||||
## [2.0.4] - 2009-08-01
|
||||
|
||||
Changes since 2.0.3:
|
||||
* Several fixes in the overloaded new and delete operators. Thanks to Hauke Heibel.
|
||||
@ -1975,9 +1882,7 @@ Changes since 2.0.3:
|
||||
* several ctest improvements: use our own dashboard, use a separate project for the 2.0 branch.
|
||||
* documentation: improvement on the pages on unaligned arrays (the online copies have been updated immediately).
|
||||
|
||||
## [2.0.3]
|
||||
|
||||
Released June 21, 2009
|
||||
## [2.0.3] - 2009-06-21
|
||||
|
||||
Changes since 2.0.2:
|
||||
* precision and reliability fixes in various algorithms, especially LLT, QR, Tridiagonalization, and also a precision improvement in LU.
|
||||
@ -1987,9 +1892,7 @@ Changes since 2.0.2:
|
||||
* backport documentation improvements on transpose() and adjoint()
|
||||
* updates in the Sparse module (was needed to support KDE 4.3)
|
||||
|
||||
## [2.0.2]
|
||||
|
||||
Released May 22, 2009
|
||||
## [2.0.2] - 2009-05-22
|
||||
|
||||
Changes since 2.0.1:
|
||||
* Fix `linearRegression()` compilation, actually it is reimplemented using the better fitHyperplane() which does total least-squares.
|
||||
@ -1999,9 +1902,7 @@ Changes since 2.0.1:
|
||||
* Fix compatibility with the old GCC 3.3: it is now fully supported again.
|
||||
* Fix warnings with recent GCC (4.4.0 and 4.3.3).
|
||||
|
||||
## [2.0.1]
|
||||
|
||||
Released April 14, 2009
|
||||
## [2.0.1] - 2009-04-14
|
||||
|
||||
Changes since 2.0.0:
|
||||
* disable alignment altogether on exotic platforms on which we don't vectorize anyway. This allows e.g. to use Eigen on ARM platforms.
|
||||
@ -2014,6 +1915,6 @@ Changes since 2.0.0:
|
||||
* fix wrong static assertion (patch by Markus Moll)
|
||||
* add missing operators in `aligned_allocator` (thanks to Hauke Heibel)
|
||||
|
||||
## [2.0.0]
|
||||
## [2.0.0] - 2009-02-02
|
||||
|
||||
Released February 2, 2009
|
||||
First public release.
|
@ -100,15 +100,28 @@ endif()
|
||||
# Version Info.
|
||||
#==============================================================================
|
||||
|
||||
# Automatically parse the version number from header files.
|
||||
file(READ "${PROJECT_SOURCE_DIR}/Eigen/src/Core/util/Macros.h" _eigen_version_header)
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen_world_version_match "${_eigen_version_header}")
|
||||
set(EIGEN_WORLD_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen_major_version_match "${_eigen_version_header}")
|
||||
set(EIGEN_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen_minor_version_match "${_eigen_version_header}")
|
||||
set(EIGEN_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
set(EIGEN_VERSION_NUMBER ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})
|
||||
# If version information is not provided, automatically parse the version number
|
||||
# from header files.
|
||||
file(READ "${PROJECT_SOURCE_DIR}/Eigen/Version" _eigen_version_header)
|
||||
if (NOT DEFINED EIGEN_WORLD_VERSION)
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen_world_version_match "${_eigen_version_header}")
|
||||
set(EIGEN_WORLD_VERSION "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
if (NOT DEFINED EIGEN_MAJOR_VERSION)
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen_major_version_match "${_eigen_version_header}")
|
||||
set(EIGEN_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
if (NOT DEFINED EIGEN_MINOR_VERSION)
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen_minor_version_match "${_eigen_version_header}")
|
||||
set(EIGEN_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
if (NOT DEFINED EIGEN_PATCH_VERSION)
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_PATCH_VERSION[ \t]+([0-9]+)" _eigen_patch_version_match "${_eigen_version_header}")
|
||||
set(EIGEN_PATCH_VERSION "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
if (NOT DEFINED EIGEN_PRERELEASE_VERSION)
|
||||
set(EIGEN_PRERELEASE_VERSION "dev")
|
||||
endif()
|
||||
|
||||
# If we are in a git repo, extract a changeset.
|
||||
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git)
|
||||
@ -119,16 +132,32 @@ endif()
|
||||
|
||||
# extract the git rev number from the git output...
|
||||
if(EIGEN_GIT_OUTPUT)
|
||||
string(REGEX MATCH "^([0-9;a-f]+).*" EIGEN_GIT_CHANGESET_MATCH "${EIGEN_GIT_OUTPUT}")
|
||||
set(EIGEN_GIT_REVNUM "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "^([0-9;a-f]+).*" EIGEN_GIT_CHANGESET_MATCH "${EIGEN_GIT_OUTPUT}")
|
||||
set(EIGEN_GIT_REVNUM "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
#...and show it next to the version number
|
||||
if(EIGEN_GIT_REVNUM)
|
||||
set(EIGEN_VERSION "${EIGEN_VERSION_NUMBER} (git rev ${EIGEN_GIT_REVNUM})")
|
||||
|
||||
if (NOT DEFINED EIGEN_BUILD_VERSION AND DEFINED EIGEN_GIT_REVNUM)
|
||||
string(SUBSTRING "${EIGEN_GIT_REVNUM}" 0 8 EIGEN_BUILD_VERSION)
|
||||
else()
|
||||
set(EIGEN_VERSION "${EIGEN_VERSION_NUMBER}")
|
||||
set(EIGEN_BUILD_VERSION "")
|
||||
endif()
|
||||
|
||||
# The EIGEN_VERSION_NUMBER must be of the form <major.minor.patch>.
|
||||
# The EIGEN_VERSION_STRING can contain the preprelease/build strings.
|
||||
set(EIGEN_VERSION_NUMBER "${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION}.${EIGEN_PATCH_VERSION}")
|
||||
set(EIGEN_VERSION_STRING "${EIGEN_VERSION_NUMBER}")
|
||||
if (NOT "x${EIGEN_PRERELEASE_VERSION}" STREQUAL "x")
|
||||
set(EIGEN_VERSION_STRING "${EIGEN_VERSION_STRING}-${EIGEN_PRERELEASE_VERSION}")
|
||||
endif()
|
||||
if (NOT "x${EIGEN_BUILD_VERSION}" STREQUAL "x")
|
||||
set(EIGEN_VERSION_STRING "${EIGEN_VERSION_STRING}+${EIGEN_BUILD_VERSION}")
|
||||
endif()
|
||||
|
||||
|
||||
# Generate version file.
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Version.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/include/Eigen/Version")
|
||||
|
||||
#==============================================================================
|
||||
# Install Path Configuration.
|
||||
#==============================================================================
|
||||
@ -176,11 +205,6 @@ endforeach()
|
||||
# Eigen Library.
|
||||
#==============================================================================
|
||||
|
||||
set ( EIGEN_VERSION_STRING ${EIGEN_VERSION_NUMBER} )
|
||||
set ( EIGEN_VERSION_MAJOR ${EIGEN_WORLD_VERSION} )
|
||||
set ( EIGEN_VERSION_MINOR ${EIGEN_MAJOR_VERSION} )
|
||||
set ( EIGEN_VERSION_PATCH ${EIGEN_MINOR_VERSION} )
|
||||
|
||||
# Alias Eigen_*_DIR to Eigen3_*_DIR:
|
||||
set(Eigen_SOURCE_DIR ${Eigen3_SOURCE_DIR})
|
||||
set(Eigen_BINARY_DIR ${Eigen3_BINARY_DIR})
|
||||
@ -193,6 +217,9 @@ target_include_directories (eigen INTERFACE
|
||||
$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>
|
||||
)
|
||||
|
||||
# Eigen requires at least C++14
|
||||
target_compile_features (eigen INTERFACE cxx_std_14)
|
||||
|
||||
# Export as title case Eigen
|
||||
set_target_properties (eigen PROPERTIES EXPORT_NAME Eigen)
|
||||
|
||||
@ -212,6 +239,9 @@ if(EIGEN_BUILD_PKGCONFIG)
|
||||
endif()
|
||||
|
||||
install(DIRECTORY Eigen DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
|
||||
# Replace the "Version" header file with the generated one.
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/Eigen/Version
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/ COMPONENT Devel)
|
||||
|
||||
install(TARGETS eigen EXPORT Eigen3Targets)
|
||||
|
||||
@ -225,25 +255,10 @@ if(EIGEN_BUILD_CMAKE_PACKAGE)
|
||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO # Eigen does not provide components
|
||||
)
|
||||
|
||||
# NOTE Remove the first code path once the minimum required CMake version is
|
||||
# bumped to 3.14 or above.
|
||||
if (CMAKE_VERSION VERSION_LESS 3.14)
|
||||
# Remove CMAKE_SIZEOF_VOID_P from Eigen3ConfigVersion.cmake since Eigen does
|
||||
# not depend on architecture specific settings or libraries. More
|
||||
# specifically, an Eigen3Config.cmake generated from a 64 bit target can be
|
||||
# used for 32 bit targets as well (and vice versa).
|
||||
set (_Eigen3_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
|
||||
unset (CMAKE_SIZEOF_VOID_P)
|
||||
write_basic_package_version_file (Eigen3ConfigVersion.cmake
|
||||
VERSION ${EIGEN_VERSION_NUMBER}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
set (CMAKE_SIZEOF_VOID_P ${_Eigen3_CMAKE_SIZEOF_VOID_P})
|
||||
else (CMAKE_VERSION VERSION_LESS 3.14)
|
||||
write_basic_package_version_file (Eigen3ConfigVersion.cmake
|
||||
VERSION ${EIGEN_VERSION_NUMBER}
|
||||
COMPATIBILITY SameMajorVersion
|
||||
ARCH_INDEPENDENT)
|
||||
endif (CMAKE_VERSION VERSION_LESS 3.14)
|
||||
set(CVF_VERSION "${EIGEN_VERSION_NUMBER}")
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Eigen3ConfigVersion.cmake.in"
|
||||
"Eigen3ConfigVersion.cmake"
|
||||
@ONLY)
|
||||
|
||||
# The Eigen target will be located in the Eigen3 namespace. Other CMake
|
||||
# targets can refer to it using Eigen3::Eigen.
|
||||
@ -787,5 +802,5 @@ if(PROJECT_IS_TOP_LEVEL)
|
||||
endif()
|
||||
|
||||
message(STATUS "")
|
||||
message(STATUS "Configured Eigen ${EIGEN_VERSION_NUMBER}")
|
||||
message(STATUS "Configured Eigen ${EIGEN_VERSION_STRING}")
|
||||
message(STATUS "")
|
||||
|
64
Eigen/Core
64
Eigen/Core
@ -11,6 +11,9 @@
|
||||
#ifndef EIGEN_CORE_MODULE_H
|
||||
#define EIGEN_CORE_MODULE_H
|
||||
|
||||
// Eigen version information.
|
||||
#include "Version"
|
||||
|
||||
// first thing Eigen does: stop the compiler from reporting useless warnings.
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
@ -92,6 +95,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
// for std::is_nothrow_move_assignable
|
||||
@ -102,6 +106,11 @@
|
||||
#include <thread>
|
||||
#endif
|
||||
|
||||
// for std::bit_cast()
|
||||
#if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L
|
||||
#include <bit>
|
||||
#endif
|
||||
|
||||
// for outputting debug info
|
||||
#ifdef EIGEN_DEBUG_ASSIGN
|
||||
#include <iostream>
|
||||
@ -121,7 +130,6 @@
|
||||
#undef isfinite
|
||||
#include <CL/sycl.hpp>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
#ifndef EIGEN_SYCL_LOCAL_THREAD_DIM0
|
||||
@ -192,36 +200,51 @@ using std::ptrdiff_t;
|
||||
#include "src/Core/arch/Default/BFloat16.h"
|
||||
#include "src/Core/arch/Default/GenericPacketMathFunctionsFwd.h"
|
||||
|
||||
#if defined EIGEN_VECTORIZE_SSE
|
||||
#if defined EIGEN_VECTORIZE_AVX512
|
||||
#include "src/Core/arch/SSE/PacketMath.h"
|
||||
#include "src/Core/arch/SSE/Reductions.h"
|
||||
#include "src/Core/arch/SSE/Complex.h"
|
||||
#include "src/Core/arch/SSE/TypeCasting.h"
|
||||
#include "src/Core/arch/SSE/MathFunctions.h"
|
||||
#endif
|
||||
|
||||
#if defined EIGEN_VECTORIZE_AVX
|
||||
#include "src/Core/arch/AVX/PacketMath.h"
|
||||
#include "src/Core/arch/AVX/Reductions.h"
|
||||
#include "src/Core/arch/AVX/Complex.h"
|
||||
#include "src/Core/arch/AVX/TypeCasting.h"
|
||||
#include "src/Core/arch/AVX/MathFunctions.h"
|
||||
#endif
|
||||
|
||||
#if defined EIGEN_VECTORIZE_AVX512
|
||||
#include "src/Core/arch/AVX512/PacketMath.h"
|
||||
#include "src/Core/arch/AVX512/Reductions.h"
|
||||
#include "src/Core/arch/AVX512/Complex.h"
|
||||
#include "src/Core/arch/AVX512/TypeCasting.h"
|
||||
#include "src/Core/arch/AVX512/MathFunctions.h"
|
||||
#include "src/Core/arch/AVX512/TrsmKernel.h"
|
||||
#endif
|
||||
|
||||
#if defined EIGEN_VECTORIZE_AVX512FP16
|
||||
#include "src/Core/arch/AVX512/PacketMathFP16.h"
|
||||
#endif
|
||||
#include "src/Core/arch/SSE/TypeCasting.h"
|
||||
#include "src/Core/arch/AVX/TypeCasting.h"
|
||||
#include "src/Core/arch/AVX512/TypeCasting.h"
|
||||
#if defined EIGEN_VECTORIZE_AVX512FP16
|
||||
#include "src/Core/arch/AVX512/TypeCastingFP16.h"
|
||||
#endif
|
||||
#include "src/Core/arch/SSE/Complex.h"
|
||||
#include "src/Core/arch/AVX/Complex.h"
|
||||
#include "src/Core/arch/AVX512/Complex.h"
|
||||
#include "src/Core/arch/SSE/MathFunctions.h"
|
||||
#include "src/Core/arch/AVX/MathFunctions.h"
|
||||
#include "src/Core/arch/AVX512/MathFunctions.h"
|
||||
#if defined EIGEN_VECTORIZE_AVX512FP16
|
||||
#include "src/Core/arch/AVX512/MathFunctionsFP16.h"
|
||||
#endif
|
||||
#include "src/Core/arch/AVX512/TrsmKernel.h"
|
||||
#elif defined EIGEN_VECTORIZE_AVX
|
||||
// Use AVX for floats and doubles, SSE for integers
|
||||
#include "src/Core/arch/SSE/PacketMath.h"
|
||||
#include "src/Core/arch/SSE/Reductions.h"
|
||||
#include "src/Core/arch/SSE/TypeCasting.h"
|
||||
#include "src/Core/arch/SSE/Complex.h"
|
||||
#include "src/Core/arch/AVX/PacketMath.h"
|
||||
#include "src/Core/arch/AVX/Reductions.h"
|
||||
#include "src/Core/arch/AVX/TypeCasting.h"
|
||||
#include "src/Core/arch/AVX/Complex.h"
|
||||
#include "src/Core/arch/SSE/MathFunctions.h"
|
||||
#include "src/Core/arch/AVX/MathFunctions.h"
|
||||
#elif defined EIGEN_VECTORIZE_SSE
|
||||
#include "src/Core/arch/SSE/PacketMath.h"
|
||||
#include "src/Core/arch/SSE/Reductions.h"
|
||||
#include "src/Core/arch/SSE/TypeCasting.h"
|
||||
#include "src/Core/arch/SSE/MathFunctions.h"
|
||||
#include "src/Core/arch/SSE/Complex.h"
|
||||
#endif
|
||||
|
||||
#if defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX)
|
||||
#include "src/Core/arch/AltiVec/PacketMath.h"
|
||||
@ -312,6 +335,7 @@ using std::ptrdiff_t;
|
||||
#include "src/Core/Product.h"
|
||||
#include "src/Core/CoreEvaluators.h"
|
||||
#include "src/Core/AssignEvaluator.h"
|
||||
#include "src/Core/RealView.h"
|
||||
#include "src/Core/Assign.h"
|
||||
|
||||
#include "src/Core/ArrayBase.h"
|
||||
|
14
Eigen/Version
Normal file
14
Eigen/Version
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef EIGEN_VERSION_H
|
||||
#define EIGEN_VERSION_H
|
||||
|
||||
// The "WORLD" version will forever remain "3" for the "Eigen3" library.
|
||||
#define EIGEN_WORLD_VERSION 3
|
||||
// As of Eigen3 5.0.0, we have moved to Semantic Versioning (semver.org).
|
||||
#define EIGEN_MAJOR_VERSION 5
|
||||
#define EIGEN_MINOR_VERSION 0
|
||||
#define EIGEN_PATCH_VERSION 1
|
||||
#define EIGEN_PRERELEASE_VERSION "dev"
|
||||
#define EIGEN_BUILD_VERSION "master"
|
||||
#define EIGEN_VERSION_STRING "5.0.1-dev+master"
|
||||
|
||||
#endif // EIGEN_VERSION_H
|
@ -707,7 +707,7 @@ struct unary_evaluator<CwiseUnaryOp<core_cast_op<SrcType, DstType>, ArgType>, In
|
||||
Index packetOffset = offset * PacketSize;
|
||||
Index actualRow = IsRowMajor ? row : row + packetOffset;
|
||||
Index actualCol = IsRowMajor ? col + packetOffset : col;
|
||||
eigen_assert(check_array_bounds(actualRow, actualCol, 0, count) && "Array index out of bounds");
|
||||
eigen_assert(check_array_bounds(actualRow, actualCol, begin, count) && "Array index out of bounds");
|
||||
return m_argImpl.template packetSegment<LoadMode, PacketType>(actualRow, actualCol, begin, count);
|
||||
}
|
||||
template <int LoadMode, typename PacketType = SrcPacketType>
|
||||
@ -715,8 +715,8 @@ struct unary_evaluator<CwiseUnaryOp<core_cast_op<SrcType, DstType>, ArgType>, In
|
||||
Index offset) const {
|
||||
constexpr int PacketSize = unpacket_traits<PacketType>::size;
|
||||
Index packetOffset = offset * PacketSize;
|
||||
Index actualIndex = index + packetOffset + begin;
|
||||
eigen_assert(check_array_bounds(actualIndex, 0, count) && "Array index out of bounds");
|
||||
Index actualIndex = index + packetOffset;
|
||||
eigen_assert(check_array_bounds(actualIndex, begin, count) && "Array index out of bounds");
|
||||
return m_argImpl.template packetSegment<LoadMode, PacketType>(actualIndex, begin, count);
|
||||
}
|
||||
|
||||
@ -1048,22 +1048,33 @@ struct ternary_evaluator<CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>, IndexBased
|
||||
Data m_d;
|
||||
};
|
||||
|
||||
// specialization for expressions like (a < b).select(c, d) to enable full vectorization
|
||||
template <typename Arg1, typename Arg2, typename Scalar, typename CmpLhsType, typename CmpRhsType, ComparisonName cmp>
|
||||
struct evaluator<CwiseTernaryOp<scalar_boolean_select_op<Scalar, Scalar, bool>, Arg1, Arg2,
|
||||
CwiseBinaryOp<scalar_cmp_op<Scalar, Scalar, cmp, false>, CmpLhsType, CmpRhsType>>>
|
||||
: public ternary_evaluator<
|
||||
CwiseTernaryOp<scalar_boolean_select_op<Scalar, Scalar, Scalar>, Arg1, Arg2,
|
||||
CwiseBinaryOp<scalar_cmp_op<Scalar, Scalar, cmp, true>, CmpLhsType, CmpRhsType>>> {
|
||||
struct scalar_boolean_select_spec {
|
||||
using DummyTernaryOp = scalar_boolean_select_op<Scalar, Scalar, bool>;
|
||||
using DummyArg3 = CwiseBinaryOp<scalar_cmp_op<Scalar, Scalar, cmp, false>, CmpLhsType, CmpRhsType>;
|
||||
using DummyXprType = CwiseTernaryOp<DummyTernaryOp, Arg1, Arg2, DummyArg3>;
|
||||
|
||||
using TernaryOp = scalar_boolean_select_op<Scalar, Scalar, Scalar>;
|
||||
using Arg3 = CwiseBinaryOp<scalar_cmp_op<Scalar, Scalar, cmp, true>, CmpLhsType, CmpRhsType>;
|
||||
// only use the typed comparison if it is vectorized
|
||||
static constexpr bool UseTyped = functor_traits<scalar_cmp_op<Scalar, Scalar, cmp, true>>::PacketAccess;
|
||||
using CondScalar = std::conditional_t<UseTyped, Scalar, bool>;
|
||||
|
||||
using TernaryOp = scalar_boolean_select_op<Scalar, Scalar, CondScalar>;
|
||||
using Arg3 = CwiseBinaryOp<scalar_cmp_op<Scalar, Scalar, cmp, UseTyped>, CmpLhsType, CmpRhsType>;
|
||||
using XprType = CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3>;
|
||||
|
||||
using Base = ternary_evaluator<XprType>;
|
||||
};
|
||||
|
||||
// specialization for expressions like (a < b).select(c, d) to enable full vectorization
|
||||
template <typename Arg1, typename Arg2, typename Scalar, typename CmpLhsType, typename CmpRhsType, ComparisonName cmp>
|
||||
struct evaluator<CwiseTernaryOp<scalar_boolean_select_op<Scalar, Scalar, bool>, Arg1, Arg2,
|
||||
CwiseBinaryOp<scalar_cmp_op<Scalar, Scalar, cmp, false>, CmpLhsType, CmpRhsType>>>
|
||||
: public scalar_boolean_select_spec<Arg1, Arg2, Scalar, CmpLhsType, CmpRhsType, cmp>::Base {
|
||||
using Helper = scalar_boolean_select_spec<Arg1, Arg2, Scalar, CmpLhsType, CmpRhsType, cmp>;
|
||||
using Base = typename Helper::Base;
|
||||
using DummyXprType = typename Helper::DummyXprType;
|
||||
using Arg3 = typename Helper::Arg3;
|
||||
using XprType = typename Helper::XprType;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const DummyXprType& xpr)
|
||||
: Base(XprType(xpr.arg1(), xpr.arg2(), Arg3(xpr.arg3().lhs(), xpr.arg3().rhs()))) {}
|
||||
@ -1569,50 +1580,6 @@ struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /* HasDirectAc
|
||||
}
|
||||
};
|
||||
|
||||
// -------------------- Select --------------------
|
||||
// NOTE shall we introduce a ternary_evaluator?
|
||||
|
||||
// TODO enable vectorization for Select
|
||||
template <typename ConditionMatrixType, typename ThenMatrixType, typename ElseMatrixType>
|
||||
struct evaluator<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType>>
|
||||
: evaluator_base<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType>> {
|
||||
typedef Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> XprType;
|
||||
enum {
|
||||
CoeffReadCost = evaluator<ConditionMatrixType>::CoeffReadCost +
|
||||
plain_enum_max(evaluator<ThenMatrixType>::CoeffReadCost, evaluator<ElseMatrixType>::CoeffReadCost),
|
||||
|
||||
Flags = (unsigned int)evaluator<ThenMatrixType>::Flags & evaluator<ElseMatrixType>::Flags & HereditaryBits,
|
||||
|
||||
Alignment = plain_enum_min(evaluator<ThenMatrixType>::Alignment, evaluator<ElseMatrixType>::Alignment)
|
||||
};
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const XprType& select)
|
||||
: m_conditionImpl(select.conditionMatrix()), m_thenImpl(select.thenMatrix()), m_elseImpl(select.elseMatrix()) {
|
||||
EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
|
||||
}
|
||||
|
||||
typedef typename XprType::CoeffReturnType CoeffReturnType;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const {
|
||||
if (m_conditionImpl.coeff(row, col))
|
||||
return m_thenImpl.coeff(row, col);
|
||||
else
|
||||
return m_elseImpl.coeff(row, col);
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
|
||||
if (m_conditionImpl.coeff(index))
|
||||
return m_thenImpl.coeff(index);
|
||||
else
|
||||
return m_elseImpl.coeff(index);
|
||||
}
|
||||
|
||||
protected:
|
||||
evaluator<ConditionMatrixType> m_conditionImpl;
|
||||
evaluator<ThenMatrixType> m_thenImpl;
|
||||
evaluator<ElseMatrixType> m_elseImpl;
|
||||
};
|
||||
|
||||
// -------------------- Replicate --------------------
|
||||
|
||||
template <typename ArgType, int RowFactor, int ColFactor>
|
||||
|
@ -235,8 +235,7 @@ DenseBase<Derived>::Constant(const Scalar& value) {
|
||||
* \sa LinSpaced(Index,const Scalar&, const Scalar&), setLinSpaced(Index,const Scalar&,const Scalar&)
|
||||
*/
|
||||
template <typename Derived>
|
||||
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<
|
||||
Derived>::RandomAccessLinSpacedReturnType
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::RandomAccessLinSpacedReturnType
|
||||
DenseBase<Derived>::LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high) {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
return DenseBase<Derived>::NullaryExpr(size, internal::linspaced_op<Scalar>(low, high, size));
|
||||
@ -247,8 +246,7 @@ DenseBase<Derived>::LinSpaced(Sequential_t, Index size, const Scalar& low, const
|
||||
* \sa LinSpaced(const Scalar&, const Scalar&)
|
||||
*/
|
||||
template <typename Derived>
|
||||
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<
|
||||
Derived>::RandomAccessLinSpacedReturnType
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase<Derived>::RandomAccessLinSpacedReturnType
|
||||
DenseBase<Derived>::LinSpaced(Sequential_t, const Scalar& low, const Scalar& high) {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived)
|
||||
|
@ -306,12 +306,12 @@ class DenseBase
|
||||
EIGEN_DEVICE_FUNC static const ConstantReturnType Constant(Index size, const Scalar& value);
|
||||
EIGEN_DEVICE_FUNC static const ConstantReturnType Constant(const Scalar& value);
|
||||
|
||||
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType LinSpaced(Sequential_t, Index size,
|
||||
const Scalar& low,
|
||||
const Scalar& high);
|
||||
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType LinSpaced(Sequential_t,
|
||||
const Scalar& low,
|
||||
const Scalar& high);
|
||||
EIGEN_DEPRECATED_WITH_REASON("The method may result in accuracy loss. Use .EqualSpaced() instead.")
|
||||
EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType LinSpaced(Sequential_t, Index size, const Scalar& low,
|
||||
const Scalar& high);
|
||||
EIGEN_DEPRECATED_WITH_REASON("The method may result in accuracy loss. Use .EqualSpaced() instead.")
|
||||
EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType LinSpaced(Sequential_t, const Scalar& low,
|
||||
const Scalar& high);
|
||||
|
||||
EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType LinSpaced(Index size, const Scalar& low,
|
||||
const Scalar& high);
|
||||
@ -367,7 +367,12 @@ class DenseBase
|
||||
EIGEN_DEVICE_FUNC inline bool allFinite() const;
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator*=(const Scalar& other);
|
||||
template <bool Enable = !internal::is_same<Scalar, RealScalar>::value, typename = std::enable_if_t<Enable>>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator*=(const RealScalar& other);
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator/=(const Scalar& other);
|
||||
template <bool Enable = !internal::is_same<Scalar, RealScalar>::value, typename = std::enable_if_t<Enable>>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator/=(const RealScalar& other);
|
||||
|
||||
typedef internal::add_const_on_value_type_t<typename internal::eval<Derived>::type> EvalReturnType;
|
||||
/** \returns the matrix or vector obtained by evaluating this expression.
|
||||
@ -597,6 +602,13 @@ class DenseBase
|
||||
inline const_iterator end() const;
|
||||
inline const_iterator cend() const;
|
||||
|
||||
using RealViewReturnType = std::conditional_t<NumTraits<Scalar>::IsComplex, RealView<Derived>, Derived&>;
|
||||
using ConstRealViewReturnType =
|
||||
std::conditional_t<NumTraits<Scalar>::IsComplex, RealView<const Derived>, const Derived&>;
|
||||
|
||||
EIGEN_DEVICE_FUNC RealViewReturnType realView();
|
||||
EIGEN_DEVICE_FUNC ConstRealViewReturnType realView() const;
|
||||
|
||||
#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
|
||||
#define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
|
||||
#define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)
|
||||
|
@ -78,8 +78,9 @@ template <typename Xpr>
|
||||
struct eigen_fill_impl<Xpr, /*use_fill*/ true> {
|
||||
using Scalar = typename Xpr::Scalar;
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Xpr& dst, const Scalar& val) {
|
||||
const Scalar val_copy = val;
|
||||
using std::fill_n;
|
||||
fill_n(dst.data(), dst.size(), val);
|
||||
fill_n(dst.data(), dst.size(), val_copy);
|
||||
}
|
||||
template <typename SrcXpr>
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Xpr& dst, const SrcXpr& src) {
|
||||
@ -114,17 +115,15 @@ struct eigen_zero_impl<Xpr, /*use_memset*/ false> {
|
||||
template <typename Xpr>
|
||||
struct eigen_zero_impl<Xpr, /*use_memset*/ true> {
|
||||
using Scalar = typename Xpr::Scalar;
|
||||
static constexpr size_t max_bytes = (std::numeric_limits<std::ptrdiff_t>::max)();
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Xpr& dst) {
|
||||
const size_t num_bytes = dst.size() * sizeof(Scalar);
|
||||
if (num_bytes == 0) return;
|
||||
const std::ptrdiff_t num_bytes = dst.size() * static_cast<std::ptrdiff_t>(sizeof(Scalar));
|
||||
if (num_bytes <= 0) return;
|
||||
void* dst_ptr = static_cast<void*>(dst.data());
|
||||
#ifndef EIGEN_NO_DEBUG
|
||||
if (num_bytes > max_bytes) throw_std_bad_alloc();
|
||||
eigen_assert((dst_ptr != nullptr) && "null pointer dereference error!");
|
||||
#endif
|
||||
EIGEN_USING_STD(memset);
|
||||
memset(dst_ptr, 0, num_bytes);
|
||||
memset(dst_ptr, 0, static_cast<std::size_t>(num_bytes));
|
||||
}
|
||||
template <typename SrcXpr>
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Xpr& dst, const SrcXpr& src) {
|
||||
|
@ -65,7 +65,7 @@ struct default_packet_traits {
|
||||
HasAbsDiff = 0,
|
||||
HasBlend = 0,
|
||||
// This flag is used to indicate whether packet comparison is supported.
|
||||
// pcmp_eq, pcmp_lt and pcmp_le should be defined for it to be true.
|
||||
// pcmp_eq and pcmp_lt should be defined for it to be true.
|
||||
HasCmp = 0,
|
||||
|
||||
HasDiv = 0,
|
||||
@ -253,6 +253,12 @@ struct preinterpret_generic<Packet, Packet, true> {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet run(const Packet& a) { return a; }
|
||||
};
|
||||
|
||||
template <typename ComplexPacket>
|
||||
struct preinterpret_generic<typename unpacket_traits<ComplexPacket>::as_real, ComplexPacket, false> {
|
||||
using RealPacket = typename unpacket_traits<ComplexPacket>::as_real;
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RealPacket run(const ComplexPacket& a) { return a.v; }
|
||||
};
|
||||
|
||||
/** \internal \returns reinterpret_cast<Target>(a) */
|
||||
template <typename Target, typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Target preinterpret(const Packet& a) {
|
||||
@ -426,30 +432,6 @@ EIGEN_DEVICE_FUNC inline Packet pzero(const Packet& a) {
|
||||
return pzero_impl<Packet>::run(a);
|
||||
}
|
||||
|
||||
/** \internal \returns a <= b as a bit mask */
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet pcmp_le(const Packet& a, const Packet& b) {
|
||||
return a <= b ? ptrue(a) : pzero(a);
|
||||
}
|
||||
|
||||
/** \internal \returns a < b as a bit mask */
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet pcmp_lt(const Packet& a, const Packet& b) {
|
||||
return a < b ? ptrue(a) : pzero(a);
|
||||
}
|
||||
|
||||
/** \internal \returns a == b as a bit mask */
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet pcmp_eq(const Packet& a, const Packet& b) {
|
||||
return a == b ? ptrue(a) : pzero(a);
|
||||
}
|
||||
|
||||
/** \internal \returns a < b or a==NaN or b==NaN as a bit mask */
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet pcmp_lt_or_nan(const Packet& a, const Packet& b) {
|
||||
return a >= b ? pzero(a) : ptrue(a);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct bit_and {
|
||||
EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a & b; }
|
||||
@ -576,6 +558,30 @@ EIGEN_DEVICE_FUNC inline Packet pandnot(const Packet& a, const Packet& b) {
|
||||
return pand(a, pnot(b));
|
||||
}
|
||||
|
||||
/** \internal \returns a < b as a bit mask */
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet pcmp_lt(const Packet& a, const Packet& b) {
|
||||
return a < b ? ptrue(a) : pzero(a);
|
||||
}
|
||||
|
||||
/** \internal \returns a == b as a bit mask */
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet pcmp_eq(const Packet& a, const Packet& b) {
|
||||
return a == b ? ptrue(a) : pzero(a);
|
||||
}
|
||||
|
||||
/** \internal \returns a <= b as a bit mask */
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet pcmp_le(const Packet& a, const Packet& b) {
|
||||
return por(pcmp_eq(a, b), pcmp_lt(a, b));
|
||||
}
|
||||
|
||||
/** \internal \returns a < b or a==NaN or b==NaN as a bit mask */
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet pcmp_lt_or_nan(const Packet& a, const Packet& b) {
|
||||
return a >= b ? pzero(a) : ptrue(a);
|
||||
}
|
||||
|
||||
// In the general case, use bitwise select.
|
||||
template <typename Packet, bool is_scalar = is_scalar<Packet>::value>
|
||||
struct pselect_impl {
|
||||
@ -638,7 +644,7 @@ struct pminmax_impl<PropagateNumbers, false> {
|
||||
}
|
||||
};
|
||||
|
||||
#define EIGEN_BINARY_OP_NAN_PROPAGATION(Type, Func) [](const Type& a, const Type& b) { return Func(a, b); }
|
||||
#define EIGEN_BINARY_OP_NAN_PROPAGATION(Type, Func) [](const Type& aa, const Type& bb) { return Func(aa, bb); }
|
||||
|
||||
/** \internal \returns the min of \a a and \a b (coeff-wise).
|
||||
If \a a or \b b is NaN, the return value is implementation defined. */
|
||||
@ -1344,20 +1350,20 @@ struct pmadd_impl {
|
||||
template <typename Scalar>
|
||||
struct pmadd_impl<Scalar, std::enable_if_t<is_scalar<Scalar>::value && NumTraits<Scalar>::IsSigned>> {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar pmadd(const Scalar& a, const Scalar& b, const Scalar& c) {
|
||||
return numext::fma(a, b, c);
|
||||
return numext::madd<Scalar>(a, b, c);
|
||||
}
|
||||
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar pmsub(const Scalar& a, const Scalar& b, const Scalar& c) {
|
||||
return numext::fma(a, b, Scalar(-c));
|
||||
return numext::madd<Scalar>(a, b, Scalar(-c));
|
||||
}
|
||||
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar pnmadd(const Scalar& a, const Scalar& b, const Scalar& c) {
|
||||
return numext::fma(Scalar(-a), b, c);
|
||||
return numext::madd<Scalar>(Scalar(-a), b, c);
|
||||
}
|
||||
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Scalar pnmsub(const Scalar& a, const Scalar& b, const Scalar& c) {
|
||||
return -Scalar(numext::fma(a, b, c));
|
||||
return -Scalar(numext::madd<Scalar>(a, b, c));
|
||||
}
|
||||
};
|
||||
|
||||
// FMA instructions.
|
||||
// Multiply-add instructions.
|
||||
/** \internal \returns a * b + c (coeff-wise) */
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC inline Packet pmadd(const Packet& a, const Packet& b, const Packet& c) {
|
||||
@ -1596,9 +1602,10 @@ EIGEN_DEVICE_FUNC inline Packet ploaduSegment(const typename unpacket_traits<Pac
|
||||
using Scalar = typename unpacket_traits<Packet>::type;
|
||||
constexpr Index PacketSize = unpacket_traits<Packet>::size;
|
||||
eigen_assert((begin >= 0 && count >= 0 && begin + count <= PacketSize) && "invalid range");
|
||||
Scalar aux[PacketSize];
|
||||
memset(static_cast<void*>(aux), 0x00, sizeof(Scalar) * PacketSize);
|
||||
smart_copy(from + begin, from + begin + count, aux + begin);
|
||||
Scalar aux[PacketSize] = {};
|
||||
for (Index k = begin; k < begin + count; k++) {
|
||||
aux[k] = from[k];
|
||||
}
|
||||
return ploadu<Packet>(aux);
|
||||
}
|
||||
|
||||
@ -1619,7 +1626,9 @@ EIGEN_DEVICE_FUNC inline void pstoreuSegment(Scalar* to, const Packet& from, Ind
|
||||
eigen_assert((begin >= 0 && count >= 0 && begin + count <= PacketSize) && "invalid range");
|
||||
Scalar aux[PacketSize];
|
||||
pstoreu<Scalar, Packet>(aux, from);
|
||||
smart_copy(aux + begin, aux + begin + count, to + begin);
|
||||
for (Index k = begin; k < begin + count; k++) {
|
||||
to[k] = aux[k];
|
||||
}
|
||||
}
|
||||
|
||||
/** \internal copy the packet \a from in the range [begin, begin + count) to \a *to.
|
||||
|
@ -308,6 +308,12 @@ struct unary_evaluator<IndexedView<ArgType, RowIndices, ColIndices>, IndexBased>
|
||||
const XprType& m_xpr;
|
||||
};
|
||||
|
||||
// Catch assignments to an IndexedView.
|
||||
template <typename ArgType, typename RowIndices, typename ColIndices>
|
||||
struct evaluator_assume_aliasing<IndexedView<ArgType, RowIndices, ColIndices>> {
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
} // end namespace Eigen
|
||||
|
@ -211,8 +211,14 @@ struct scalar_inner_product_op {
|
||||
static constexpr bool PacketAccess = false;
|
||||
};
|
||||
|
||||
// Partial specialization for packet access if and only if
|
||||
// LhsScalar == RhsScalar == ScalarBinaryOpTraits<LhsScalar, RhsScalar>::ReturnType.
|
||||
template <typename Scalar, bool Conj>
|
||||
struct scalar_inner_product_op<Scalar, Scalar, Conj> {
|
||||
struct scalar_inner_product_op<
|
||||
Scalar,
|
||||
typename std::enable_if<internal::is_same<typename ScalarBinaryOpTraits<Scalar, Scalar>::ReturnType, Scalar>::value,
|
||||
Scalar>::type,
|
||||
Conj> {
|
||||
using result_type = Scalar;
|
||||
using conj_helper = conditional_conj<Scalar, Conj>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar coeff(const Scalar& a, const Scalar& b) const {
|
||||
|
@ -941,23 +941,43 @@ struct nearest_integer_impl<Scalar, true> {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run_trunc(const Scalar& x) { return x; }
|
||||
};
|
||||
|
||||
// Extra namespace to prevent leaking std::fma into Eigen::internal.
|
||||
namespace has_fma_detail {
|
||||
|
||||
template <typename T, typename EnableIf = void>
|
||||
struct has_fma_impl : public std::false_type {};
|
||||
|
||||
using std::fma;
|
||||
|
||||
template <typename T>
|
||||
struct has_fma_impl<
|
||||
T, std::enable_if_t<std::is_same<T, decltype(fma(std::declval<T>(), std::declval<T>(), std::declval<T>()))>::value>>
|
||||
: public std::true_type {};
|
||||
|
||||
} // namespace has_fma_detail
|
||||
|
||||
template <typename T>
|
||||
struct has_fma : public has_fma_detail::has_fma_impl<T> {};
|
||||
|
||||
// Default implementation.
|
||||
template <typename Scalar, typename Enable = void>
|
||||
template <typename T, typename Enable = void>
|
||||
struct fma_impl {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run(const Scalar& a, const Scalar& b, const Scalar& c) {
|
||||
return a * b + c;
|
||||
static_assert(has_fma<T>::value, "No function fma(...) for type. Please provide an implementation.");
|
||||
};
|
||||
|
||||
// STD or ADL version if it exists.
|
||||
template <typename T>
|
||||
struct fma_impl<T, std::enable_if_t<has_fma<T>::value>> {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T run(const T& a, const T& b, const T& c) {
|
||||
using std::fma;
|
||||
return fma(a, b, c);
|
||||
}
|
||||
};
|
||||
|
||||
// ADL version if it exists.
|
||||
template <typename T>
|
||||
struct fma_impl<
|
||||
T,
|
||||
std::enable_if_t<std::is_same<T, decltype(fma(std::declval<T>(), std::declval<T>(), std::declval<T>()))>::value>> {
|
||||
static T run(const T& a, const T& b, const T& c) { return fma(a, b, c); }
|
||||
};
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
template <>
|
||||
struct has_fma<float> : public true_type {};
|
||||
|
||||
template <>
|
||||
struct fma_impl<float, void> {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE float run(const float& a, const float& b, const float& c) {
|
||||
@ -965,6 +985,9 @@ struct fma_impl<float, void> {
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct has_fma<double> : public true_type {};
|
||||
|
||||
template <>
|
||||
struct fma_impl<double, void> {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double run(const double& a, const double& b, const double& c) {
|
||||
@ -973,6 +996,24 @@ struct fma_impl<double, void> {
|
||||
};
|
||||
#endif
|
||||
|
||||
// Basic multiply-add.
|
||||
template <typename Scalar, typename EnableIf = void>
|
||||
struct madd_impl {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run(const Scalar& x, const Scalar& y, const Scalar& z) {
|
||||
return x * y + z;
|
||||
}
|
||||
};
|
||||
|
||||
// Use FMA if there is a single CPU instruction.
|
||||
#ifdef EIGEN_VECTORIZE_FMA
|
||||
template <typename Scalar>
|
||||
struct madd_impl<Scalar, std::enable_if_t<has_fma<Scalar>::value>> {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar run(const Scalar& x, const Scalar& y, const Scalar& z) {
|
||||
return fma_impl<Scalar>::run(x, y, z);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
/****************************************************************************
|
||||
@ -1886,15 +1927,18 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar arithmetic_shift_right(const Scalar
|
||||
return bit_cast<Scalar, SignedScalar>(bit_cast<SignedScalar, Scalar>(a) >> n);
|
||||
}
|
||||
|
||||
// Use std::fma if available.
|
||||
using std::fma;
|
||||
|
||||
// Otherwise, rely on template implementation.
|
||||
template <typename Scalar>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar fma(const Scalar& x, const Scalar& y, const Scalar& z) {
|
||||
return internal::fma_impl<Scalar>::run(x, y, z);
|
||||
}
|
||||
|
||||
// Multiply-add.
|
||||
template <typename Scalar>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar madd(const Scalar& x, const Scalar& y, const Scalar& z) {
|
||||
return internal::madd_impl<Scalar>::run(x, y, z);
|
||||
}
|
||||
|
||||
} // end namespace numext
|
||||
|
||||
namespace internal {
|
||||
|
@ -28,7 +28,7 @@ namespace internal {
|
||||
2. If a is zero, approx_a_recip must be infinite with the same sign as a.
|
||||
3. If a is infinite, approx_a_recip must be zero with the same sign as a.
|
||||
|
||||
If the preconditions are satisfied, which they are for for the _*_rcp_ps
|
||||
If the preconditions are satisfied, which they are for the _*_rcp_ps
|
||||
instructions on x86, the result has a maximum relative error of 2 ulps,
|
||||
and correctly handles reciprocals of zero, infinity, and NaN.
|
||||
*/
|
||||
@ -66,7 +66,7 @@ struct generic_reciprocal_newton_step<Packet, 0> {
|
||||
2. If a is zero, approx_a_recip must be infinite with the same sign as a.
|
||||
3. If a is infinite, approx_a_recip must be zero with the same sign as a.
|
||||
|
||||
If the preconditions are satisfied, which they are for for the _*_rcp_ps
|
||||
If the preconditions are satisfied, which they are for the _*_rcp_ps
|
||||
instructions on x86, the result has a maximum relative error of 2 ulps,
|
||||
and correctly handles zero, infinity, and NaN. Positive denormals are
|
||||
treated as zero.
|
||||
@ -116,7 +116,7 @@ struct generic_rsqrt_newton_step<Packet, 0> {
|
||||
2. If a is zero, approx_rsqrt must be infinite.
|
||||
3. If a is infinite, approx_rsqrt must be zero.
|
||||
|
||||
If the preconditions are satisfied, which they are for for the _*_rsqrt_ps
|
||||
If the preconditions are satisfied, which they are for the _*_rsqrt_ps
|
||||
instructions on x86, the result has a maximum relative error of 2 ulps,
|
||||
and correctly handles zero and infinity, and NaN. Positive denormal inputs
|
||||
are treated as zero.
|
||||
|
@ -373,12 +373,14 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
template <int Options = 0>
|
||||
inline JacobiSVD<PlainObject, Options> jacobiSvd() const;
|
||||
template <int Options = 0>
|
||||
EIGEN_DEPRECATED inline JacobiSVD<PlainObject, Options> jacobiSvd(unsigned int computationOptions) const;
|
||||
EIGEN_DEPRECATED_WITH_REASON("Options should be specified using method's template parameter.")
|
||||
inline JacobiSVD<PlainObject, Options> jacobiSvd(unsigned int computationOptions) const;
|
||||
|
||||
template <int Options = 0>
|
||||
inline BDCSVD<PlainObject, Options> bdcSvd() const;
|
||||
template <int Options = 0>
|
||||
EIGEN_DEPRECATED inline BDCSVD<PlainObject, Options> bdcSvd(unsigned int computationOptions) const;
|
||||
EIGEN_DEPRECATED_WITH_REASON("Options should be specified using method's template parameter.")
|
||||
inline BDCSVD<PlainObject, Options> bdcSvd(unsigned int computationOptions) const;
|
||||
|
||||
/////////// Geometry module ///////////
|
||||
|
||||
@ -391,7 +393,8 @@ class MatrixBase : public DenseBase<Derived> {
|
||||
|
||||
EIGEN_DEVICE_FUNC inline PlainObject unitOrthogonal(void) const;
|
||||
|
||||
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline Matrix<Scalar, 3, 1> eulerAngles(Index a0, Index a1, Index a2) const;
|
||||
EIGEN_DEPRECATED_WITH_REASON("Use .canonicalEulerAngles() instead.")
|
||||
EIGEN_DEVICE_FUNC inline Matrix<Scalar, 3, 1> eulerAngles(Index a0, Index a1, Index a2) const;
|
||||
|
||||
EIGEN_DEVICE_FUNC inline Matrix<Scalar, 3, 1> canonicalEulerAngles(Index a0, Index a1, Index a2) const;
|
||||
|
||||
|
@ -95,9 +95,22 @@ struct default_max_digits10_impl<T, false, true> // Integer
|
||||
} // end namespace internal
|
||||
|
||||
namespace numext {
|
||||
/** \internal bit-wise cast without changing the underlying bit representation. */
|
||||
|
||||
// TODO: Replace by std::bit_cast (available in C++20)
|
||||
/** \internal bit-wise cast without changing the underlying bit representation. */
|
||||
#if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L
|
||||
template <typename Tgt, typename Src>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr Tgt bit_cast(const Src& src) {
|
||||
return std::bit_cast<Tgt>(src);
|
||||
}
|
||||
#elif EIGEN_HAS_BUILTIN(__builtin_bit_cast)
|
||||
template <typename Tgt, typename Src>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr Tgt bit_cast(const Src& src) {
|
||||
EIGEN_STATIC_ASSERT(std::is_trivially_copyable<Src>::value, THIS_TYPE_IS_NOT_SUPPORTED)
|
||||
EIGEN_STATIC_ASSERT(std::is_trivially_copyable<Tgt>::value, THIS_TYPE_IS_NOT_SUPPORTED)
|
||||
EIGEN_STATIC_ASSERT(sizeof(Src) == sizeof(Tgt), THIS_TYPE_IS_NOT_SUPPORTED)
|
||||
return __builtin_bit_cast(Tgt, src);
|
||||
}
|
||||
#else
|
||||
template <typename Tgt, typename Src>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Tgt bit_cast(const Src& src) {
|
||||
// The behaviour of memcpy is not specified for non-trivially copyable types
|
||||
@ -113,6 +126,7 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Tgt bit_cast(const Src& src) {
|
||||
memcpy(static_cast<void*>(&tgt), static_cast<const void*>(&staged), sizeof(Tgt));
|
||||
return tgt;
|
||||
}
|
||||
#endif
|
||||
} // namespace numext
|
||||
|
||||
// clang-format off
|
||||
|
@ -109,6 +109,9 @@ class PermutationBase : public EigenBase<Derived> {
|
||||
*/
|
||||
DenseMatrixType toDenseMatrix() const { return derived(); }
|
||||
|
||||
/** \returns the plain matrix representation of the permutation. */
|
||||
DenseMatrixType eval() const { return toDenseMatrix(); }
|
||||
|
||||
/** const version of indices(). */
|
||||
const IndicesType& indices() const { return derived().indices(); }
|
||||
/** \returns a reference to the stored array representing the permutation. */
|
||||
@ -468,17 +471,17 @@ class PermutationWrapper : public PermutationBase<PermutationWrapper<IndicesType
|
||||
/** \returns the matrix with the permutation applied to the columns.
|
||||
*/
|
||||
template <typename MatrixDerived, typename PermutationDerived>
|
||||
EIGEN_DEVICE_FUNC const Product<MatrixDerived, PermutationDerived, AliasFreeProduct> operator*(
|
||||
EIGEN_DEVICE_FUNC const Product<MatrixDerived, PermutationDerived, DefaultProduct> operator*(
|
||||
const MatrixBase<MatrixDerived>& matrix, const PermutationBase<PermutationDerived>& permutation) {
|
||||
return Product<MatrixDerived, PermutationDerived, AliasFreeProduct>(matrix.derived(), permutation.derived());
|
||||
return Product<MatrixDerived, PermutationDerived, DefaultProduct>(matrix.derived(), permutation.derived());
|
||||
}
|
||||
|
||||
/** \returns the matrix with the permutation applied to the rows.
|
||||
*/
|
||||
template <typename PermutationDerived, typename MatrixDerived>
|
||||
EIGEN_DEVICE_FUNC const Product<PermutationDerived, MatrixDerived, AliasFreeProduct> operator*(
|
||||
EIGEN_DEVICE_FUNC const Product<PermutationDerived, MatrixDerived, DefaultProduct> operator*(
|
||||
const PermutationBase<PermutationDerived>& permutation, const MatrixBase<MatrixDerived>& matrix) {
|
||||
return Product<PermutationDerived, MatrixDerived, AliasFreeProduct>(permutation.derived(), matrix.derived());
|
||||
return Product<PermutationDerived, MatrixDerived, DefaultProduct>(permutation.derived(), matrix.derived());
|
||||
}
|
||||
|
||||
template <typename PermutationType>
|
||||
@ -520,16 +523,16 @@ class InverseImpl<PermutationType, PermutationStorage> : public EigenBase<Invers
|
||||
/** \returns the matrix with the inverse permutation applied to the columns.
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
friend const Product<OtherDerived, InverseType, AliasFreeProduct> operator*(const MatrixBase<OtherDerived>& matrix,
|
||||
const InverseType& trPerm) {
|
||||
return Product<OtherDerived, InverseType, AliasFreeProduct>(matrix.derived(), trPerm.derived());
|
||||
friend const Product<OtherDerived, InverseType, DefaultProduct> operator*(const MatrixBase<OtherDerived>& matrix,
|
||||
const InverseType& trPerm) {
|
||||
return Product<OtherDerived, InverseType, DefaultProduct>(matrix.derived(), trPerm.derived());
|
||||
}
|
||||
|
||||
/** \returns the matrix with the inverse permutation applied to the rows.
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
const Product<InverseType, OtherDerived, AliasFreeProduct> operator*(const MatrixBase<OtherDerived>& matrix) const {
|
||||
return Product<InverseType, OtherDerived, AliasFreeProduct>(derived(), matrix.derived());
|
||||
const Product<InverseType, OtherDerived, DefaultProduct> operator*(const MatrixBase<OtherDerived>& matrix) const {
|
||||
return Product<InverseType, OtherDerived, DefaultProduct>(derived(), matrix.derived());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1269,6 +1269,22 @@ struct generic_product_impl<Lhs, Rhs, SkewSymmetricShape, SkewSymmetricShape, Pr
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Lhs, typename Rhs, int ProductTag, typename MatrixShape>
|
||||
struct generic_product_impl<Lhs, Rhs, MatrixShape, HomogeneousShape, ProductTag>
|
||||
: generic_product_impl<Lhs, typename Rhs::PlainObject, MatrixShape, DenseShape, ProductTag> {};
|
||||
|
||||
template <typename Lhs, typename Rhs, int ProductTag, typename MatrixShape>
|
||||
struct generic_product_impl<Lhs, Rhs, HomogeneousShape, MatrixShape, ProductTag>
|
||||
: generic_product_impl<typename Lhs::PlainObject, Rhs, DenseShape, MatrixShape, ProductTag> {};
|
||||
|
||||
template <typename Lhs, typename Rhs, int ProductTag>
|
||||
struct generic_product_impl<Lhs, Rhs, PermutationShape, HomogeneousShape, ProductTag>
|
||||
: generic_product_impl<Lhs, Rhs, PermutationShape, DenseShape, ProductTag> {};
|
||||
|
||||
template <typename Lhs, typename Rhs, int ProductTag>
|
||||
struct generic_product_impl<Lhs, Rhs, HomogeneousShape, PermutationShape, ProductTag>
|
||||
: generic_product_impl<Lhs, Rhs, DenseShape, PermutationShape, ProductTag> {};
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
} // end namespace Eigen
|
||||
|
@ -131,8 +131,15 @@ struct random_longdouble_impl {
|
||||
uint64_t randomBits[2];
|
||||
long double result = 2.0L;
|
||||
memcpy(&randomBits, &result, Size);
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
randomBits[0] |= getRandomBits<uint64_t>(numLowBits);
|
||||
randomBits[1] |= getRandomBits<uint64_t>(numHighBits);
|
||||
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
randomBits[0] |= getRandomBits<uint64_t>(numHighBits);
|
||||
randomBits[1] |= getRandomBits<uint64_t>(numLowBits);
|
||||
#else
|
||||
#error Unexpected or undefined __BYTE_ORDER__
|
||||
#endif
|
||||
memcpy(&result, &randomBits, Size);
|
||||
result -= 3.0L;
|
||||
return result;
|
||||
|
250
Eigen/src/Core/RealView.h
Normal file
250
Eigen/src/Core/RealView.h
Normal file
@ -0,0 +1,250 @@
|
||||
// This file is part of Eigen, a lightweight C++ template library
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2025 Charlie Schlosser <cs.schlosser@gmail.com>
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef EIGEN_REALVIEW_H
|
||||
#define EIGEN_REALVIEW_H
|
||||
|
||||
// IWYU pragma: private
|
||||
#include "./InternalHeaderCheck.h"
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
namespace internal {
|
||||
|
||||
// Vectorized assignment to RealView requires array-oriented access to the real and imaginary components.
|
||||
// From https://en.cppreference.com/w/cpp/numeric/complex.html:
|
||||
// For any pointer to an element of an array of std::complex<T> named p and any valid array index i,
|
||||
// reinterpret_cast<T*>(p)[2 * i] is the real part of the complex number p[i], and
|
||||
// reinterpret_cast<T*>(p)[2 * i + 1] is the imaginary part of the complex number p[i].
|
||||
|
||||
template <typename ComplexScalar>
|
||||
struct complex_array_access : std::false_type {};
|
||||
template <>
|
||||
struct complex_array_access<std::complex<float>> : std::true_type {};
|
||||
template <>
|
||||
struct complex_array_access<std::complex<double>> : std::true_type {};
|
||||
template <>
|
||||
struct complex_array_access<std::complex<long double>> : std::true_type {};
|
||||
|
||||
template <typename Xpr>
|
||||
struct traits<RealView<Xpr>> : public traits<Xpr> {
|
||||
template <typename T>
|
||||
static constexpr int double_size(T size, bool times_two) {
|
||||
int size_as_int = int(size);
|
||||
if (size_as_int == Dynamic) return Dynamic;
|
||||
return times_two ? (2 * size_as_int) : size_as_int;
|
||||
}
|
||||
using Base = traits<Xpr>;
|
||||
using ComplexScalar = typename Base::Scalar;
|
||||
using Scalar = typename NumTraits<ComplexScalar>::Real;
|
||||
static constexpr int ActualDirectAccessBit = complex_array_access<ComplexScalar>::value ? DirectAccessBit : 0;
|
||||
static constexpr int ActualPacketAccessBit = packet_traits<Scalar>::Vectorizable ? PacketAccessBit : 0;
|
||||
static constexpr int FlagMask =
|
||||
ActualDirectAccessBit | ActualPacketAccessBit | HereditaryBits | LinearAccessBit | LvalueBit;
|
||||
static constexpr int BaseFlags = int(evaluator<Xpr>::Flags) | int(Base::Flags);
|
||||
static constexpr int Flags = BaseFlags & FlagMask;
|
||||
static constexpr bool IsRowMajor = Flags & RowMajorBit;
|
||||
static constexpr int RowsAtCompileTime = double_size(Base::RowsAtCompileTime, !IsRowMajor);
|
||||
static constexpr int ColsAtCompileTime = double_size(Base::ColsAtCompileTime, IsRowMajor);
|
||||
static constexpr int SizeAtCompileTime = size_at_compile_time(RowsAtCompileTime, ColsAtCompileTime);
|
||||
static constexpr int MaxRowsAtCompileTime = double_size(Base::MaxRowsAtCompileTime, !IsRowMajor);
|
||||
static constexpr int MaxColsAtCompileTime = double_size(Base::MaxColsAtCompileTime, IsRowMajor);
|
||||
static constexpr int MaxSizeAtCompileTime = size_at_compile_time(MaxRowsAtCompileTime, MaxColsAtCompileTime);
|
||||
static constexpr int OuterStrideAtCompileTime = double_size(outer_stride_at_compile_time<Xpr>::ret, true);
|
||||
static constexpr int InnerStrideAtCompileTime = inner_stride_at_compile_time<Xpr>::ret;
|
||||
};
|
||||
|
||||
template <typename Xpr>
|
||||
struct evaluator<RealView<Xpr>> : private evaluator<Xpr> {
|
||||
using BaseEvaluator = evaluator<Xpr>;
|
||||
using XprType = RealView<Xpr>;
|
||||
using ExpressionTraits = traits<XprType>;
|
||||
using ComplexScalar = typename ExpressionTraits::ComplexScalar;
|
||||
using ComplexCoeffReturnType = typename BaseEvaluator::CoeffReturnType;
|
||||
using Scalar = typename ExpressionTraits::Scalar;
|
||||
|
||||
static constexpr bool IsRowMajor = ExpressionTraits::IsRowMajor;
|
||||
static constexpr int Flags = ExpressionTraits::Flags;
|
||||
static constexpr int CoeffReadCost = BaseEvaluator::CoeffReadCost;
|
||||
static constexpr int Alignment = BaseEvaluator::Alignment;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(XprType realView) : BaseEvaluator(realView.m_xpr) {}
|
||||
|
||||
template <bool Enable = std::is_reference<ComplexCoeffReturnType>::value, typename = std::enable_if_t<!Enable>>
|
||||
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar coeff(Index row, Index col) const {
|
||||
ComplexCoeffReturnType cscalar = BaseEvaluator::coeff(IsRowMajor ? row : row / 2, IsRowMajor ? col / 2 : col);
|
||||
Index p = (IsRowMajor ? col : row) & 1;
|
||||
return p ? numext::real(cscalar) : numext::imag(cscalar);
|
||||
}
|
||||
|
||||
template <bool Enable = std::is_reference<ComplexCoeffReturnType>::value, typename = std::enable_if_t<Enable>>
|
||||
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar& coeff(Index row, Index col) const {
|
||||
ComplexCoeffReturnType cscalar = BaseEvaluator::coeff(IsRowMajor ? row : row / 2, IsRowMajor ? col / 2 : col);
|
||||
Index p = (IsRowMajor ? col : row) & 1;
|
||||
return reinterpret_cast<const Scalar(&)[2]>(cscalar)[p];
|
||||
}
|
||||
|
||||
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) {
|
||||
ComplexScalar& cscalar = BaseEvaluator::coeffRef(IsRowMajor ? row : row / 2, IsRowMajor ? col / 2 : col);
|
||||
Index p = (IsRowMajor ? col : row) & 1;
|
||||
return reinterpret_cast<Scalar(&)[2]>(cscalar)[p];
|
||||
}
|
||||
|
||||
template <bool Enable = std::is_reference<ComplexCoeffReturnType>::value, typename = std::enable_if_t<!Enable>>
|
||||
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar coeff(Index index) const {
|
||||
ComplexCoeffReturnType cscalar = BaseEvaluator::coeff(index / 2);
|
||||
Index p = index & 1;
|
||||
return p ? numext::real(cscalar) : numext::imag(cscalar);
|
||||
}
|
||||
|
||||
template <bool Enable = std::is_reference<ComplexCoeffReturnType>::value, typename = std::enable_if_t<Enable>>
|
||||
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar& coeff(Index index) const {
|
||||
ComplexCoeffReturnType cscalar = BaseEvaluator::coeff(index / 2);
|
||||
Index p = index & 1;
|
||||
return reinterpret_cast<const Scalar(&)[2]>(cscalar)[p];
|
||||
}
|
||||
|
||||
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
|
||||
ComplexScalar& cscalar = BaseEvaluator::coeffRef(index / 2);
|
||||
Index p = index & 1;
|
||||
return reinterpret_cast<Scalar(&)[2]>(cscalar)[p];
|
||||
}
|
||||
|
||||
template <int LoadMode, typename PacketType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const {
|
||||
constexpr int RealPacketSize = unpacket_traits<PacketType>::size;
|
||||
using ComplexPacket = typename find_packet_by_size<ComplexScalar, RealPacketSize / 2>::type;
|
||||
EIGEN_STATIC_ASSERT((find_packet_by_size<ComplexScalar, RealPacketSize / 2>::value),
|
||||
MISSING COMPATIBLE COMPLEX PACKET TYPE)
|
||||
eigen_assert(((IsRowMajor ? col : row) % 2 == 0) && "the inner index must be even");
|
||||
|
||||
Index crow = IsRowMajor ? row : row / 2;
|
||||
Index ccol = IsRowMajor ? col / 2 : col;
|
||||
ComplexPacket cpacket = BaseEvaluator::template packet<LoadMode, ComplexPacket>(crow, ccol);
|
||||
return preinterpret<PacketType, ComplexPacket>(cpacket);
|
||||
}
|
||||
|
||||
template <int LoadMode, typename PacketType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketType packet(Index index) const {
|
||||
constexpr int RealPacketSize = unpacket_traits<PacketType>::size;
|
||||
using ComplexPacket = typename find_packet_by_size<ComplexScalar, RealPacketSize / 2>::type;
|
||||
EIGEN_STATIC_ASSERT((find_packet_by_size<ComplexScalar, RealPacketSize / 2>::value),
|
||||
MISSING COMPATIBLE COMPLEX PACKET TYPE)
|
||||
eigen_assert((index % 2 == 0) && "the index must be even");
|
||||
|
||||
Index cindex = index / 2;
|
||||
ComplexPacket cpacket = BaseEvaluator::template packet<LoadMode, ComplexPacket>(cindex);
|
||||
return preinterpret<PacketType, ComplexPacket>(cpacket);
|
||||
}
|
||||
|
||||
template <int LoadMode, typename PacketType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketType packetSegment(Index row, Index col, Index begin, Index count) const {
|
||||
constexpr int RealPacketSize = unpacket_traits<PacketType>::size;
|
||||
using ComplexPacket = typename find_packet_by_size<ComplexScalar, RealPacketSize / 2>::type;
|
||||
EIGEN_STATIC_ASSERT((find_packet_by_size<ComplexScalar, RealPacketSize / 2>::value),
|
||||
MISSING COMPATIBLE COMPLEX PACKET TYPE)
|
||||
eigen_assert(((IsRowMajor ? col : row) % 2 == 0) && "the inner index must be even");
|
||||
eigen_assert((begin % 2 == 0) && (count % 2 == 0) && "begin and count must be even");
|
||||
|
||||
Index crow = IsRowMajor ? row : row / 2;
|
||||
Index ccol = IsRowMajor ? col / 2 : col;
|
||||
Index cbegin = begin / 2;
|
||||
Index ccount = count / 2;
|
||||
ComplexPacket cpacket = BaseEvaluator::template packetSegment<LoadMode, ComplexPacket>(crow, ccol, cbegin, ccount);
|
||||
return preinterpret<PacketType, ComplexPacket>(cpacket);
|
||||
}
|
||||
|
||||
template <int LoadMode, typename PacketType>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketType packetSegment(Index index, Index begin, Index count) const {
|
||||
constexpr int RealPacketSize = unpacket_traits<PacketType>::size;
|
||||
using ComplexPacket = typename find_packet_by_size<ComplexScalar, RealPacketSize / 2>::type;
|
||||
EIGEN_STATIC_ASSERT((find_packet_by_size<ComplexScalar, RealPacketSize / 2>::value),
|
||||
MISSING COMPATIBLE COMPLEX PACKET TYPE)
|
||||
eigen_assert((index % 2 == 0) && "the index must be even");
|
||||
eigen_assert((begin % 2 == 0) && (count % 2 == 0) && "begin and count must be even");
|
||||
|
||||
Index cindex = index / 2;
|
||||
Index cbegin = begin / 2;
|
||||
Index ccount = count / 2;
|
||||
ComplexPacket cpacket = BaseEvaluator::template packetSegment<LoadMode, ComplexPacket>(cindex, cbegin, ccount);
|
||||
return preinterpret<PacketType, ComplexPacket>(cpacket);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
template <typename Xpr>
|
||||
class RealView : public internal::dense_xpr_base<RealView<Xpr>>::type {
|
||||
using ExpressionTraits = internal::traits<RealView>;
|
||||
EIGEN_STATIC_ASSERT(NumTraits<typename Xpr::Scalar>::IsComplex, SCALAR MUST BE COMPLEX)
|
||||
public:
|
||||
using Scalar = typename ExpressionTraits::Scalar;
|
||||
using Nested = RealView;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit RealView(Xpr& xpr) : m_xpr(xpr) {}
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return Xpr::IsRowMajor ? m_xpr.rows() : 2 * m_xpr.rows(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return Xpr::IsRowMajor ? 2 * m_xpr.cols() : m_xpr.cols(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index size() const noexcept { return 2 * m_xpr.size(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index innerStride() const noexcept { return m_xpr.innerStride(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index outerStride() const noexcept { return 2 * m_xpr.outerStride(); }
|
||||
EIGEN_DEVICE_FUNC void resize(Index rows, Index cols) {
|
||||
m_xpr.resize(Xpr::IsRowMajor ? rows : rows / 2, Xpr::IsRowMajor ? cols / 2 : cols);
|
||||
}
|
||||
EIGEN_DEVICE_FUNC void resize(Index size) { m_xpr.resize(size / 2); }
|
||||
EIGEN_DEVICE_FUNC Scalar* data() { return reinterpret_cast<Scalar*>(m_xpr.data()); }
|
||||
EIGEN_DEVICE_FUNC const Scalar* data() const { return reinterpret_cast<const Scalar*>(m_xpr.data()); }
|
||||
|
||||
EIGEN_DEVICE_FUNC RealView(const RealView&) = default;
|
||||
|
||||
EIGEN_DEVICE_FUNC RealView& operator=(const RealView& other);
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC RealView& operator=(const RealView<OtherDerived>& other);
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC RealView& operator=(const DenseBase<OtherDerived>& other);
|
||||
|
||||
protected:
|
||||
friend struct internal::evaluator<RealView<Xpr>>;
|
||||
Xpr& m_xpr;
|
||||
};
|
||||
|
||||
template <typename Xpr>
|
||||
EIGEN_DEVICE_FUNC RealView<Xpr>& RealView<Xpr>::operator=(const RealView& other) {
|
||||
internal::call_assignment(*this, other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename Xpr>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC RealView<Xpr>& RealView<Xpr>::operator=(const RealView<OtherDerived>& other) {
|
||||
internal::call_assignment(*this, other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename Xpr>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC RealView<Xpr>& RealView<Xpr>::operator=(const DenseBase<OtherDerived>& other) {
|
||||
internal::call_assignment(*this, other.derived());
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC typename DenseBase<Derived>::RealViewReturnType DenseBase<Derived>::realView() {
|
||||
return RealViewReturnType(derived());
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC typename DenseBase<Derived>::ConstRealViewReturnType DenseBase<Derived>::realView() const {
|
||||
return ConstRealViewReturnType(derived());
|
||||
}
|
||||
|
||||
} // namespace Eigen
|
||||
|
||||
#endif // EIGEN_REALVIEW_H
|
@ -15,7 +15,7 @@
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
/** \class Select
|
||||
/** \typedef Select
|
||||
* \ingroup Core_Module
|
||||
*
|
||||
* \brief Expression of a coefficient wise version of the C++ ternary operator ?:
|
||||
@ -24,73 +24,16 @@ namespace Eigen {
|
||||
* \tparam ThenMatrixType the type of the \em then expression
|
||||
* \tparam ElseMatrixType the type of the \em else expression
|
||||
*
|
||||
* This class represents an expression of a coefficient wise version of the C++ ternary operator ?:.
|
||||
* This type represents an expression of a coefficient wise version of the C++ ternary operator ?:.
|
||||
* It is the return type of DenseBase::select() and most of the time this is the only way it is used.
|
||||
*
|
||||
* \sa DenseBase::select(const DenseBase<ThenDerived>&, const DenseBase<ElseDerived>&) const
|
||||
*/
|
||||
|
||||
namespace internal {
|
||||
template <typename ConditionMatrixType, typename ThenMatrixType, typename ElseMatrixType>
|
||||
struct traits<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> > : traits<ThenMatrixType> {
|
||||
typedef typename traits<ThenMatrixType>::Scalar Scalar;
|
||||
typedef Dense StorageKind;
|
||||
typedef typename traits<ThenMatrixType>::XprKind XprKind;
|
||||
typedef typename ConditionMatrixType::Nested ConditionMatrixNested;
|
||||
typedef typename ThenMatrixType::Nested ThenMatrixNested;
|
||||
typedef typename ElseMatrixType::Nested ElseMatrixNested;
|
||||
enum {
|
||||
RowsAtCompileTime = ConditionMatrixType::RowsAtCompileTime,
|
||||
ColsAtCompileTime = ConditionMatrixType::ColsAtCompileTime,
|
||||
MaxRowsAtCompileTime = ConditionMatrixType::MaxRowsAtCompileTime,
|
||||
MaxColsAtCompileTime = ConditionMatrixType::MaxColsAtCompileTime,
|
||||
Flags = (unsigned int)ThenMatrixType::Flags & ElseMatrixType::Flags & RowMajorBit
|
||||
};
|
||||
};
|
||||
} // namespace internal
|
||||
|
||||
template <typename ConditionMatrixType, typename ThenMatrixType, typename ElseMatrixType>
|
||||
class Select : public internal::dense_xpr_base<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >::type,
|
||||
internal::no_assignment_operator {
|
||||
public:
|
||||
typedef typename internal::dense_xpr_base<Select>::type Base;
|
||||
EIGEN_DENSE_PUBLIC_INTERFACE(Select)
|
||||
|
||||
inline EIGEN_DEVICE_FUNC Select(const ConditionMatrixType& a_conditionMatrix, const ThenMatrixType& a_thenMatrix,
|
||||
const ElseMatrixType& a_elseMatrix)
|
||||
: m_condition(a_conditionMatrix), m_then(a_thenMatrix), m_else(a_elseMatrix) {
|
||||
eigen_assert(m_condition.rows() == m_then.rows() && m_condition.rows() == m_else.rows());
|
||||
eigen_assert(m_condition.cols() == m_then.cols() && m_condition.cols() == m_else.cols());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_condition.rows(); }
|
||||
EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_condition.cols(); }
|
||||
|
||||
inline EIGEN_DEVICE_FUNC const Scalar coeff(Index i, Index j) const {
|
||||
if (m_condition.coeff(i, j))
|
||||
return m_then.coeff(i, j);
|
||||
else
|
||||
return m_else.coeff(i, j);
|
||||
}
|
||||
|
||||
inline EIGEN_DEVICE_FUNC const Scalar coeff(Index i) const {
|
||||
if (m_condition.coeff(i))
|
||||
return m_then.coeff(i);
|
||||
else
|
||||
return m_else.coeff(i);
|
||||
}
|
||||
|
||||
inline EIGEN_DEVICE_FUNC const ConditionMatrixType& conditionMatrix() const { return m_condition; }
|
||||
|
||||
inline EIGEN_DEVICE_FUNC const ThenMatrixType& thenMatrix() const { return m_then; }
|
||||
|
||||
inline EIGEN_DEVICE_FUNC const ElseMatrixType& elseMatrix() const { return m_else; }
|
||||
|
||||
protected:
|
||||
typename ConditionMatrixType::Nested m_condition;
|
||||
typename ThenMatrixType::Nested m_then;
|
||||
typename ElseMatrixType::Nested m_else;
|
||||
};
|
||||
using Select = CwiseTernaryOp<internal::scalar_boolean_select_op<typename DenseBase<ThenMatrixType>::Scalar,
|
||||
typename DenseBase<ElseMatrixType>::Scalar,
|
||||
typename DenseBase<ConditionMatrixType>::Scalar>,
|
||||
ThenMatrixType, ElseMatrixType, ConditionMatrixType>;
|
||||
|
||||
/** \returns a matrix where each coefficient (i,j) is equal to \a thenMatrix(i,j)
|
||||
* if \c *this(i,j) != Scalar(0), and \a elseMatrix(i,j) otherwise.
|
||||
@ -98,7 +41,7 @@ class Select : public internal::dense_xpr_base<Select<ConditionMatrixType, ThenM
|
||||
* Example: \include MatrixBase_select.cpp
|
||||
* Output: \verbinclude MatrixBase_select.out
|
||||
*
|
||||
* \sa DenseBase::bitwiseSelect(const DenseBase<ThenDerived>&, const DenseBase<ElseDerived>&)
|
||||
* \sa typedef Select
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename ThenDerived, typename ElseDerived>
|
||||
@ -107,15 +50,12 @@ inline EIGEN_DEVICE_FUNC CwiseTernaryOp<
|
||||
typename DenseBase<Derived>::Scalar>,
|
||||
ThenDerived, ElseDerived, Derived>
|
||||
DenseBase<Derived>::select(const DenseBase<ThenDerived>& thenMatrix, const DenseBase<ElseDerived>& elseMatrix) const {
|
||||
using Op = internal::scalar_boolean_select_op<typename DenseBase<ThenDerived>::Scalar,
|
||||
typename DenseBase<ElseDerived>::Scalar, Scalar>;
|
||||
return CwiseTernaryOp<Op, ThenDerived, ElseDerived, Derived>(thenMatrix.derived(), elseMatrix.derived(), derived(),
|
||||
Op());
|
||||
return Select<Derived, ThenDerived, ElseDerived>(thenMatrix.derived(), elseMatrix.derived(), derived());
|
||||
}
|
||||
/** Version of DenseBase::select(const DenseBase&, const DenseBase&) with
|
||||
* the \em else expression being a scalar value.
|
||||
*
|
||||
* \sa DenseBase::booleanSelect(const DenseBase<ThenDerived>&, const DenseBase<ElseDerived>&) const, class Select
|
||||
* \sa typedef Select
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename ThenDerived>
|
||||
@ -126,15 +66,13 @@ inline EIGEN_DEVICE_FUNC CwiseTernaryOp<
|
||||
DenseBase<Derived>::select(const DenseBase<ThenDerived>& thenMatrix,
|
||||
const typename DenseBase<ThenDerived>::Scalar& elseScalar) const {
|
||||
using ElseConstantType = typename DenseBase<ThenDerived>::ConstantReturnType;
|
||||
using Op = internal::scalar_boolean_select_op<typename DenseBase<ThenDerived>::Scalar,
|
||||
typename DenseBase<ThenDerived>::Scalar, Scalar>;
|
||||
return CwiseTernaryOp<Op, ThenDerived, ElseConstantType, Derived>(
|
||||
thenMatrix.derived(), ElseConstantType(rows(), cols(), elseScalar), derived(), Op());
|
||||
return Select<Derived, ThenDerived, ElseConstantType>(thenMatrix.derived(),
|
||||
ElseConstantType(rows(), cols(), elseScalar), derived());
|
||||
}
|
||||
/** Version of DenseBase::select(const DenseBase&, const DenseBase&) with
|
||||
* the \em then expression being a scalar value.
|
||||
*
|
||||
* \sa DenseBase::booleanSelect(const DenseBase<ThenDerived>&, const DenseBase<ElseDerived>&) const, class Select
|
||||
* \sa typedef Select
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename ElseDerived>
|
||||
@ -145,10 +83,8 @@ inline EIGEN_DEVICE_FUNC CwiseTernaryOp<
|
||||
DenseBase<Derived>::select(const typename DenseBase<ElseDerived>::Scalar& thenScalar,
|
||||
const DenseBase<ElseDerived>& elseMatrix) const {
|
||||
using ThenConstantType = typename DenseBase<ElseDerived>::ConstantReturnType;
|
||||
using Op = internal::scalar_boolean_select_op<typename DenseBase<ElseDerived>::Scalar,
|
||||
typename DenseBase<ElseDerived>::Scalar, Scalar>;
|
||||
return CwiseTernaryOp<Op, ThenConstantType, ElseDerived, Derived>(ThenConstantType(rows(), cols(), thenScalar),
|
||||
elseMatrix.derived(), derived(), Op());
|
||||
return Select<Derived, ThenConstantType, ElseDerived>(ThenConstantType(rows(), cols(), thenScalar),
|
||||
elseMatrix.derived(), derived());
|
||||
}
|
||||
|
||||
} // end namespace Eigen
|
||||
|
@ -15,19 +15,33 @@
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
// TODO generalize the scalar type of 'other'
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const Scalar& other) {
|
||||
internal::call_assignment(this->derived(), PlainObject::Constant(rows(), cols(), other),
|
||||
internal::mul_assign_op<Scalar, Scalar>());
|
||||
using ConstantExpr = typename internal::plain_constant_type<Derived, Scalar>::type;
|
||||
using Op = internal::mul_assign_op<Scalar>;
|
||||
internal::call_assignment(derived(), ConstantExpr(rows(), cols(), other), Op());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
template <bool Enable, typename>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(const RealScalar& other) {
|
||||
realView() *= other;
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const Scalar& other) {
|
||||
internal::call_assignment(this->derived(), PlainObject::Constant(rows(), cols(), other),
|
||||
internal::div_assign_op<Scalar, Scalar>());
|
||||
using ConstantExpr = typename internal::plain_constant_type<Derived, Scalar>::type;
|
||||
using Op = internal::div_assign_op<Scalar>;
|
||||
internal::call_assignment(derived(), ConstantExpr(rows(), cols(), other), Op());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
template <bool Enable, typename>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const RealScalar& other) {
|
||||
realView() /= other;
|
||||
return derived();
|
||||
}
|
||||
|
||||
|
@ -146,6 +146,22 @@ struct member_redux {
|
||||
const BinaryOp& binaryFunc() const { return m_functor; }
|
||||
const BinaryOp m_functor;
|
||||
};
|
||||
|
||||
template <typename Scalar>
|
||||
struct scalar_replace_zero_with_one_op {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const Scalar& x) const {
|
||||
return numext::is_exactly_zero(x) ? Scalar(1) : x;
|
||||
}
|
||||
template <typename Packet>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet packetOp(const Packet& x) const {
|
||||
return pselect(pcmp_eq(x, pzero(x)), pset1<Packet>(Scalar(1)), x);
|
||||
}
|
||||
};
|
||||
template <typename Scalar>
|
||||
struct functor_traits<scalar_replace_zero_with_one_op<Scalar>> {
|
||||
enum { Cost = 1, PacketAccess = packet_traits<Scalar>::HasCmp };
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
/** \class VectorwiseOp
|
||||
@ -190,9 +206,7 @@ class VectorwiseOp {
|
||||
public:
|
||||
typedef typename ExpressionType::Scalar Scalar;
|
||||
typedef typename ExpressionType::RealScalar RealScalar;
|
||||
typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3
|
||||
typedef typename internal::ref_selector<ExpressionType>::non_const_type ExpressionTypeNested;
|
||||
typedef internal::remove_all_t<ExpressionTypeNested> ExpressionTypeNestedCleaned;
|
||||
typedef internal::remove_all_t<ExpressionType> ExpressionTypeCleaned;
|
||||
|
||||
template <template <typename OutScalar, typename InputScalar> class Functor, typename ReturnScalar = Scalar>
|
||||
struct ReturnType {
|
||||
@ -331,7 +345,7 @@ class VectorwiseOp {
|
||||
|
||||
typedef typename ReturnType<internal::member_minCoeff>::Type MinCoeffReturnType;
|
||||
typedef typename ReturnType<internal::member_maxCoeff>::Type MaxCoeffReturnType;
|
||||
typedef PartialReduxExpr<const CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const ExpressionTypeNestedCleaned>,
|
||||
typedef PartialReduxExpr<const CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const ExpressionTypeCleaned>,
|
||||
internal::member_sum<RealScalar, RealScalar>, Direction>
|
||||
SquaredNormReturnType;
|
||||
typedef CwiseUnaryOp<internal::scalar_sqrt_op<RealScalar>, const SquaredNormReturnType> NormReturnType;
|
||||
@ -582,7 +596,7 @@ class VectorwiseOp {
|
||||
/** Returns the expression of the sum of the vector \a other to each subvector of \c *this */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
|
||||
CwiseBinaryOp<internal::scalar_sum_op<Scalar, typename OtherDerived::Scalar>, const ExpressionTypeNestedCleaned,
|
||||
CwiseBinaryOp<internal::scalar_sum_op<Scalar, typename OtherDerived::Scalar>, const ExpressionTypeCleaned,
|
||||
const typename ExtendedType<OtherDerived>::Type>
|
||||
operator+(const DenseBase<OtherDerived>& other) const {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
|
||||
@ -593,7 +607,7 @@ class VectorwiseOp {
|
||||
/** Returns the expression of the difference between each subvector of \c *this and the vector \a other */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC CwiseBinaryOp<internal::scalar_difference_op<Scalar, typename OtherDerived::Scalar>,
|
||||
const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type>
|
||||
const ExpressionTypeCleaned, const typename ExtendedType<OtherDerived>::Type>
|
||||
operator-(const DenseBase<OtherDerived>& other) const {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
|
||||
EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
|
||||
@ -604,7 +618,7 @@ class VectorwiseOp {
|
||||
* by the corresponding subvector of \c *this */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC CwiseBinaryOp<internal::scalar_product_op<Scalar, typename OtherDerived::Scalar>,
|
||||
const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type>
|
||||
const ExpressionTypeCleaned, const typename ExtendedType<OtherDerived>::Type>
|
||||
operator*(const DenseBase<OtherDerived>& other) const {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
|
||||
EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
|
||||
@ -616,7 +630,7 @@ class VectorwiseOp {
|
||||
* subvector of \c *this by the vector \a other */
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC CwiseBinaryOp<internal::scalar_quotient_op<Scalar, typename OtherDerived::Scalar>,
|
||||
const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type>
|
||||
const ExpressionTypeCleaned, const typename ExtendedType<OtherDerived>::Type>
|
||||
operator/(const DenseBase<OtherDerived>& other) const {
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
|
||||
EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
|
||||
@ -624,18 +638,28 @@ class VectorwiseOp {
|
||||
return m_matrix / extendedTo(other.derived());
|
||||
}
|
||||
|
||||
using Normalized_NonzeroNormType =
|
||||
CwiseUnaryOp<internal::scalar_replace_zero_with_one_op<Scalar>, const NormReturnType>;
|
||||
using NormalizedReturnType = CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const ExpressionTypeCleaned,
|
||||
const typename OppositeExtendedType<Normalized_NonzeroNormType>::Type>;
|
||||
|
||||
/** \returns an expression where each column (or row) of the referenced matrix are normalized.
|
||||
* The referenced matrix is \b not modified.
|
||||
*
|
||||
* \warning If the input columns (or rows) are too small (i.e., their norm equals to 0), they remain unchanged in the
|
||||
* resulting expression.
|
||||
*
|
||||
* \sa MatrixBase::normalized(), normalize()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const ExpressionTypeNestedCleaned,
|
||||
const typename OppositeExtendedType<NormReturnType>::Type>
|
||||
normalized() const {
|
||||
return m_matrix.cwiseQuotient(extendedToOpposite(this->norm()));
|
||||
EIGEN_DEVICE_FUNC NormalizedReturnType normalized() const {
|
||||
return m_matrix.cwiseQuotient(extendedToOpposite(Normalized_NonzeroNormType(this->norm())));
|
||||
}
|
||||
|
||||
/** Normalize in-place each row or columns of the referenced matrix.
|
||||
* \sa MatrixBase::normalize(), normalized()
|
||||
*
|
||||
* \warning If the input columns (or rows) are too small (i.e., their norm equals to 0), they are left unchanged.
|
||||
*
|
||||
* \sa MatrixBase::normalized(), normalize()
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC void normalize() { m_matrix = this->normalized(); }
|
||||
|
||||
@ -679,7 +703,7 @@ class VectorwiseOp {
|
||||
|
||||
protected:
|
||||
EIGEN_DEVICE_FUNC Index redux_length() const { return Direction == Vertical ? m_matrix.rows() : m_matrix.cols(); }
|
||||
ExpressionTypeNested m_matrix;
|
||||
ExpressionType& m_matrix;
|
||||
};
|
||||
|
||||
// const colwise moved to DenseBase.h due to CUDA compiler bug
|
||||
|
@ -118,6 +118,7 @@ struct packet_traits<float> : default_packet_traits {
|
||||
HasLog1p = 1,
|
||||
HasExpm1 = 1,
|
||||
HasExp = 1,
|
||||
HasPow = 1,
|
||||
HasNdtri = 1,
|
||||
HasBessel = 1,
|
||||
HasSqrt = 1,
|
||||
@ -149,6 +150,7 @@ struct packet_traits<double> : default_packet_traits {
|
||||
HasErf = 1,
|
||||
HasErfc = 1,
|
||||
HasExp = 1,
|
||||
HasPow = 1,
|
||||
HasSqrt = 1,
|
||||
HasRsqrt = 1,
|
||||
HasCbrt = 1,
|
||||
|
@ -135,6 +135,7 @@ struct packet_traits<float> : default_packet_traits {
|
||||
HasNdtri = 1,
|
||||
HasBessel = 1,
|
||||
HasExp = 1,
|
||||
HasPow = 1,
|
||||
HasReciprocal = EIGEN_FAST_MATH,
|
||||
HasTanh = EIGEN_FAST_MATH,
|
||||
HasErf = EIGEN_FAST_MATH,
|
||||
@ -159,6 +160,7 @@ struct packet_traits<double> : default_packet_traits {
|
||||
HasCos = EIGEN_FAST_MATH,
|
||||
HasLog = 1,
|
||||
HasExp = 1,
|
||||
HasPow = 1,
|
||||
HasATan = 1,
|
||||
HasTanh = EIGEN_FAST_MATH,
|
||||
HasErf = EIGEN_FAST_MATH,
|
||||
|
@ -185,6 +185,8 @@ struct packet_traits<float> : default_packet_traits {
|
||||
HasLog = 1,
|
||||
HasExp = 1,
|
||||
#ifdef EIGEN_VECTORIZE_VSX
|
||||
HasCmp = 1,
|
||||
HasPow = 1,
|
||||
HasSqrt = 1,
|
||||
HasCbrt = 1,
|
||||
#if !EIGEN_COMP_CLANG
|
||||
@ -3175,6 +3177,7 @@ struct packet_traits<double> : default_packet_traits {
|
||||
HasATanh = 1,
|
||||
HasATan = 0,
|
||||
HasLog = 0,
|
||||
HasCmp = 1,
|
||||
HasExp = 1,
|
||||
HasSqrt = 1,
|
||||
HasCbrt = 1,
|
||||
|
@ -793,6 +793,12 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 nextafter(const bfloat16& from, c
|
||||
return numext::bit_cast<bfloat16>(from_bits);
|
||||
}
|
||||
|
||||
// Specialize multiply-add to match packet operations and reduce conversions to/from float.
|
||||
template<>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::bfloat16 madd<Eigen::bfloat16>(const Eigen::bfloat16& x, const Eigen::bfloat16& y, const Eigen::bfloat16& z) {
|
||||
return Eigen::bfloat16(static_cast<float>(x) * static_cast<float>(y) + static_cast<float>(z));
|
||||
}
|
||||
|
||||
} // namespace numext
|
||||
} // namespace Eigen
|
||||
|
||||
|
@ -955,6 +955,12 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC uint16_t bit_cast<uint16_t, Eigen::half>(c
|
||||
return Eigen::half_impl::raw_half_as_uint16(src);
|
||||
}
|
||||
|
||||
// Specialize multiply-add to match packet operations and reduce conversions to/from float.
|
||||
template<>
|
||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half madd<Eigen::half>(const Eigen::half& x, const Eigen::half& y, const Eigen::half& z) {
|
||||
return Eigen::half(static_cast<float>(x) * static_cast<float>(y) + static_cast<float>(z));
|
||||
}
|
||||
|
||||
} // namespace numext
|
||||
} // namespace Eigen
|
||||
|
||||
|
@ -399,9 +399,26 @@ EIGEN_STRONG_INLINE Packet8f pnegate(const Packet8f& a) {
|
||||
return pnegate_hvx(a);
|
||||
}
|
||||
|
||||
template <HVXPacketSize T>
|
||||
EIGEN_STRONG_INLINE HVXPacket<T> ptrue_hvx(const HVXPacket<T>& a) {
|
||||
return HVXPacket<T>::Create(Q6_V_vsplat_R(0x3f800000));
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet32f ptrue(const Packet32f& a) {
|
||||
return ptrue_hvx(a);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet16f ptrue(const Packet16f& a) {
|
||||
return ptrue_hvx(a);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet8f ptrue(const Packet8f& a) {
|
||||
return ptrue_hvx(a);
|
||||
}
|
||||
|
||||
template <HVXPacketSize T>
|
||||
EIGEN_STRONG_INLINE HVXPacket<T> pcmp_le_hvx(const HVXPacket<T>& a, const HVXPacket<T>& b) {
|
||||
HVX_Vector v_true = Q6_Vb_vsplat_R(0xff);
|
||||
HVX_Vector v_true = ptrue(a).Get();
|
||||
HVX_VectorPred pred = Q6_Q_vcmp_gt_VsfVsf(a.Get(), b.Get());
|
||||
return HVXPacket<T>::Create(Q6_V_vmux_QVV(pred, Q6_V_vzero(), v_true));
|
||||
}
|
||||
@ -420,7 +437,7 @@ EIGEN_STRONG_INLINE Packet8f pcmp_le(const Packet8f& a, const Packet8f& b) {
|
||||
|
||||
template <HVXPacketSize T>
|
||||
EIGEN_STRONG_INLINE HVXPacket<T> pcmp_eq_hvx(const HVXPacket<T>& a, const HVXPacket<T>& b) {
|
||||
HVX_Vector v_true = Q6_Vb_vsplat_R(0xff);
|
||||
HVX_Vector v_true = ptrue(a).Get();
|
||||
HVX_VectorPred pred = Q6_Q_vcmp_eq_VwVw(a.Get(), b.Get());
|
||||
return HVXPacket<T>::Create(Q6_V_vmux_QVV(pred, v_true, Q6_V_vzero()));
|
||||
}
|
||||
@ -439,7 +456,7 @@ EIGEN_STRONG_INLINE Packet8f pcmp_eq(const Packet8f& a, const Packet8f& b) {
|
||||
|
||||
template <HVXPacketSize T>
|
||||
EIGEN_STRONG_INLINE HVXPacket<T> pcmp_lt_hvx(const HVXPacket<T>& a, const HVXPacket<T>& b) {
|
||||
HVX_Vector v_true = Q6_Vb_vsplat_R(0xff);
|
||||
HVX_Vector v_true = ptrue(a).Get();
|
||||
HVX_VectorPred pred = Q6_Q_vcmp_gt_VsfVsf(b.Get(), a.Get());
|
||||
return HVXPacket<T>::Create(Q6_V_vmux_QVV(pred, v_true, Q6_V_vzero()));
|
||||
}
|
||||
@ -458,7 +475,7 @@ EIGEN_STRONG_INLINE Packet8f pcmp_lt(const Packet8f& a, const Packet8f& b) {
|
||||
|
||||
template <HVXPacketSize T>
|
||||
EIGEN_STRONG_INLINE HVXPacket<T> pcmp_lt_or_nan_hvx(const HVXPacket<T>& a, const HVXPacket<T>& b) {
|
||||
HVX_Vector v_true = Q6_Vb_vsplat_R(0xff);
|
||||
HVX_Vector v_true = ptrue(a).Get();
|
||||
HVX_VectorPred pred = Q6_Q_vcmp_gt_VsfVsf(b.Get(), a.Get());
|
||||
return HVXPacket<T>::Create(Q6_V_vmux_QVV(pred, v_true, Q6_V_vzero()));
|
||||
}
|
||||
|
@ -73,30 +73,13 @@ struct packet_traits<std::complex<float> > : default_packet_traits {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct unpacket_traits<Packet1cf> {
|
||||
typedef std::complex<float> type;
|
||||
typedef Packet1cf half;
|
||||
typedef Packet2f as_real;
|
||||
enum {
|
||||
size = 1,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet1cf> : neon_unpacket_default<Packet1cf, std::complex<float>> {
|
||||
using as_real = Packet2f;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet2cf> {
|
||||
typedef std::complex<float> type;
|
||||
typedef Packet1cf half;
|
||||
typedef Packet4f as_real;
|
||||
enum {
|
||||
size = 2,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet2cf> : neon_unpacket_default<Packet2cf, std::complex<float>> {
|
||||
using half = Packet1cf;
|
||||
using as_real = Packet4f;
|
||||
};
|
||||
|
||||
template <>
|
||||
@ -297,10 +280,12 @@ EIGEN_STRONG_INLINE Packet2cf pandnot<Packet2cf>(const Packet2cf& a, const Packe
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet1cf pload<Packet1cf>(const std::complex<float>* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet1cf>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return Packet1cf(pload<Packet2f>((const float*)from));
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2cf pload<Packet2cf>(const std::complex<float>* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2cf>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return Packet2cf(pload<Packet4f>(reinterpret_cast<const float*>(from)));
|
||||
}
|
||||
|
||||
@ -324,10 +309,12 @@ EIGEN_STRONG_INLINE Packet2cf ploaddup<Packet2cf>(const std::complex<float>* fro
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<std::complex<float> >(std::complex<float>* to, const Packet1cf& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet1cf>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE pstore((float*)to, from.v);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<std::complex<float> >(std::complex<float>* to, const Packet2cf& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2cf>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE pstore(reinterpret_cast<float*>(to), from.v);
|
||||
}
|
||||
|
||||
@ -538,21 +525,13 @@ struct packet_traits<std::complex<double> > : default_packet_traits {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct unpacket_traits<Packet1cd> {
|
||||
typedef std::complex<double> type;
|
||||
typedef Packet1cd half;
|
||||
typedef Packet2d as_real;
|
||||
enum {
|
||||
size = 1,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet1cd> : neon_unpacket_default<Packet1cd, std::complex<double>> {
|
||||
using as_real = Packet2d;
|
||||
};
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet1cd pload<Packet1cd>(const std::complex<double>* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet1cd>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return Packet1cd(pload<Packet2d>(reinterpret_cast<const double*>(from)));
|
||||
}
|
||||
|
||||
@ -666,6 +645,7 @@ EIGEN_STRONG_INLINE Packet1cd ploaddup<Packet1cd>(const std::complex<double>* fr
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<std::complex<double> >(std::complex<double>* to, const Packet1cd& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet1cd>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE pstore(reinterpret_cast<double*>(to), from.v);
|
||||
}
|
||||
|
||||
|
@ -205,6 +205,7 @@ struct packet_traits<float> : default_packet_traits {
|
||||
HasATanh = 1,
|
||||
HasLog = 1,
|
||||
HasExp = 1,
|
||||
HasPow = 1,
|
||||
HasSqrt = 1,
|
||||
HasRsqrt = 1,
|
||||
HasCbrt = 1,
|
||||
@ -437,224 +438,74 @@ struct packet_traits<uint64_t> : default_packet_traits {
|
||||
};
|
||||
};
|
||||
|
||||
template <typename Packet, typename Scalar>
|
||||
struct neon_unpacket_default {
|
||||
using type = Scalar;
|
||||
using half = Packet;
|
||||
static constexpr int size = sizeof(Packet) / sizeof(Scalar);
|
||||
static constexpr int alignment = sizeof(Packet);
|
||||
static constexpr bool vectorizable = true;
|
||||
static constexpr bool masked_load_available = false;
|
||||
static constexpr bool masked_store_available = false;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct unpacket_traits<Packet2f> {
|
||||
typedef float type;
|
||||
typedef Packet2f half;
|
||||
typedef Packet2i integer_packet;
|
||||
enum {
|
||||
size = 2,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet2f> : neon_unpacket_default<Packet2f, float> {
|
||||
using integer_packet = Packet2i;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet4f> {
|
||||
typedef float type;
|
||||
typedef Packet2f half;
|
||||
typedef Packet4i integer_packet;
|
||||
enum {
|
||||
size = 4,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet4f> : neon_unpacket_default<Packet4f, float> {
|
||||
using half = Packet2f;
|
||||
using integer_packet = Packet4i;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet4c> {
|
||||
typedef int8_t type;
|
||||
typedef Packet4c half;
|
||||
enum {
|
||||
size = 4,
|
||||
alignment = Unaligned,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet4c> : neon_unpacket_default<Packet4c, int8_t> {};
|
||||
template <>
|
||||
struct unpacket_traits<Packet8c> : neon_unpacket_default<Packet8c, int8_t> {
|
||||
using half = Packet4c;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet8c> {
|
||||
typedef int8_t type;
|
||||
typedef Packet4c half;
|
||||
enum {
|
||||
size = 8,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet16c> : neon_unpacket_default<Packet16c, int8_t> {
|
||||
using half = Packet8c;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet16c> {
|
||||
typedef int8_t type;
|
||||
typedef Packet8c half;
|
||||
enum {
|
||||
size = 16,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet4uc> : neon_unpacket_default<Packet4uc, uint8_t> {};
|
||||
template <>
|
||||
struct unpacket_traits<Packet8uc> : neon_unpacket_default<Packet8uc, uint8_t> {
|
||||
using half = Packet4uc;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet4uc> {
|
||||
typedef uint8_t type;
|
||||
typedef Packet4uc half;
|
||||
enum {
|
||||
size = 4,
|
||||
alignment = Unaligned,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet16uc> : neon_unpacket_default<Packet16uc, uint8_t> {
|
||||
using half = Packet8uc;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet8uc> {
|
||||
typedef uint8_t type;
|
||||
typedef Packet4uc half;
|
||||
enum {
|
||||
size = 8,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet4s> : neon_unpacket_default<Packet4s, int16_t> {};
|
||||
template <>
|
||||
struct unpacket_traits<Packet8s> : neon_unpacket_default<Packet8s, int16_t> {
|
||||
using half = Packet4s;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet16uc> {
|
||||
typedef uint8_t type;
|
||||
typedef Packet8uc half;
|
||||
enum {
|
||||
size = 16,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet4us> : neon_unpacket_default<Packet4us, uint16_t> {};
|
||||
template <>
|
||||
struct unpacket_traits<Packet8us> : neon_unpacket_default<Packet8us, uint16_t> {
|
||||
using half = Packet4us;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet4s> {
|
||||
typedef int16_t type;
|
||||
typedef Packet4s half;
|
||||
enum {
|
||||
size = 4,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet2i> : neon_unpacket_default<Packet2i, int32_t> {};
|
||||
template <>
|
||||
struct unpacket_traits<Packet4i> : neon_unpacket_default<Packet4i, int32_t> {
|
||||
using half = Packet2i;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet8s> {
|
||||
typedef int16_t type;
|
||||
typedef Packet4s half;
|
||||
enum {
|
||||
size = 8,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet2ui> : neon_unpacket_default<Packet2ui, uint32_t> {};
|
||||
template <>
|
||||
struct unpacket_traits<Packet4ui> : neon_unpacket_default<Packet4ui, uint32_t> {
|
||||
using half = Packet2ui;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet4us> {
|
||||
typedef uint16_t type;
|
||||
typedef Packet4us half;
|
||||
enum {
|
||||
size = 4,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
};
|
||||
struct unpacket_traits<Packet2l> : neon_unpacket_default<Packet2l, int64_t> {};
|
||||
template <>
|
||||
struct unpacket_traits<Packet8us> {
|
||||
typedef uint16_t type;
|
||||
typedef Packet4us half;
|
||||
enum {
|
||||
size = 8,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet2i> {
|
||||
typedef int32_t type;
|
||||
typedef Packet2i half;
|
||||
enum {
|
||||
size = 2,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet4i> {
|
||||
typedef int32_t type;
|
||||
typedef Packet2i half;
|
||||
enum {
|
||||
size = 4,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet2ui> {
|
||||
typedef uint32_t type;
|
||||
typedef Packet2ui half;
|
||||
enum {
|
||||
size = 2,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet4ui> {
|
||||
typedef uint32_t type;
|
||||
typedef Packet2ui half;
|
||||
enum {
|
||||
size = 4,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet2l> {
|
||||
typedef int64_t type;
|
||||
typedef Packet2l half;
|
||||
enum {
|
||||
size = 2,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet2ul> {
|
||||
typedef uint64_t type;
|
||||
typedef Packet2ul half;
|
||||
enum {
|
||||
size = 2,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
};
|
||||
struct unpacket_traits<Packet2ul> : neon_unpacket_default<Packet2ul, uint64_t> {};
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2f pzero(const Packet2f& /*a*/) {
|
||||
@ -2417,10 +2268,12 @@ EIGEN_STRONG_INLINE Packet2ul plogical_shift_left(Packet2ul a) {
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2f pload<Packet2f>(const float* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2f>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1_f32(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4f pload<Packet4f>(const float* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4f>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_f32(from);
|
||||
}
|
||||
template <>
|
||||
@ -2431,10 +2284,12 @@ EIGEN_STRONG_INLINE Packet4c pload<Packet4c>(const int8_t* from) {
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet8c pload<Packet8c>(const int8_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet8c>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1_s8(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet16c pload<Packet16c>(const int8_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet16c>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s8(from);
|
||||
}
|
||||
template <>
|
||||
@ -2445,50 +2300,62 @@ EIGEN_STRONG_INLINE Packet4uc pload<Packet4uc>(const uint8_t* from) {
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet8uc pload<Packet8uc>(const uint8_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet8uc>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1_u8(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet16uc pload<Packet16uc>(const uint8_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet16uc>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u8(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4s pload<Packet4s>(const int16_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4s>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1_s16(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet8s pload<Packet8s>(const int16_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet8s>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s16(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4us pload<Packet4us>(const uint16_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4us>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1_u16(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet8us pload<Packet8us>(const uint16_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet8us>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u16(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2i pload<Packet2i>(const int32_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2i>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1_s32(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4i pload<Packet4i>(const int32_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4i>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s32(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2ui pload<Packet2ui>(const uint32_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2ui>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1_u32(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4ui pload<Packet4ui>(const uint32_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4ui>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u32(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2l pload<Packet2l>(const int64_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2l>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_s64(from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2ul pload<Packet2ul>(const uint64_t* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2ul>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_u64(from);
|
||||
}
|
||||
|
||||
@ -2713,10 +2580,12 @@ EIGEN_STRONG_INLINE Packet4ui ploadquad<Packet4ui>(const uint32_t* from) {
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<float>(float* to, const Packet2f& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2f>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1_f32(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<float>(float* to, const Packet4f& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4f>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1q_f32(to, from);
|
||||
}
|
||||
template <>
|
||||
@ -2725,10 +2594,12 @@ EIGEN_STRONG_INLINE void pstore<int8_t>(int8_t* to, const Packet4c& from) {
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<int8_t>(int8_t* to, const Packet8c& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet8c>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1_s8(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<int8_t>(int8_t* to, const Packet16c& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet16c>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1q_s8(to, from);
|
||||
}
|
||||
template <>
|
||||
@ -2737,50 +2608,62 @@ EIGEN_STRONG_INLINE void pstore<uint8_t>(uint8_t* to, const Packet4uc& from) {
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<uint8_t>(uint8_t* to, const Packet8uc& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet8uc>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1_u8(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<uint8_t>(uint8_t* to, const Packet16uc& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet16uc>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1q_u8(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<int16_t>(int16_t* to, const Packet4s& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4s>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1_s16(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<int16_t>(int16_t* to, const Packet8s& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet8s>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1q_s16(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<uint16_t>(uint16_t* to, const Packet4us& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4us>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1_u16(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<uint16_t>(uint16_t* to, const Packet8us& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet8us>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1q_u16(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<int32_t>(int32_t* to, const Packet2i& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2i>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1_s32(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<int32_t>(int32_t* to, const Packet4i& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4i>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1q_s32(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<uint32_t>(uint32_t* to, const Packet2ui& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2ui>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1_u32(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<uint32_t>(uint32_t* to, const Packet4ui& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4ui>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1q_u32(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<int64_t>(int64_t* to, const Packet2l& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2l>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1q_s64(to, from);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<uint64_t>(uint64_t* to, const Packet2ul& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2ul>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1q_u64(to, from);
|
||||
}
|
||||
|
||||
@ -4801,17 +4684,7 @@ struct packet_traits<bfloat16> : default_packet_traits {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct unpacket_traits<Packet4bf> {
|
||||
typedef bfloat16 type;
|
||||
typedef Packet4bf half;
|
||||
enum {
|
||||
size = 4,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
};
|
||||
struct unpacket_traits<Packet4bf> : neon_unpacket_default<Packet4bf, bfloat16> {};
|
||||
|
||||
namespace detail {
|
||||
template <>
|
||||
@ -4866,6 +4739,7 @@ EIGEN_STRONG_INLINE bfloat16 pfirst<Packet4bf>(const Packet4bf& from) {
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4bf pload<Packet4bf>(const bfloat16* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4bf>::alignment);
|
||||
return Packet4bf(pload<Packet4us>(reinterpret_cast<const uint16_t*>(from)));
|
||||
}
|
||||
|
||||
@ -4876,6 +4750,7 @@ EIGEN_STRONG_INLINE Packet4bf ploadu<Packet4bf>(const bfloat16* from) {
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<bfloat16>(bfloat16* to, const Packet4bf& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4bf>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1_u16(reinterpret_cast<uint16_t*>(to), from);
|
||||
}
|
||||
|
||||
@ -5186,6 +5061,7 @@ struct packet_traits<double> : default_packet_traits {
|
||||
#if EIGEN_ARCH_ARM64 && !EIGEN_APPLE_DOUBLE_NEON_BUG
|
||||
HasExp = 1,
|
||||
HasLog = 1,
|
||||
HasPow = 1,
|
||||
HasATan = 1,
|
||||
HasATanh = 1,
|
||||
#endif
|
||||
@ -5201,17 +5077,8 @@ struct packet_traits<double> : default_packet_traits {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct unpacket_traits<Packet2d> {
|
||||
typedef double type;
|
||||
typedef Packet2d half;
|
||||
typedef Packet2l integer_packet;
|
||||
enum {
|
||||
size = 2,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet2d> : neon_unpacket_default<Packet2d, double> {
|
||||
using integer_packet = Packet2l;
|
||||
};
|
||||
|
||||
template <>
|
||||
@ -5373,6 +5240,7 @@ EIGEN_STRONG_INLINE Packet2d pcmp_eq(const Packet2d& a, const Packet2d& b) {
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2d pload<Packet2d>(const double* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet2d>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_f64(from);
|
||||
}
|
||||
|
||||
@ -5387,6 +5255,7 @@ EIGEN_STRONG_INLINE Packet2d ploaddup<Packet2d>(const double* from) {
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<double>(double* to, const Packet2d& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet2d>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1q_f64(to, from);
|
||||
}
|
||||
|
||||
@ -5579,29 +5448,10 @@ struct packet_traits<Eigen::half> : default_packet_traits {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct unpacket_traits<Packet4hf> {
|
||||
typedef Eigen::half type;
|
||||
typedef Packet4hf half;
|
||||
enum {
|
||||
size = 4,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
};
|
||||
|
||||
struct unpacket_traits<Packet4hf> : neon_unpacket_default<Packet4hf, half> {};
|
||||
template <>
|
||||
struct unpacket_traits<Packet8hf> {
|
||||
typedef Eigen::half type;
|
||||
typedef Packet4hf half;
|
||||
enum {
|
||||
size = 8,
|
||||
alignment = Aligned16,
|
||||
vectorizable = true,
|
||||
masked_load_available = false,
|
||||
masked_store_available = false
|
||||
};
|
||||
struct unpacket_traits<Packet8hf> : neon_unpacket_default<Packet8hf, half> {
|
||||
using half = Packet4hf;
|
||||
};
|
||||
|
||||
template <>
|
||||
@ -5934,11 +5784,13 @@ EIGEN_STRONG_INLINE Packet4hf pandnot<Packet4hf>(const Packet4hf& a, const Packe
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet8hf pload<Packet8hf>(const Eigen::half* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet8hf>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1q_f16(reinterpret_cast<const float16_t*>(from));
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4hf pload<Packet4hf>(const Eigen::half* from) {
|
||||
EIGEN_ASSUME_ALIGNED(from, unpacket_traits<Packet4hf>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_LOAD return vld1_f16(reinterpret_cast<const float16_t*>(from));
|
||||
}
|
||||
|
||||
@ -6014,11 +5866,13 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4hf pinsertlast(const Packet4hf& a,
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<Eigen::half>(Eigen::half* to, const Packet8hf& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet8hf>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1q_f16(reinterpret_cast<float16_t*>(to), from);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<Eigen::half>(Eigen::half* to, const Packet4hf& from) {
|
||||
EIGEN_ASSUME_ALIGNED(to, unpacket_traits<Packet4hf>::alignment);
|
||||
EIGEN_DEBUG_ALIGNED_STORE vst1_f16(reinterpret_cast<float16_t*>(to), from);
|
||||
}
|
||||
|
||||
|
@ -192,6 +192,7 @@ struct packet_traits<float> : default_packet_traits {
|
||||
HasExpm1 = 1,
|
||||
HasNdtri = 1,
|
||||
HasExp = 1,
|
||||
HasPow = 1,
|
||||
HasBessel = 1,
|
||||
HasSqrt = 1,
|
||||
HasRsqrt = 1,
|
||||
@ -221,6 +222,7 @@ struct packet_traits<double> : default_packet_traits {
|
||||
HasErf = EIGEN_FAST_MATH,
|
||||
HasErfc = EIGEN_FAST_MATH,
|
||||
HasExp = 1,
|
||||
HasPow = 1,
|
||||
HasSqrt = 1,
|
||||
HasRsqrt = 1,
|
||||
HasCbrt = 1,
|
||||
@ -285,7 +287,7 @@ struct packet_traits<bool> : default_packet_traits {
|
||||
AlignedOnScalar = 1,
|
||||
size = 16,
|
||||
|
||||
HasCmp = 1, // note -- only pcmp_eq is defined
|
||||
HasCmp = 1,
|
||||
HasShift = 0,
|
||||
HasAbs = 0,
|
||||
HasAbs2 = 0,
|
||||
@ -881,7 +883,14 @@ template <>
|
||||
EIGEN_STRONG_INLINE Packet4ui pandnot<Packet4ui>(const Packet4ui& a, const Packet4ui& b) {
|
||||
return _mm_andnot_si128(b, a);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet16b pandnot<Packet16b>(const Packet16b& a, const Packet16b& b) {
|
||||
return _mm_andnot_si128(b, a);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet16b pcmp_lt(const Packet16b& a, const Packet16b& b) {
|
||||
return _mm_andnot_si128(a, b);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4f pcmp_le(const Packet4f& a, const Packet4f& b) {
|
||||
return _mm_cmple_ps(a, b);
|
||||
@ -925,7 +934,11 @@ EIGEN_STRONG_INLINE Packet4i pcmp_eq(const Packet4i& a, const Packet4i& b) {
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4i pcmp_le(const Packet4i& a, const Packet4i& b) {
|
||||
#ifdef EIGEN_VECTORIZE_SSE4_1
|
||||
return _mm_cmpeq_epi32(a, _mm_min_epi32(a, b));
|
||||
#else
|
||||
return por(pcmp_lt(a, b), pcmp_eq(a, b));
|
||||
#endif
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2l pcmp_lt(const Packet2l& a, const Packet2l& b) {
|
||||
@ -2024,38 +2037,38 @@ EIGEN_STRONG_INLINE Packet2d pblend(const Selector<2>& ifPacket, const Packet2d&
|
||||
}
|
||||
|
||||
// Scalar path for pmadd with FMA to ensure consistency with vectorized path.
|
||||
#ifdef EIGEN_VECTORIZE_FMA
|
||||
#if defined(EIGEN_VECTORIZE_FMA)
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE float pmadd(const float& a, const float& b, const float& c) {
|
||||
return ::fmaf(a, b, c);
|
||||
return std::fmaf(a, b, c);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE double pmadd(const double& a, const double& b, const double& c) {
|
||||
return ::fma(a, b, c);
|
||||
return std::fma(a, b, c);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE float pmsub(const float& a, const float& b, const float& c) {
|
||||
return ::fmaf(a, b, -c);
|
||||
return std::fmaf(a, b, -c);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE double pmsub(const double& a, const double& b, const double& c) {
|
||||
return ::fma(a, b, -c);
|
||||
return std::fma(a, b, -c);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE float pnmadd(const float& a, const float& b, const float& c) {
|
||||
return ::fmaf(-a, b, c);
|
||||
return std::fmaf(-a, b, c);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE double pnmadd(const double& a, const double& b, const double& c) {
|
||||
return ::fma(-a, b, c);
|
||||
return std::fma(-a, b, c);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE float pnmsub(const float& a, const float& b, const float& c) {
|
||||
return ::fmaf(-a, b, -c);
|
||||
return std::fmaf(-a, b, -c);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE double pnmsub(const double& a, const double& b, const double& c) {
|
||||
return ::fma(-a, b, -c);
|
||||
return std::fma(-a, b, -c);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -354,10 +354,12 @@ struct packet_traits<float> : default_packet_traits {
|
||||
|
||||
HasDiv = 1,
|
||||
|
||||
HasCmp = 1,
|
||||
HasSin = EIGEN_FAST_MATH,
|
||||
HasCos = EIGEN_FAST_MATH,
|
||||
HasLog = 1,
|
||||
HasExp = 1,
|
||||
HasPow = 1,
|
||||
HasSqrt = 1,
|
||||
HasTanh = EIGEN_FAST_MATH,
|
||||
HasErf = EIGEN_FAST_MATH,
|
||||
|
@ -20,7 +20,7 @@ namespace internal {
|
||||
|
||||
#if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ >= 12)
|
||||
inline Packet4ui p4ui_CONJ_XOR() {
|
||||
return {0x00000000, 0x80000000, 0x00000000, 0x80000000}; // vec_mergeh((Packet4ui)p4i_ZERO, (Packet4ui)p4f_MZERO);
|
||||
return Packet4ui {0x00000000, 0x80000000, 0x00000000, 0x80000000}; // vec_mergeh((Packet4ui)p4i_ZERO, (Packet4ui)p4f_MZERO);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -178,7 +178,7 @@ EIGEN_STRONG_INLINE Packet1cd pnegate(const Packet1cd& a) {
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet1cd pconj(const Packet1cd& a) {
|
||||
return Packet1cd((Packet2d)vec_xor((Packet2d)a.v, (Packet2d)p2ul_CONJ_XOR2));
|
||||
return Packet1cd((Packet2d)vec_xor((Packet2d)a.v, (Packet2d)p2ul_CONJ_XOR2()));
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet1cd pmul<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
|
||||
@ -257,8 +257,27 @@ EIGEN_STRONG_INLINE Packet1cd pdiv<Packet1cd>(const Packet1cd& a, const Packet1c
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet1cd plog<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
|
||||
return plog_complex(a, b);
|
||||
EIGEN_STRONG_INLINE Packet1cd psqrt<Packet1cd>(const Packet1cd& a) {
|
||||
return psqrt_complex<Packet1cd>(a);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2cf psqrt<Packet2cf>(const Packet2cf& a) {
|
||||
return psqrt_complex<Packet2cf>(a);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet1cd plog<Packet1cd>(const Packet1cd& a) {
|
||||
return plog_complex<Packet1cd>(a);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2cf plog<Packet2cf>(const Packet2cf& a) {
|
||||
return plog_complex<Packet2cf>(a);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2cf pexp<Packet2cf>(const Packet2cf& a) {
|
||||
return pexp_complex(a);
|
||||
}
|
||||
|
||||
EIGEN_STRONG_INLINE Packet1cd pcplxflip /*<Packet1cd>*/ (const Packet1cd& x) {
|
||||
@ -437,16 +456,6 @@ EIGEN_STRONG_INLINE Packet2cf pdiv<Packet2cf>(const Packet2cf& a, const Packet2c
|
||||
return pdiv_complex(a, b);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2cf plog<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
|
||||
return plog_complex(a, b);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2cf pexp<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
|
||||
return pexp_complex(a, b);
|
||||
}
|
||||
|
||||
EIGEN_STRONG_INLINE Packet2cf pcplxflip /*<Packet2cf>*/ (const Packet2cf& x) {
|
||||
Packet2cf res;
|
||||
res.cd[0] = pcplxflip(x.cd[0]);
|
||||
|
@ -23,6 +23,20 @@ namespace Eigen {
|
||||
|
||||
namespace internal {
|
||||
|
||||
EIGEN_DOUBLE_PACKET_FUNCTION(atanh, Packet2d)
|
||||
EIGEN_DOUBLE_PACKET_FUNCTION(log, Packet2d)
|
||||
EIGEN_DOUBLE_PACKET_FUNCTION(log2, Packet2d)
|
||||
EIGEN_DOUBLE_PACKET_FUNCTION(tanh, Packet2d)
|
||||
|
||||
EIGEN_FLOAT_PACKET_FUNCTION(atanh, Packet4f)
|
||||
EIGEN_FLOAT_PACKET_FUNCTION(log, Packet4f)
|
||||
EIGEN_FLOAT_PACKET_FUNCTION(log2, Packet4f)
|
||||
|
||||
EIGEN_GENERIC_PACKET_FUNCTION(atan, Packet2d)
|
||||
EIGEN_GENERIC_PACKET_FUNCTION(atan, Packet4f)
|
||||
EIGEN_GENERIC_PACKET_FUNCTION(exp2, Packet2d)
|
||||
EIGEN_GENERIC_PACKET_FUNCTION(exp2, Packet4f)
|
||||
|
||||
#if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ >= 12)
|
||||
static EIGEN_DECLARE_CONST_Packet4f(1, 1.0f);
|
||||
static EIGEN_DECLARE_CONST_Packet4f(half, 0.5f);
|
||||
@ -170,7 +184,7 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet4f pexp<Packet4f>(cons
|
||||
y = padd(y, p4f_1);
|
||||
|
||||
// build 2^n
|
||||
emm0 = (Packet4i){(int)fx[0], (int)fx[1], (int)fx[2], (int)fx[3]};
|
||||
emm0 = Packet4i{(int)fx[0], (int)fx[1], (int)fx[2], (int)fx[3]};
|
||||
emm0 = emm0 + p4i_0x7f;
|
||||
emm0 = emm0 << reinterpret_cast<Packet4i>(p4i_23);
|
||||
|
||||
|
@ -180,6 +180,7 @@ struct packet_traits<float> : default_packet_traits {
|
||||
AlignedOnScalar = 1,
|
||||
size = 4,
|
||||
|
||||
HasCmp = 1,
|
||||
HasAdd = 1,
|
||||
HasSub = 1,
|
||||
HasMul = 1,
|
||||
@ -250,6 +251,7 @@ struct unpacket_traits<Packet4f> {
|
||||
masked_store_available = false
|
||||
};
|
||||
typedef Packet4f half;
|
||||
typedef Packet4i integer_packet;
|
||||
};
|
||||
template <>
|
||||
struct unpacket_traits<Packet2d> {
|
||||
@ -262,6 +264,7 @@ struct unpacket_traits<Packet2d> {
|
||||
masked_store_available = false
|
||||
};
|
||||
typedef Packet2d half;
|
||||
typedef Packet2l integer_packet;
|
||||
};
|
||||
|
||||
/* Forward declaration */
|
||||
@ -313,38 +316,36 @@ inline std::ostream& operator<<(std::ostream& s, const Packet4f& v) {
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4i pload<Packet4i>(const int* from) {
|
||||
// FIXME: No intrinsic yet
|
||||
EIGEN_DEBUG_ALIGNED_LOAD
|
||||
Packet* vfrom;
|
||||
vfrom = (Packet*)from;
|
||||
return vfrom->v4i;
|
||||
return vec_xl(0, from);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2d pload<Packet2d>(const double* from) {
|
||||
// FIXME: No intrinsic yet
|
||||
EIGEN_DEBUG_ALIGNED_LOAD
|
||||
Packet* vfrom;
|
||||
vfrom = (Packet*)from;
|
||||
return vfrom->v2d;
|
||||
return vec_xl(0, from);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<int>(int* to, const Packet4i& from) {
|
||||
// FIXME: No intrinsic yet
|
||||
EIGEN_DEBUG_ALIGNED_STORE
|
||||
Packet* vto;
|
||||
vto = (Packet*)to;
|
||||
vto->v4i = from;
|
||||
vec_xst(from, 0, to);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<double>(double* to, const Packet2d& from) {
|
||||
// FIXME: No intrinsic yet
|
||||
EIGEN_DEBUG_ALIGNED_STORE
|
||||
Packet* vto;
|
||||
vto = (Packet*)to;
|
||||
vto->v2d = from;
|
||||
vec_xst(from, 0, to);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4f pfrexp<Packet4f>(const Packet4f& a, Packet4f& exponent) {
|
||||
return pfrexp_generic(a, exponent);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2d pfrexp<Packet2d>(const Packet2d& a, Packet2d& exponent) {
|
||||
return pfrexp_generic(a, exponent);
|
||||
}
|
||||
|
||||
template <>
|
||||
@ -540,7 +541,8 @@ EIGEN_STRONG_INLINE Packet2d pandnot<Packet2d>(const Packet2d& a, const Packet2d
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2d pround<Packet2d>(const Packet2d& a) {
|
||||
return vec_round(a);
|
||||
/* Uses non-default rounding for vec_round */
|
||||
return __builtin_s390_vfidb(a, 0, 1);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2d pceil<Packet2d>(const Packet2d& a) {
|
||||
@ -590,6 +592,45 @@ EIGEN_STRONG_INLINE void prefetch<double>(const double* addr) {
|
||||
EIGEN_ZVECTOR_PREFETCH(addr);
|
||||
}
|
||||
|
||||
template <int N>
|
||||
EIGEN_STRONG_INLINE Packet2l parithmetic_shift_right(const Packet2l& a) {
|
||||
return Packet2l { parithmetic_shift_right<N>(a[0]), parithmetic_shift_right<N>(a[1]) };
|
||||
}
|
||||
template <int N>
|
||||
EIGEN_STRONG_INLINE Packet4i parithmetic_shift_right(const Packet4i& a) {
|
||||
return Packet4i {
|
||||
parithmetic_shift_right<N>(a[0]),
|
||||
parithmetic_shift_right<N>(a[1]),
|
||||
parithmetic_shift_right<N>(a[2]),
|
||||
parithmetic_shift_right<N>(a[3]) };
|
||||
}
|
||||
|
||||
template <int N>
|
||||
EIGEN_STRONG_INLINE Packet2l plogical_shift_right(const Packet2l& a) {
|
||||
return Packet2l { plogical_shift_right<N>(a[0]), plogical_shift_right<N>(a[1]) };
|
||||
}
|
||||
template <int N>
|
||||
EIGEN_STRONG_INLINE Packet4i plogical_shift_right(const Packet4i& a) {
|
||||
return Packet4i {
|
||||
plogical_shift_right<N>(a[0]),
|
||||
plogical_shift_right<N>(a[1]),
|
||||
plogical_shift_right<N>(a[2]),
|
||||
plogical_shift_right<N>(a[3]) };
|
||||
}
|
||||
|
||||
template <int N>
|
||||
EIGEN_STRONG_INLINE Packet2l plogical_shift_left(const Packet2l& a) {
|
||||
return Packet2l { plogical_shift_left<N>(a[0]), plogical_shift_left<N>(a[1]) };
|
||||
}
|
||||
template <int N>
|
||||
EIGEN_STRONG_INLINE Packet4i plogical_shift_left(const Packet4i& a) {
|
||||
return Packet4i {
|
||||
plogical_shift_left<N>(a[0]),
|
||||
plogical_shift_left<N>(a[1]),
|
||||
plogical_shift_left<N>(a[2]),
|
||||
plogical_shift_left<N>(a[3]) };
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE int pfirst<Packet4i>(const Packet4i& a) {
|
||||
EIGEN_ALIGN16 int x[4];
|
||||
@ -906,8 +947,8 @@ EIGEN_STRONG_INLINE Packet4f pandnot<Packet4f>(const Packet4f& a, const Packet4f
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4f pround<Packet4f>(const Packet4f& a) {
|
||||
Packet4f res;
|
||||
res.v4f[0] = vec_round(a.v4f[0]);
|
||||
res.v4f[1] = vec_round(a.v4f[1]);
|
||||
res.v4f[0] = generic_round(a.v4f[0]);
|
||||
res.v4f[1] = generic_round(a.v4f[1]);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -1067,20 +1108,14 @@ Packet4f EIGEN_STRONG_INLINE pcmp_eq<Packet4f>(const Packet4f& a, const Packet4f
|
||||
#else
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4f pload<Packet4f>(const float* from) {
|
||||
// FIXME: No intrinsic yet
|
||||
EIGEN_DEBUG_ALIGNED_LOAD
|
||||
Packet* vfrom;
|
||||
vfrom = (Packet*)from;
|
||||
return vfrom->v4f;
|
||||
return vec_xl(0, from);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void pstore<float>(float* to, const Packet4f& from) {
|
||||
// FIXME: No intrinsic yet
|
||||
EIGEN_DEBUG_ALIGNED_STORE
|
||||
Packet* vto;
|
||||
vto = (Packet*)to;
|
||||
vto->v4f = from;
|
||||
vec_xst(from, 0, to);
|
||||
}
|
||||
|
||||
template <>
|
||||
@ -1171,7 +1206,8 @@ EIGEN_STRONG_INLINE Packet4f pandnot<Packet4f>(const Packet4f& a, const Packet4f
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4f pround<Packet4f>(const Packet4f& a) {
|
||||
return vec_round(a);
|
||||
/* Uses non-default rounding for vec_round */
|
||||
return __builtin_s390_vfisb(a, 0, 1);
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4f pceil<Packet4f>(const Packet4f& a) {
|
||||
@ -1262,6 +1298,28 @@ EIGEN_STRONG_INLINE Packet4f pblend(const Selector<4>& ifPacket, const Packet4f&
|
||||
|
||||
#endif
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4f pldexp<Packet4f>(const Packet4f& a, const Packet4f& exponent) {
|
||||
return pldexp_generic(a, exponent);
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2d pldexp<Packet2d>(const Packet2d& a, const Packet2d& exponent) {
|
||||
// Clamp exponent to [-2099, 2099]
|
||||
const Packet2d max_exponent = pset1<Packet2d>(2099.0);
|
||||
const Packet2l e = pcast<Packet2d, Packet2l>(pmin(pmax(exponent, pnegate(max_exponent)), max_exponent));
|
||||
|
||||
// Split 2^e into four factors and multiply:
|
||||
const Packet2l bias = {1023, 1023};
|
||||
Packet2l b = plogical_shift_right<2>(e); // floor(e/4)
|
||||
Packet2d c = reinterpret_cast<Packet2d>(plogical_shift_left<52>(b + bias));
|
||||
Packet2d out = pmul(pmul(pmul(a, c), c), c); // a * 2^(3b)
|
||||
b = psub(psub(psub(e, b), b), b); // e - 3b
|
||||
c = reinterpret_cast<Packet2d>(plogical_shift_left<52>(b + bias)); // 2^(e - 3b)
|
||||
out = pmul(out, c); // a * 2^e
|
||||
return out;
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE void prefetch<float>(const float* addr) {
|
||||
EIGEN_ZVECTOR_PREFETCH(addr);
|
||||
@ -1279,6 +1337,75 @@ EIGEN_STRONG_INLINE Packet4f plset<Packet4f>(const float& a) {
|
||||
return padd<Packet4f>(pset1<Packet4f>(a), p4f_COUNTDOWN);
|
||||
}
|
||||
|
||||
#if !defined(vec_float) || !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ < 13)
|
||||
#pragma GCC warning \
|
||||
"float->int and int->float conversion is simulated. compile for z15 for improved performance"
|
||||
template <>
|
||||
struct cast_impl<Packet4i, Packet4f> {
|
||||
EIGEN_DEVICE_FUNC static inline Packet4f run(const Packet4i& a) {
|
||||
return Packet4f{float(a[0]), float(a[1]), float(a[2]), float(a[3]) };
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct cast_impl<Packet4f, Packet4i> {
|
||||
EIGEN_DEVICE_FUNC static inline Packet4i run(const Packet4f& a) {
|
||||
return Packet4i{int(a[0]), int(a[1]), int(a[2]), int(a[3]) };
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct cast_impl<Packet2l, Packet2d> {
|
||||
EIGEN_DEVICE_FUNC static inline Packet2d run(const Packet2l& a) {
|
||||
return Packet2d{double(a[0]), double(a[1]) };
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct cast_impl<Packet2d, Packet2l> {
|
||||
EIGEN_DEVICE_FUNC static inline Packet2l run(const Packet2d& a) {
|
||||
return Packet2l{(long long)(a[0]), (long long)(a[1]) };
|
||||
}
|
||||
};
|
||||
#else
|
||||
template <>
|
||||
struct cast_impl<Packet4i, Packet4f> {
|
||||
EIGEN_DEVICE_FUNC static inline Packet4f run(const Packet4i& a) {
|
||||
return vec_float(a);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct cast_impl<Packet4f, Packet4i> {
|
||||
EIGEN_DEVICE_FUNC static inline Packet4i run(const Packet4f& a) {
|
||||
return vec_signed(a);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct cast_impl<Packet2l, Packet2d> {
|
||||
EIGEN_DEVICE_FUNC static inline Packet2d run(const Packet2l& a) {
|
||||
return vec_double(a);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct cast_impl<Packet2d, Packet2l> {
|
||||
EIGEN_DEVICE_FUNC static inline Packet2l run(const Packet2d& a) {
|
||||
return vec_signed(a);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet4f pset1frombits<Packet4f>(uint32_t from) {
|
||||
return pset1<Packet4f>(Eigen::numext::bit_cast<float>(from));
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2d pset1frombits<Packet2d>(uint64_t from) {
|
||||
return pset1<Packet2d>(Eigen::numext::bit_cast<double>(from));
|
||||
}
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
} // end namespace Eigen
|
||||
|
@ -207,20 +207,9 @@ struct functor_traits<scalar_cmp_op<LhsScalar, RhsScalar, cmp, UseTypedComparato
|
||||
};
|
||||
};
|
||||
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct typed_cmp_helper {
|
||||
static constexpr bool SameType = is_same<LhsScalar, RhsScalar>::value;
|
||||
static constexpr bool IsNumeric = is_arithmetic<typename NumTraits<LhsScalar>::Real>::value;
|
||||
static constexpr bool UseTyped = UseTypedComparators && SameType && IsNumeric;
|
||||
using type = typename conditional<UseTyped, LhsScalar, bool>::type;
|
||||
};
|
||||
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
using cmp_return_t = typename typed_cmp_helper<LhsScalar, RhsScalar, UseTypedComparators>::type;
|
||||
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_EQ, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = cmp_return_t<LhsScalar, RhsScalar, UseTypedComparators>;
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a == b ? result_type(1) : result_type(0);
|
||||
}
|
||||
@ -233,7 +222,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_EQ, UseTypedComparators> : binary
|
||||
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_LT, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = cmp_return_t<LhsScalar, RhsScalar, UseTypedComparators>;
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a < b ? result_type(1) : result_type(0);
|
||||
}
|
||||
@ -246,7 +235,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_LT, UseTypedComparators> : binary
|
||||
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_LE, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = cmp_return_t<LhsScalar, RhsScalar, UseTypedComparators>;
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a <= b ? result_type(1) : result_type(0);
|
||||
}
|
||||
@ -259,7 +248,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_LE, UseTypedComparators> : binary
|
||||
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_GT, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = cmp_return_t<LhsScalar, RhsScalar, UseTypedComparators>;
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a > b ? result_type(1) : result_type(0);
|
||||
}
|
||||
@ -272,7 +261,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_GT, UseTypedComparators> : binary
|
||||
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_GE, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = cmp_return_t<LhsScalar, RhsScalar, UseTypedComparators>;
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a >= b ? result_type(1) : result_type(0);
|
||||
}
|
||||
@ -285,7 +274,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_GE, UseTypedComparators> : binary
|
||||
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_UNORD, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = cmp_return_t<LhsScalar, RhsScalar, UseTypedComparators>;
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return !(a <= b || b <= a) ? result_type(1) : result_type(0);
|
||||
}
|
||||
@ -298,7 +287,7 @@ struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_UNORD, UseTypedComparators> : bin
|
||||
|
||||
template <typename LhsScalar, typename RhsScalar, bool UseTypedComparators>
|
||||
struct scalar_cmp_op<LhsScalar, RhsScalar, cmp_NEQ, UseTypedComparators> : binary_op_base<LhsScalar, RhsScalar> {
|
||||
using result_type = cmp_return_t<LhsScalar, RhsScalar, UseTypedComparators>;
|
||||
using result_type = std::conditional_t<UseTypedComparators, LhsScalar, bool>;
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(const LhsScalar& a, const RhsScalar& b) const {
|
||||
return a != b ? result_type(1) : result_type(0);
|
||||
}
|
||||
@ -362,11 +351,7 @@ template <typename Scalar, typename Exponent>
|
||||
struct functor_traits<scalar_pow_op<Scalar, Exponent>> {
|
||||
enum {
|
||||
Cost = 5 * NumTraits<Scalar>::MulCost,
|
||||
PacketAccess = (!NumTraits<Scalar>::IsComplex && !NumTraits<Scalar>::IsInteger && packet_traits<Scalar>::HasExp &&
|
||||
packet_traits<Scalar>::HasLog && packet_traits<Scalar>::HasRound && packet_traits<Scalar>::HasCmp &&
|
||||
// Temporarily disable packet access for half/bfloat16 until
|
||||
// accuracy is improved.
|
||||
!is_same<Scalar, half>::value && !is_same<Scalar, bfloat16>::value)
|
||||
PacketAccess = (!NumTraits<Scalar>::IsComplex && !NumTraits<Scalar>::IsInteger && packet_traits<Scalar>::HasPow)
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -47,7 +47,7 @@ inline void manage_multi_threading(Action action, int* v);
|
||||
// Public APIs.
|
||||
|
||||
/** Must be call first when calling Eigen from multiple threads */
|
||||
EIGEN_DEPRECATED inline void initParallel() {}
|
||||
EIGEN_DEPRECATED_WITH_REASON("Initialization is no longer needed.") inline void initParallel() {}
|
||||
|
||||
/** \returns the max number of threads reserved for Eigen
|
||||
* \sa setNbThreads */
|
||||
|
@ -230,7 +230,7 @@
|
||||
#define EIGEN_VECTORIZE_SSE4_2
|
||||
#endif
|
||||
#ifdef __AVX__
|
||||
#ifndef EIGEN_USE_SYCL
|
||||
#if !defined(EIGEN_USE_SYCL) && !EIGEN_COMP_EMSCRIPTEN
|
||||
#define EIGEN_VECTORIZE_AVX
|
||||
#endif
|
||||
#define EIGEN_VECTORIZE_SSE3
|
||||
|
@ -171,6 +171,8 @@ template <typename MatrixType, unsigned int Mode>
|
||||
class TriangularView;
|
||||
template <typename MatrixType, unsigned int Mode>
|
||||
class SelfAdjointView;
|
||||
template <typename Derived>
|
||||
class RealView;
|
||||
template <typename MatrixType>
|
||||
class SparseView;
|
||||
template <typename ExpressionType>
|
||||
@ -397,8 +399,6 @@ template <typename Scalar_, int Rows_, int Cols_,
|
||||
: EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION),
|
||||
int MaxRows_ = Rows_, int MaxCols_ = Cols_>
|
||||
class Array;
|
||||
template <typename ConditionMatrixType, typename ThenMatrixType, typename ElseMatrixType>
|
||||
class Select;
|
||||
template <typename MatrixType, typename BinaryOp, int Direction>
|
||||
class PartialReduxExpr;
|
||||
template <typename ExpressionType, int Direction>
|
||||
|
@ -17,13 +17,9 @@
|
||||
// Eigen version and basic defaults
|
||||
//------------------------------------------------------------------------------------------
|
||||
|
||||
#define EIGEN_WORLD_VERSION 3
|
||||
#define EIGEN_MAJOR_VERSION 4
|
||||
#define EIGEN_MINOR_VERSION 90
|
||||
|
||||
#define EIGEN_VERSION_AT_LEAST(x, y, z) \
|
||||
(EIGEN_WORLD_VERSION > x || \
|
||||
(EIGEN_WORLD_VERSION >= x && (EIGEN_MAJOR_VERSION > y || (EIGEN_MAJOR_VERSION >= y && EIGEN_MINOR_VERSION >= z))))
|
||||
(EIGEN_MAJOR_VERSION > x || \
|
||||
(EIGEN_MAJOR_VERSION >= x && (EIGEN_MINOR_VERSION > y || (EIGEN_MINOR_VERSION >= y && EIGEN_PATCH_VERSION >= z))))
|
||||
|
||||
#ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
|
||||
#define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::RowMajor
|
||||
@ -951,6 +947,18 @@
|
||||
#define EIGEN_DEPRECATED
|
||||
#endif
|
||||
|
||||
#ifndef EIGEN_NO_DEPRECATED_WARNING
|
||||
#if EIGEN_COMP_GNUC
|
||||
#define EIGEN_DEPRECATED_WITH_REASON(message) __attribute__((deprecated(message)))
|
||||
#elif EIGEN_COMP_MSVC
|
||||
#define EIGEN_DEPRECATED_WITH_REASON(message) __declspec(deprecated(message))
|
||||
#else
|
||||
#define EIGEN_DEPRECATED_WITH_REASON(message)
|
||||
#endif
|
||||
#else
|
||||
#define EIGEN_DEPRECATED_WITH_REASON(message)
|
||||
#endif
|
||||
|
||||
#if EIGEN_COMP_GNUC
|
||||
#define EIGEN_UNUSED __attribute__((unused))
|
||||
#else
|
||||
@ -1000,8 +1008,9 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void ignore_unused_variable(cons
|
||||
#endif
|
||||
|
||||
#if !defined(EIGEN_OPTIMIZATION_BARRIER)
|
||||
#if EIGEN_COMP_GNUC
|
||||
// According to https://gcc.gnu.org/onlinedocs/gcc/Constraints.html:
|
||||
// Implement the barrier on GNUC compilers or clang-cl.
|
||||
#if EIGEN_COMP_GNUC || (defined(__clang__) && defined(_MSC_VER))
|
||||
// According to https://gcc.gnu.org/onlinedocs/gcc/Constraints.html:
|
||||
// X: Any operand whatsoever.
|
||||
// r: A register operand is allowed provided that it is in a general
|
||||
// register.
|
||||
@ -1034,37 +1043,37 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void ignore_unused_variable(cons
|
||||
// directly for std::complex<T>, Eigen::half, Eigen::bfloat16. For these,
|
||||
// you will need to apply to the underlying POD type.
|
||||
#if EIGEN_ARCH_PPC && EIGEN_COMP_GNUC_STRICT
|
||||
// This seems to be broken on clang. Packet4f is loaded into a single
|
||||
// This seems to be broken on clang. Packet4f is loaded into a single
|
||||
// register rather than a vector, zeroing out some entries. Integer
|
||||
// types also generate a compile error.
|
||||
#if EIGEN_OS_MAC
|
||||
// General, Altivec for Apple (VSX were added in ISA v2.06):
|
||||
// General, Altivec for Apple (VSX were added in ISA v2.06):
|
||||
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__("" : "+r,v"(X));
|
||||
#else
|
||||
// General, Altivec, VSX otherwise:
|
||||
// General, Altivec, VSX otherwise:
|
||||
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__("" : "+r,v,wa"(X));
|
||||
#endif
|
||||
#elif EIGEN_ARCH_ARM_OR_ARM64
|
||||
#ifdef __ARM_FP
|
||||
// General, VFP or NEON.
|
||||
// General, VFP or NEON.
|
||||
// Clang doesn't like "r",
|
||||
// error: non-trivial scalar-to-vector conversion, possible invalid
|
||||
// constraint for vector typ
|
||||
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__("" : "+g,w"(X));
|
||||
#else
|
||||
// Arm without VFP or NEON.
|
||||
// Arm without VFP or NEON.
|
||||
// "w" constraint will not compile.
|
||||
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__("" : "+g"(X));
|
||||
#endif
|
||||
#elif EIGEN_ARCH_i386_OR_x86_64
|
||||
// General, SSE.
|
||||
// General, SSE.
|
||||
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__("" : "+g,x"(X));
|
||||
#else
|
||||
// Not implemented for other architectures.
|
||||
// Not implemented for other architectures.
|
||||
#define EIGEN_OPTIMIZATION_BARRIER(X)
|
||||
#endif
|
||||
#else
|
||||
// Not implemented for other compilers.
|
||||
// Not implemented for other compilers.
|
||||
#define EIGEN_OPTIMIZATION_BARRIER(X)
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1339,6 +1339,21 @@ EIGEN_DEVICE_FUNC void destroy_at(T* p) {
|
||||
}
|
||||
#endif
|
||||
|
||||
/** \internal
|
||||
* This informs the implementation that PTR is aligned to at least ALIGN_BYTES
|
||||
*/
|
||||
#ifndef EIGEN_ASSUME_ALIGNED
|
||||
#if defined(__cpp_lib_assume_aligned) && (__cpp_lib_assume_aligned >= 201811L)
|
||||
#define EIGEN_ASSUME_ALIGNED(PTR, ALIGN_BYTES) \
|
||||
{ PTR = std::assume_aligned<8 * (ALIGN_BYTES)>(PTR); }
|
||||
#elif EIGEN_HAS_BUILTIN(__builtin_assume_aligned)
|
||||
#define EIGEN_ASSUME_ALIGNED(PTR, ALIGN_BYTES) \
|
||||
{ PTR = static_cast<decltype(PTR)>(__builtin_assume_aligned(PTR, (ALIGN_BYTES))); }
|
||||
#else
|
||||
#define EIGEN_ASSUME_ALIGNED(PTR, ALIGN_BYTES) /* do nothing */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
} // end namespace Eigen
|
||||
|
@ -28,7 +28,8 @@ class Serializer;
|
||||
|
||||
// Specialization for POD types.
|
||||
template <typename T>
|
||||
class Serializer<T, typename std::enable_if_t<std::is_trivial<T>::value && std::is_standard_layout<T>::value>> {
|
||||
class Serializer<T,
|
||||
typename std::enable_if_t<std::is_trivially_copyable<T>::value && std::is_standard_layout<T>::value>> {
|
||||
public:
|
||||
/**
|
||||
* Determines the required size of the serialization buffer for a value.
|
||||
|
@ -409,7 +409,7 @@ inline void RealSchur<MatrixType>::computeShift(Index iu, Index iter, Scalar& ex
|
||||
shiftInfo.coeffRef(2) = m_matT.coeff(iu, iu - 1) * m_matT.coeff(iu - 1, iu);
|
||||
|
||||
// Alternate exceptional shifting strategy every 16 iterations.
|
||||
if (iter % 16 == 0) {
|
||||
if (iter > 0 && iter % 16 == 0) {
|
||||
// Wilkinson's original ad hoc shift
|
||||
if (iter % 32 != 0) {
|
||||
exshift += shiftInfo.coeff(0);
|
||||
|
@ -325,6 +325,22 @@ class SelfAdjointEigenSolver {
|
||||
return m_eivec * m_eivalues.cwiseSqrt().asDiagonal() * m_eivec.adjoint();
|
||||
}
|
||||
|
||||
/** \brief Computes the matrix exponential the matrix.
|
||||
*
|
||||
* \returns the matrix exponential the matrix.
|
||||
*
|
||||
* \pre The eigenvalues and eigenvectors of a positive-definite matrix
|
||||
* have been computed before.
|
||||
*
|
||||
* \sa operatorInverseSqrt(), operatorSqrt(),
|
||||
* <a href="unsupported/group__MatrixFunctions__Module.html">MatrixFunctions Module</a>
|
||||
*/
|
||||
EIGEN_DEVICE_FUNC MatrixType operatorExp() const {
|
||||
eigen_assert(m_isInitialized && "SelfAdjointEigenSolver is not initialized.");
|
||||
eigen_assert(m_eigenvectorsOk && "The eigenvectors have not been computed together with the eigenvalues.");
|
||||
return m_eivec * m_eivalues.array().exp().matrix().asDiagonal() * m_eivec.adjoint();
|
||||
}
|
||||
|
||||
/** \brief Computes the inverse square root of the matrix.
|
||||
*
|
||||
* \returns the inverse positive-definite square root of the matrix
|
||||
|
@ -133,8 +133,8 @@ EIGEN_DEVICE_FUNC inline Matrix<typename MatrixBase<Derived>::Scalar, 3, 1> Matr
|
||||
* \sa class AngleAxis
|
||||
*/
|
||||
template <typename Derived>
|
||||
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline Matrix<typename MatrixBase<Derived>::Scalar, 3, 1>
|
||||
MatrixBase<Derived>::eulerAngles(Index a0, Index a1, Index a2) const {
|
||||
EIGEN_DEVICE_FUNC inline Matrix<typename MatrixBase<Derived>::Scalar, 3, 1> MatrixBase<Derived>::eulerAngles(
|
||||
Index a0, Index a1, Index a2) const {
|
||||
/* Implemented from Graphics Gems IV */
|
||||
EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Derived, 3, 3)
|
||||
|
||||
|
@ -80,14 +80,12 @@ class Homogeneous : public MatrixBase<Homogeneous<MatrixType, Direction_> >, int
|
||||
|
||||
template <typename Rhs>
|
||||
EIGEN_DEVICE_FUNC inline const Product<Homogeneous, Rhs> operator*(const MatrixBase<Rhs>& rhs) const {
|
||||
eigen_assert(int(Direction) == Horizontal);
|
||||
return Product<Homogeneous, Rhs>(*this, rhs.derived());
|
||||
}
|
||||
|
||||
template <typename Lhs>
|
||||
friend EIGEN_DEVICE_FUNC inline const Product<Lhs, Homogeneous> operator*(const MatrixBase<Lhs>& lhs,
|
||||
const Homogeneous& rhs) {
|
||||
eigen_assert(int(Direction) == Vertical);
|
||||
return Product<Lhs, Homogeneous>(lhs.derived(), rhs);
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ class KLU : public SparseSolverBase<KLU<MatrixType_> > {
|
||||
factorize_impl();
|
||||
}
|
||||
|
||||
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
||||
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
||||
*
|
||||
* This function is particularly useful when solving for several problems having the same structure.
|
||||
*
|
||||
@ -182,7 +182,7 @@ class KLU : public SparseSolverBase<KLU<MatrixType_> > {
|
||||
|
||||
/** Performs a numeric decomposition of \a matrix
|
||||
*
|
||||
* The given matrix must has the same sparcity than the matrix on which the pattern anylysis has been performed.
|
||||
* The given matrix must has the same sparsity than the matrix on which the pattern anylysis has been performed.
|
||||
*
|
||||
* \sa analyzePattern(), compute()
|
||||
*/
|
||||
|
@ -147,7 +147,7 @@ class PardisoImpl : public SparseSolverBase<Derived> {
|
||||
* See the PARDISO manual to know how to use it. */
|
||||
ParameterType& pardisoParameterArray() { return m_iparm; }
|
||||
|
||||
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
||||
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
||||
*
|
||||
* This function is particularly useful when solving for several problems having the same structure.
|
||||
*
|
||||
@ -157,7 +157,7 @@ class PardisoImpl : public SparseSolverBase<Derived> {
|
||||
|
||||
/** Performs a numeric decomposition of \a matrix
|
||||
*
|
||||
* The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
|
||||
* The given matrix must has the same sparsity than the matrix on which the symbolic decomposition has been performed.
|
||||
*
|
||||
* \sa analyzePattern()
|
||||
*/
|
||||
|
@ -155,7 +155,8 @@ class BDCSVD : public SVDBase<BDCSVD<MatrixType_, Options_> > {
|
||||
* \deprecated Will be removed in the next major Eigen version. Options should
|
||||
* be specified in the \a Options template parameter.
|
||||
*/
|
||||
EIGEN_DEPRECATED BDCSVD(Index rows, Index cols, unsigned int computationOptions) : m_algoswap(16), m_numIters(0) {
|
||||
EIGEN_DEPRECATED_WITH_REASON("Options should be specified using the class template parameter.")
|
||||
BDCSVD(Index rows, Index cols, unsigned int computationOptions) : m_algoswap(16), m_numIters(0) {
|
||||
internal::check_svd_options_assertions<MatrixType, Options>(computationOptions, rows, cols);
|
||||
allocate(rows, cols, computationOptions);
|
||||
}
|
||||
@ -183,8 +184,8 @@ class BDCSVD : public SVDBase<BDCSVD<MatrixType_, Options_> > {
|
||||
* be specified in the \a Options template parameter.
|
||||
*/
|
||||
template <typename Derived>
|
||||
EIGEN_DEPRECATED BDCSVD(const MatrixBase<Derived>& matrix, unsigned int computationOptions)
|
||||
: m_algoswap(16), m_numIters(0) {
|
||||
EIGEN_DEPRECATED_WITH_REASON("Options should be specified using the class template parameter.")
|
||||
BDCSVD(const MatrixBase<Derived>& matrix, unsigned int computationOptions) : m_algoswap(16), m_numIters(0) {
|
||||
internal::check_svd_options_assertions<MatrixType, Options>(computationOptions, matrix.rows(), matrix.cols());
|
||||
compute_impl(matrix, computationOptions);
|
||||
}
|
||||
@ -211,7 +212,8 @@ class BDCSVD : public SVDBase<BDCSVD<MatrixType_, Options_> > {
|
||||
* be specified in the \a Options template parameter.
|
||||
*/
|
||||
template <typename Derived>
|
||||
EIGEN_DEPRECATED BDCSVD& compute(const MatrixBase<Derived>& matrix, unsigned int computationOptions) {
|
||||
EIGEN_DEPRECATED_WITH_REASON("Options should be specified using the class template parameter.")
|
||||
BDCSVD& compute(const MatrixBase<Derived>& matrix, unsigned int computationOptions) {
|
||||
internal::check_svd_options_assertions<MatrixType, Options>(computationOptions, matrix.rows(), matrix.cols());
|
||||
return compute_impl(matrix, computationOptions);
|
||||
}
|
||||
|
@ -555,7 +555,8 @@ class JacobiSVD : public SVDBase<JacobiSVD<MatrixType_, Options_> > {
|
||||
* \deprecated Will be removed in the next major Eigen version. Options should
|
||||
* be specified in the \a Options template parameter.
|
||||
*/
|
||||
EIGEN_DEPRECATED JacobiSVD(Index rows, Index cols, unsigned int computationOptions) {
|
||||
EIGEN_DEPRECATED_WITH_REASON("Options should be specified using the class template parameter.")
|
||||
JacobiSVD(Index rows, Index cols, unsigned int computationOptions) {
|
||||
internal::check_svd_options_assertions<MatrixType, Options>(computationOptions, rows, cols);
|
||||
allocate(rows, cols, computationOptions);
|
||||
}
|
||||
@ -610,7 +611,8 @@ class JacobiSVD : public SVDBase<JacobiSVD<MatrixType_, Options_> > {
|
||||
* be specified in the \a Options template parameter.
|
||||
*/
|
||||
template <typename Derived>
|
||||
EIGEN_DEPRECATED JacobiSVD& compute(const MatrixBase<Derived>& matrix, unsigned int computationOptions) {
|
||||
EIGEN_DEPRECATED_WITH_REASON("Options should be specified using the class template parameter.")
|
||||
JacobiSVD& compute(const MatrixBase<Derived>& matrix, unsigned int computationOptions) {
|
||||
internal::check_svd_options_assertions<MatrixBase<Derived>, Options>(m_computationOptions, matrix.rows(),
|
||||
matrix.cols());
|
||||
return compute_impl(matrix, computationOptions);
|
||||
|
@ -406,7 +406,7 @@ class SimplicialLLT : public SimplicialCholeskyBase<SimplicialLLT<MatrixType_, U
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
||||
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
||||
*
|
||||
* This function is particularly useful when solving for several problems having the same structure.
|
||||
*
|
||||
@ -416,7 +416,7 @@ class SimplicialLLT : public SimplicialCholeskyBase<SimplicialLLT<MatrixType_, U
|
||||
|
||||
/** Performs a numeric decomposition of \a matrix
|
||||
*
|
||||
* The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
|
||||
* The given matrix must has the same sparsity than the matrix on which the symbolic decomposition has been performed.
|
||||
*
|
||||
* \sa analyzePattern()
|
||||
*/
|
||||
@ -494,7 +494,7 @@ class SimplicialLDLT : public SimplicialCholeskyBase<SimplicialLDLT<MatrixType_,
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
||||
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
||||
*
|
||||
* This function is particularly useful when solving for several problems having the same structure.
|
||||
*
|
||||
@ -504,7 +504,7 @@ class SimplicialLDLT : public SimplicialCholeskyBase<SimplicialLDLT<MatrixType_,
|
||||
|
||||
/** Performs a numeric decomposition of \a matrix
|
||||
*
|
||||
* The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
|
||||
* The given matrix must has the same sparsity than the matrix on which the symbolic decomposition has been performed.
|
||||
*
|
||||
* \sa analyzePattern()
|
||||
*/
|
||||
@ -575,7 +575,7 @@ class SimplicialNonHermitianLLT
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
||||
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
||||
*
|
||||
* This function is particularly useful when solving for several problems having the same structure.
|
||||
*
|
||||
@ -585,7 +585,7 @@ class SimplicialNonHermitianLLT
|
||||
|
||||
/** Performs a numeric decomposition of \a matrix
|
||||
*
|
||||
* The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
|
||||
* The given matrix must has the same sparsity than the matrix on which the symbolic decomposition has been performed.
|
||||
*
|
||||
* \sa analyzePattern()
|
||||
*/
|
||||
@ -664,7 +664,7 @@ class SimplicialNonHermitianLDLT
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
||||
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
||||
*
|
||||
* This function is particularly useful when solving for several problems having the same structure.
|
||||
*
|
||||
@ -674,7 +674,7 @@ class SimplicialNonHermitianLDLT
|
||||
|
||||
/** Performs a numeric decomposition of \a matrix
|
||||
*
|
||||
* The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
|
||||
* The given matrix must has the same sparsity than the matrix on which the symbolic decomposition has been performed.
|
||||
*
|
||||
* \sa analyzePattern()
|
||||
*/
|
||||
@ -742,7 +742,7 @@ class SimplicialCholesky : public SimplicialCholeskyBase<SimplicialCholesky<Matr
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
||||
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
||||
*
|
||||
* This function is particularly useful when solving for several problems having the same structure.
|
||||
*
|
||||
@ -757,7 +757,7 @@ class SimplicialCholesky : public SimplicialCholeskyBase<SimplicialCholesky<Matr
|
||||
|
||||
/** Performs a numeric decomposition of \a matrix
|
||||
*
|
||||
* The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
|
||||
* The given matrix must has the same sparsity than the matrix on which the symbolic decomposition has been performed.
|
||||
*
|
||||
* \sa analyzePattern()
|
||||
*/
|
||||
|
@ -480,6 +480,7 @@ class CompressedStorageIterator {
|
||||
return *this;
|
||||
}
|
||||
inline reference operator*() const { return reference(m_data.keyPtr() + m_index, m_data.valuePtr() + m_index); }
|
||||
inline reference operator[](int index) { return *(*this + index); }
|
||||
|
||||
#define MAKE_COMP(OP) \
|
||||
inline bool operator OP(const CompressedStorageIterator& other) const { return m_index OP other.m_index; }
|
||||
|
@ -36,10 +36,10 @@ inline typename internal::traits<Derived>::Scalar SparseMatrixBase<Derived>::dot
|
||||
Scalar res1(0);
|
||||
Scalar res2(0);
|
||||
for (; i; ++i) {
|
||||
res1 = numext::fma(numext::conj(i.value()), other.coeff(i.index()), res1);
|
||||
res1 = numext::madd<Scalar>(numext::conj(i.value()), other.coeff(i.index()), res1);
|
||||
++i;
|
||||
if (i) {
|
||||
res2 = numext::fma(numext::conj(i.value()), other.coeff(i.index()), res2);
|
||||
res2 = numext::madd<Scalar>(numext::conj(i.value()), other.coeff(i.index()), res2);
|
||||
}
|
||||
}
|
||||
return res1 + res2;
|
||||
@ -67,7 +67,7 @@ inline typename internal::traits<Derived>::Scalar SparseMatrixBase<Derived>::dot
|
||||
Scalar res(0);
|
||||
while (i && j) {
|
||||
if (i.index() == j.index()) {
|
||||
res += numext::conj(i.value()) * j.value();
|
||||
res = numext::madd<Scalar>(numext::conj(i.value()), j.value(), res);
|
||||
++i;
|
||||
++j;
|
||||
} else if (i.index() < j.index())
|
||||
|
@ -1130,7 +1130,11 @@ void set_from_triplets(const InputIterator& begin, const InputIterator& end, Spa
|
||||
using TransposedSparseMatrix =
|
||||
SparseMatrix<typename SparseMatrixType::Scalar, IsRowMajor ? ColMajor : RowMajor, StorageIndex>;
|
||||
|
||||
if (begin == end) return;
|
||||
if (begin == end) {
|
||||
// Clear out existing data (if any).
|
||||
mat.setZero();
|
||||
return;
|
||||
}
|
||||
|
||||
// There are two strategies to consider for constructing a matrix from unordered triplets:
|
||||
// A) construct the 'mat' in its native storage order and sort in-place (less memory); or,
|
||||
|
@ -224,33 +224,84 @@ class SparseMatrixBase : public EigenBase<Derived> {
|
||||
public:
|
||||
#ifndef EIGEN_NO_IO
|
||||
friend std::ostream& operator<<(std::ostream& s, const SparseMatrixBase& m) {
|
||||
typedef typename Derived::Nested Nested;
|
||||
typedef internal::remove_all_t<Nested> NestedCleaned;
|
||||
using Nested = typename Derived::Nested;
|
||||
using NestedCleaned = typename internal::remove_all<Nested>::type;
|
||||
|
||||
if (Flags & RowMajorBit) {
|
||||
Nested nm(m.derived());
|
||||
internal::evaluator<NestedCleaned> thisEval(nm);
|
||||
|
||||
// compute global width
|
||||
std::size_t width = 0;
|
||||
{
|
||||
std::ostringstream ss0;
|
||||
ss0.copyfmt(s);
|
||||
ss0 << Scalar(0);
|
||||
width = ss0.str().size();
|
||||
for (Index row = 0; row < nm.outerSize(); ++row) {
|
||||
for (typename internal::evaluator<NestedCleaned>::InnerIterator it(thisEval, row); it; ++it) {
|
||||
std::ostringstream ss;
|
||||
ss.copyfmt(s);
|
||||
ss << it.value();
|
||||
|
||||
const std::size_t potential_width = ss.str().size();
|
||||
if (potential_width > width) width = potential_width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Index row = 0; row < nm.outerSize(); ++row) {
|
||||
Index col = 0;
|
||||
for (typename internal::evaluator<NestedCleaned>::InnerIterator it(thisEval, row); it; ++it) {
|
||||
for (; col < it.index(); ++col) s << "0 ";
|
||||
for (; col < it.index(); ++col) {
|
||||
s.width(width);
|
||||
s << Scalar(0) << " ";
|
||||
}
|
||||
s.width(width);
|
||||
s << it.value() << " ";
|
||||
++col;
|
||||
}
|
||||
for (; col < m.cols(); ++col) s << "0 ";
|
||||
for (; col < m.cols(); ++col) {
|
||||
s.width(width);
|
||||
s << Scalar(0) << " ";
|
||||
}
|
||||
s << std::endl;
|
||||
}
|
||||
} else {
|
||||
Nested nm(m.derived());
|
||||
internal::evaluator<NestedCleaned> thisEval(nm);
|
||||
if (m.cols() == 1) {
|
||||
// compute local width (single col)
|
||||
std::size_t width = 0;
|
||||
{
|
||||
std::ostringstream ss0;
|
||||
ss0.copyfmt(s);
|
||||
ss0 << Scalar(0);
|
||||
width = ss0.str().size();
|
||||
for (typename internal::evaluator<NestedCleaned>::InnerIterator it(thisEval, 0); it; ++it) {
|
||||
std::ostringstream ss;
|
||||
ss.copyfmt(s);
|
||||
ss << it.value();
|
||||
|
||||
const std::size_t potential_width = ss.str().size();
|
||||
if (potential_width > width) width = potential_width;
|
||||
}
|
||||
}
|
||||
|
||||
Index row = 0;
|
||||
for (typename internal::evaluator<NestedCleaned>::InnerIterator it(thisEval, 0); it; ++it) {
|
||||
for (; row < it.index(); ++row) s << "0" << std::endl;
|
||||
for (; row < it.index(); ++row) {
|
||||
s.width(width);
|
||||
s << Scalar(0) << std::endl;
|
||||
}
|
||||
s.width(width);
|
||||
s << it.value() << std::endl;
|
||||
++row;
|
||||
}
|
||||
for (; row < m.rows(); ++row) s << "0" << std::endl;
|
||||
for (; row < m.rows(); ++row) {
|
||||
s.width(width);
|
||||
s << Scalar(0) << std::endl;
|
||||
}
|
||||
} else {
|
||||
SparseMatrix<Scalar, RowMajorBit, StorageIndex> trans = m;
|
||||
s << static_cast<const SparseMatrixBase<SparseMatrix<Scalar, RowMajorBit, StorageIndex> >&>(trans);
|
||||
|
@ -354,40 +354,40 @@ class SparseVector : public SparseCompressedBase<SparseVector<Scalar_, Options_,
|
||||
|
||||
public:
|
||||
/** \internal \deprecated use setZero() and reserve() */
|
||||
EIGEN_DEPRECATED void startFill(Index reserve) {
|
||||
EIGEN_DEPRECATED_WITH_REASON("Use .setZero() and .reserve() instead.") void startFill(Index reserve) {
|
||||
setZero();
|
||||
m_data.reserve(reserve);
|
||||
}
|
||||
|
||||
/** \internal \deprecated use insertBack(Index,Index) */
|
||||
EIGEN_DEPRECATED Scalar& fill(Index r, Index c) {
|
||||
EIGEN_DEPRECATED_WITH_REASON("Use .insertBack() instead.") Scalar& fill(Index r, Index c) {
|
||||
eigen_assert(r == 0 || c == 0);
|
||||
return fill(IsColVector ? r : c);
|
||||
}
|
||||
|
||||
/** \internal \deprecated use insertBack(Index) */
|
||||
EIGEN_DEPRECATED Scalar& fill(Index i) {
|
||||
EIGEN_DEPRECATED_WITH_REASON("Use .insertBack() instead.") Scalar& fill(Index i) {
|
||||
m_data.append(0, i);
|
||||
return m_data.value(m_data.size() - 1);
|
||||
}
|
||||
|
||||
/** \internal \deprecated use insert(Index,Index) */
|
||||
EIGEN_DEPRECATED Scalar& fillrand(Index r, Index c) {
|
||||
EIGEN_DEPRECATED_WITH_REASON("Use .insert() instead.") Scalar& fillrand(Index r, Index c) {
|
||||
eigen_assert(r == 0 || c == 0);
|
||||
return fillrand(IsColVector ? r : c);
|
||||
}
|
||||
|
||||
/** \internal \deprecated use insert(Index) */
|
||||
EIGEN_DEPRECATED Scalar& fillrand(Index i) { return insert(i); }
|
||||
EIGEN_DEPRECATED_WITH_REASON("Use .insert() instead.") Scalar& fillrand(Index i) { return insert(i); }
|
||||
|
||||
/** \internal \deprecated use finalize() */
|
||||
EIGEN_DEPRECATED void endFill() {}
|
||||
EIGEN_DEPRECATED_WITH_REASON("Use .finalize() instead.") void endFill() {}
|
||||
|
||||
// These two functions were here in the 3.1 release, so let's keep them in case some code rely on them.
|
||||
/** \internal \deprecated use data() */
|
||||
EIGEN_DEPRECATED Storage& _data() { return m_data; }
|
||||
EIGEN_DEPRECATED_WITH_REASON("Use .data() instead.") Storage& _data() { return m_data; }
|
||||
/** \internal \deprecated use data() */
|
||||
EIGEN_DEPRECATED const Storage& _data() const { return m_data; }
|
||||
EIGEN_DEPRECATED_WITH_REASON("Use .data() instead.") const Storage& _data() const { return m_data; }
|
||||
|
||||
#ifdef EIGEN_SPARSEVECTOR_PLUGIN
|
||||
#include EIGEN_SPARSEVECTOR_PLUGIN
|
||||
|
@ -41,7 +41,7 @@ struct sparse_solve_triangular_selector<Lhs, Rhs, Mode, Lower, RowMajor> {
|
||||
lastVal = it.value();
|
||||
lastIndex = it.index();
|
||||
if (lastIndex == i) break;
|
||||
tmp -= lastVal * other.coeff(lastIndex, col);
|
||||
tmp = numext::madd<Scalar>(-lastVal, other.coeff(lastIndex, col), tmp);
|
||||
}
|
||||
if (Mode & UnitDiag)
|
||||
other.coeffRef(i, col) = tmp;
|
||||
@ -75,7 +75,7 @@ struct sparse_solve_triangular_selector<Lhs, Rhs, Mode, Upper, RowMajor> {
|
||||
} else if (it && it.index() == i)
|
||||
++it;
|
||||
for (; it; ++it) {
|
||||
tmp -= it.value() * other.coeff(it.index(), col);
|
||||
tmp = numext::madd<Scalar>(-it.value(), other.coeff(it.index(), col), tmp);
|
||||
}
|
||||
|
||||
if (Mode & UnitDiag)
|
||||
@ -107,7 +107,9 @@ struct sparse_solve_triangular_selector<Lhs, Rhs, Mode, Lower, ColMajor> {
|
||||
tmp /= it.value();
|
||||
}
|
||||
if (it && it.index() == i) ++it;
|
||||
for (; it; ++it) other.coeffRef(it.index(), col) -= tmp * it.value();
|
||||
for (; it; ++it) {
|
||||
other.coeffRef(it.index(), col) = numext::madd<Scalar>(-tmp, it.value(), other.coeffRef(it.index(), col));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -135,7 +137,9 @@ struct sparse_solve_triangular_selector<Lhs, Rhs, Mode, Upper, ColMajor> {
|
||||
other.coeffRef(i, col) /= it.value();
|
||||
}
|
||||
LhsIterator it(lhsEval, i);
|
||||
for (; it && it.index() < i; ++it) other.coeffRef(it.index(), col) -= tmp * it.value();
|
||||
for (; it && it.index() < i; ++it) {
|
||||
other.coeffRef(it.index(), col) = numext::madd<Scalar>(-tmp, it.value(), other.coeffRef(it.index(), col));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -215,9 +219,13 @@ struct sparse_solve_triangular_sparse_selector<Lhs, Rhs, Mode, UpLo, ColMajor> {
|
||||
tempVector.restart();
|
||||
if (IsLower) {
|
||||
if (it.index() == i) ++it;
|
||||
for (; it; ++it) tempVector.coeffRef(it.index()) -= ci * it.value();
|
||||
for (; it; ++it) {
|
||||
tempVector.coeffRef(it.index()) = numext::madd<Scalar>(-ci, it.value(), tempVector.coeffRef(it.index()));
|
||||
}
|
||||
} else {
|
||||
for (; it && it.index() < i; ++it) tempVector.coeffRef(it.index()) -= ci * it.value();
|
||||
for (; it && it.index() < i; ++it) {
|
||||
tempVector.coeffRef(it.index()) = numext::madd<Scalar>(-ci, it.value(), tempVector.coeffRef(it.index()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,24 @@ DECL_GSSVX(z, double, std::complex<double>)
|
||||
#ifdef EIGEN_SUPERLU_HAS_ILU
|
||||
|
||||
// similarly for the incomplete factorization using gsisx
|
||||
#if defined(SUPERLU_MAJOR_VERSION) && (SUPERLU_MAJOR_VERSION >= 5)
|
||||
#define DECL_GSISX(PREFIX, FLOATTYPE, KEYTYPE) \
|
||||
extern "C" { \
|
||||
extern void PREFIX##gsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, FLOATTYPE *, FLOATTYPE *, \
|
||||
SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, FLOATTYPE *, \
|
||||
FLOATTYPE *, GlobalLU_t *, mem_usage_t *, SuperLUStat_t *, int *); \
|
||||
} \
|
||||
inline float SuperLU_gsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, \
|
||||
char *equed, FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, SuperMatrix *U, void *work, \
|
||||
int lwork, SuperMatrix *B, SuperMatrix *X, FLOATTYPE *recip_pivot_growth, \
|
||||
FLOATTYPE *rcond, SuperLUStat_t *stats, int *info, KEYTYPE) { \
|
||||
mem_usage_t mem_usage; \
|
||||
GlobalLU_t gLU; \
|
||||
PREFIX##gsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work, lwork, B, X, recip_pivot_growth, rcond, \
|
||||
&gLU, &mem_usage, stats, info); \
|
||||
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
||||
}
|
||||
#else // version < 5.0
|
||||
#define DECL_GSISX(PREFIX, FLOATTYPE, KEYTYPE) \
|
||||
extern "C" { \
|
||||
extern void PREFIX##gsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, FLOATTYPE *, FLOATTYPE *, \
|
||||
@ -80,6 +98,7 @@ DECL_GSSVX(z, double, std::complex<double>)
|
||||
&mem_usage, stats, info); \
|
||||
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
||||
}
|
||||
#endif
|
||||
|
||||
DECL_GSISX(s, float, float)
|
||||
DECL_GSISX(c, float, std::complex<float>)
|
||||
@ -320,7 +339,7 @@ class SuperLUBase : public SparseSolverBase<Derived> {
|
||||
derived().factorize(matrix);
|
||||
}
|
||||
|
||||
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
||||
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
||||
*
|
||||
* This function is particularly useful when solving for several problems having the same structure.
|
||||
*
|
||||
@ -454,7 +473,7 @@ class SuperLU : public SuperLUBase<MatrixType_, SuperLU<MatrixType_> > {
|
||||
|
||||
~SuperLU() {}
|
||||
|
||||
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
||||
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
||||
*
|
||||
* This function is particularly useful when solving for several problems having the same structure.
|
||||
*
|
||||
@ -468,7 +487,7 @@ class SuperLU : public SuperLUBase<MatrixType_, SuperLU<MatrixType_> > {
|
||||
|
||||
/** Performs a numeric decomposition of \a matrix
|
||||
*
|
||||
* The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
|
||||
* The given matrix must has the same sparsity than the matrix on which the symbolic decomposition has been performed.
|
||||
*
|
||||
* \sa analyzePattern()
|
||||
*/
|
||||
@ -762,7 +781,7 @@ class SuperILU : public SuperLUBase<MatrixType_, SuperILU<MatrixType_> > {
|
||||
|
||||
~SuperILU() {}
|
||||
|
||||
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
||||
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
||||
*
|
||||
* This function is particularly useful when solving for several problems having the same structure.
|
||||
*
|
||||
@ -772,7 +791,7 @@ class SuperILU : public SuperLUBase<MatrixType_, SuperILU<MatrixType_> > {
|
||||
|
||||
/** Performs a numeric decomposition of \a matrix
|
||||
*
|
||||
* The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
|
||||
* The given matrix must has the same sparsity than the matrix on which the symbolic decomposition has been performed.
|
||||
*
|
||||
* \sa analyzePattern()
|
||||
*/
|
||||
|
@ -381,7 +381,7 @@ class UmfPackLU : public SparseSolverBase<UmfPackLU<MatrixType_> > {
|
||||
factorize_impl();
|
||||
}
|
||||
|
||||
/** Performs a symbolic decomposition on the sparcity of \a matrix.
|
||||
/** Performs a symbolic decomposition on the sparsity of \a matrix.
|
||||
*
|
||||
* This function is particularly useful when solving for several problems having the same structure.
|
||||
*
|
||||
@ -425,7 +425,7 @@ class UmfPackLU : public SparseSolverBase<UmfPackLU<MatrixType_> > {
|
||||
|
||||
/** Performs a numeric decomposition of \a matrix
|
||||
*
|
||||
* The given matrix must has the same sparcity than the matrix on which the pattern anylysis has been performed.
|
||||
* The given matrix must has the same sparsity than the matrix on which the pattern anylysis has been performed.
|
||||
*
|
||||
* \sa analyzePattern(), compute()
|
||||
*/
|
||||
|
0
bench/basicbench.cxxlist
Normal file → Executable file
0
bench/basicbench.cxxlist
Normal file → Executable file
0
bench/btl/data/mk_gnuplot_script.sh
Normal file → Executable file
0
bench/btl/data/mk_gnuplot_script.sh
Normal file → Executable file
0
bench/btl/data/mk_mean_script.sh
Normal file → Executable file
0
bench/btl/data/mk_mean_script.sh
Normal file → Executable file
@ -2,14 +2,6 @@
|
||||
project(EigenBlas CXX)
|
||||
|
||||
if(EIGEN_BUILD_BLAS)
|
||||
include(CheckLanguage)
|
||||
check_language(Fortran)
|
||||
if(CMAKE_Fortran_COMPILER)
|
||||
enable_language(Fortran)
|
||||
set(EIGEN_Fortran_COMPILER_WORKS ON)
|
||||
else()
|
||||
set(EIGEN_Fortran_COMPILER_WORKS OFF)
|
||||
endif()
|
||||
|
||||
add_custom_target(blas)
|
||||
|
||||
@ -18,18 +10,12 @@ set(EigenBlas_SRCS single.cpp double.cpp complex_single.cpp complex_double.cpp
|
||||
f2c/lsame.c f2c/dspmv.c f2c/ssbmv.c f2c/chbmv.c
|
||||
f2c/sspmv.c f2c/zhbmv.c f2c/chpmv.c f2c/dsbmv.c
|
||||
f2c/zhpmv.c f2c/dtbmv.c f2c/stbmv.c f2c/ctbmv.c
|
||||
f2c/ztbmv.c
|
||||
f2c/ztbmv.c f2c/complexdots.c
|
||||
)
|
||||
|
||||
if (EIGEN_Fortran_COMPILER_WORKS)
|
||||
set(EigenBlas_SRCS ${EigenBlas_SRCS} fortran/complexdots.f)
|
||||
else()
|
||||
set(EigenBlas_SRCS ${EigenBlas_SRCS} f2c/complexdots.c)
|
||||
endif()
|
||||
|
||||
set(EIGEN_BLAS_TARGETS "")
|
||||
|
||||
add_library(eigen_blas_static ${EigenBlas_SRCS})
|
||||
add_library(eigen_blas_static STATIC ${EigenBlas_SRCS})
|
||||
list(APPEND EIGEN_BLAS_TARGETS eigen_blas_static)
|
||||
|
||||
if (EIGEN_BUILD_SHARED_LIBS)
|
||||
@ -49,8 +35,6 @@ foreach(target IN LISTS EIGEN_BLAS_TARGETS)
|
||||
ARCHIVE DESTINATION lib)
|
||||
endforeach()
|
||||
|
||||
if(EIGEN_Fortran_COMPILER_WORKS)
|
||||
|
||||
if(EIGEN_BUILD_TESTING)
|
||||
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
|
||||
add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest
|
||||
@ -60,4 +44,3 @@ if(EIGEN_BUILD_TESTING)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
13
blas/blas.h
13
blas/blas.h
@ -464,6 +464,19 @@ void BLASFUNC(zher2m)(const char *, const char *, const char *, const int *, con
|
||||
void BLASFUNC(xher2m)(const char *, const char *, const char *, const int *, const int *, const double *,
|
||||
const double *, const int *, const double *, const int *, const double *, double *, const int *);
|
||||
|
||||
void BLASFUNC(sgemmtr)(const char *, const char *, const char *, const int *, const int *, const float *, const float *,
|
||||
const int *, const float *, const int *, const float *, float *, const int *);
|
||||
void BLASFUNC(dgemmtr)(const char *, const char *, const char *, const int *, const int *, const double *,
|
||||
const double *, const int *, const double *, const int *, const double *, double *, const int *);
|
||||
void BLASFUNC(qgemmtr)(const char *, const char *, const char *, const int *, const int *, const double *,
|
||||
const double *, const int *, const double *, const int *, const double *, double *, const int *);
|
||||
void BLASFUNC(cgemmtr)(const char *, const char *, const char *, const int *, const int *, const float *, const float *,
|
||||
const int *, const float *, const int *, const float *, float *, const int *);
|
||||
void BLASFUNC(zgemmtr)(const char *, const char *, const char *, const int *, const int *, const double *,
|
||||
const double *, const int *, const double *, const int *, const double *, double *, const int *);
|
||||
void BLASFUNC(xgemmtr)(const char *, const char *, const char *, const int *, const int *, const double *,
|
||||
const double *, const int *, const double *, const int *, const double *, double *, const int *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -1,43 +0,0 @@
|
||||
COMPLEX FUNCTION CDOTC(N,CX,INCX,CY,INCY)
|
||||
INTEGER INCX,INCY,N
|
||||
COMPLEX CX(*),CY(*)
|
||||
COMPLEX RES
|
||||
EXTERNAL CDOTCW
|
||||
|
||||
CALL CDOTCW(N,CX,INCX,CY,INCY,RES)
|
||||
CDOTC = RES
|
||||
RETURN
|
||||
END
|
||||
|
||||
COMPLEX FUNCTION CDOTU(N,CX,INCX,CY,INCY)
|
||||
INTEGER INCX,INCY,N
|
||||
COMPLEX CX(*),CY(*)
|
||||
COMPLEX RES
|
||||
EXTERNAL CDOTUW
|
||||
|
||||
CALL CDOTUW(N,CX,INCX,CY,INCY,RES)
|
||||
CDOTU = RES
|
||||
RETURN
|
||||
END
|
||||
|
||||
DOUBLE COMPLEX FUNCTION ZDOTC(N,CX,INCX,CY,INCY)
|
||||
INTEGER INCX,INCY,N
|
||||
DOUBLE COMPLEX CX(*),CY(*)
|
||||
DOUBLE COMPLEX RES
|
||||
EXTERNAL ZDOTCW
|
||||
|
||||
CALL ZDOTCW(N,CX,INCX,CY,INCY,RES)
|
||||
ZDOTC = RES
|
||||
RETURN
|
||||
END
|
||||
|
||||
DOUBLE COMPLEX FUNCTION ZDOTU(N,CX,INCX,CY,INCY)
|
||||
INTEGER INCX,INCY,N
|
||||
DOUBLE COMPLEX CX(*),CY(*)
|
||||
DOUBLE COMPLEX RES
|
||||
EXTERNAL ZDOTUW
|
||||
|
||||
CALL ZDOTUW(N,CX,INCX,CY,INCY,RES)
|
||||
ZDOTU = RES
|
||||
RETURN
|
||||
END
|
@ -6,15 +6,12 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#include <iostream>
|
||||
#include "common.h"
|
||||
|
||||
EIGEN_BLAS_FUNC(gemm)
|
||||
(const char *opa, const char *opb, const int *m, const int *n, const int *k, const RealScalar *palpha,
|
||||
const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc,
|
||||
const int *ldc) {
|
||||
// std::cerr << "in gemm " << *opa << " " << *opb << " " << *m << " " << *n << " " << *k << " " << *lda << " " <<
|
||||
// *ldb << " " << *ldc << " " << *palpha << " " << *pbeta << "\n";
|
||||
using Eigen::ColMajor;
|
||||
using Eigen::DenseIndex;
|
||||
using Eigen::Dynamic;
|
||||
@ -97,11 +94,141 @@ EIGEN_BLAS_FUNC(gemm)
|
||||
func[code](*m, *n, *k, a, *lda, b, *ldb, c, 1, *ldc, alpha, blocking, 0);
|
||||
}
|
||||
|
||||
EIGEN_BLAS_FUNC(gemmtr)
|
||||
(const char *uplo, const char *opa, const char *opb, const int *n, const int *k, const RealScalar *palpha,
|
||||
const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc,
|
||||
const int *ldc) {
|
||||
using Eigen::ColMajor;
|
||||
using Eigen::DenseIndex;
|
||||
using Eigen::Dynamic;
|
||||
using Eigen::Lower;
|
||||
using Eigen::RowMajor;
|
||||
using Eigen::Upper;
|
||||
typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *,
|
||||
DenseIndex, DenseIndex, const Scalar &, Eigen::internal::level3_blocking<Scalar, Scalar> &);
|
||||
static const functype func[24] = {
|
||||
// Upper-triangular result.
|
||||
// array index: NOTR | (NOTR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, ColMajor, false, Scalar, ColMajor,
|
||||
false, ColMajor, 1, Upper>::run),
|
||||
// array index: TR | (NOTR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, false, Scalar, ColMajor,
|
||||
false, ColMajor, 1, Upper>::run),
|
||||
// array index: ADJ | (NOTR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, ColMajor,
|
||||
false, ColMajor, 1, Upper>::run),
|
||||
0,
|
||||
// array index: NOTR | (TR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, ColMajor, false, Scalar, RowMajor,
|
||||
false, ColMajor, 1, Upper>::run),
|
||||
// array index: TR | (TR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, false, Scalar, RowMajor,
|
||||
false, ColMajor, 1, Upper>::run),
|
||||
// array index: ADJ | (TR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, RowMajor,
|
||||
false, ColMajor, 1, Upper>::run),
|
||||
0,
|
||||
// array index: NOTR | (ADJ << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, ColMajor, false, Scalar, RowMajor,
|
||||
Conj, ColMajor, 1, Upper>::run),
|
||||
// array index: TR | (ADJ << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, false, Scalar, RowMajor,
|
||||
Conj, ColMajor, 1, Upper>::run),
|
||||
// array index: ADJ | (ADJ << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, RowMajor,
|
||||
Conj, ColMajor, 1, Upper>::run),
|
||||
0,
|
||||
|
||||
// Lower-triangular result.
|
||||
// array index: NOTR | (NOTR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, ColMajor, false, Scalar, ColMajor,
|
||||
false, ColMajor, 1, Lower>::run),
|
||||
// array index: TR | (NOTR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, false, Scalar, ColMajor,
|
||||
false, ColMajor, 1, Lower>::run),
|
||||
// array index: ADJ | (NOTR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, ColMajor,
|
||||
false, ColMajor, 1, Lower>::run),
|
||||
0,
|
||||
// array index: NOTR | (TR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, ColMajor, false, Scalar, RowMajor,
|
||||
false, ColMajor, 1, Lower>::run),
|
||||
// array index: TR | (TR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, false, Scalar, RowMajor,
|
||||
false, ColMajor, 1, Lower>::run),
|
||||
// array index: ADJ | (TR << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, RowMajor,
|
||||
false, ColMajor, 1, Lower>::run),
|
||||
0,
|
||||
// array index: NOTR | (ADJ << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, ColMajor, false, Scalar, RowMajor,
|
||||
Conj, ColMajor, 1, Lower>::run),
|
||||
// array index: TR | (ADJ << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, false, Scalar, RowMajor,
|
||||
Conj, ColMajor, 1, Lower>::run),
|
||||
// array index: ADJ | (ADJ << 2)
|
||||
(Eigen::internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, RowMajor,
|
||||
Conj, ColMajor, 1, Lower>::run),
|
||||
0,
|
||||
};
|
||||
|
||||
const Scalar *a = reinterpret_cast<const Scalar *>(pa);
|
||||
const Scalar *b = reinterpret_cast<const Scalar *>(pb);
|
||||
Scalar *c = reinterpret_cast<Scalar *>(pc);
|
||||
Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
|
||||
Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
|
||||
|
||||
int info = 0;
|
||||
if (UPLO(*uplo) == INVALID)
|
||||
info = 1;
|
||||
else if (OP(*opa) == INVALID)
|
||||
info = 2;
|
||||
else if (OP(*opb) == INVALID)
|
||||
info = 3;
|
||||
else if (*n < 0)
|
||||
info = 4;
|
||||
else if (*k < 0)
|
||||
info = 5;
|
||||
else if (*lda < std::max(1, (OP(*opa) == NOTR) ? *n : *k))
|
||||
info = 8;
|
||||
else if (*ldb < std::max(1, (OP(*opb) == NOTR) ? *k : *n))
|
||||
info = 10;
|
||||
else if (*ldc < std::max(1, *n))
|
||||
info = 13;
|
||||
if (info) return xerbla_(SCALAR_SUFFIX_UP "GEMMTR ", &info);
|
||||
|
||||
if (*n == 0) return;
|
||||
|
||||
const int upper = (UPLO(*uplo) == UP);
|
||||
|
||||
if (beta != Scalar(1)) {
|
||||
if (beta == Scalar(0)) {
|
||||
if (upper) {
|
||||
matrix(c, *n, *n, *ldc).triangularView<Eigen::Upper>().setZero();
|
||||
} else {
|
||||
matrix(c, *n, *n, *ldc).triangularView<Eigen::Lower>().setZero();
|
||||
}
|
||||
} else {
|
||||
if (upper) {
|
||||
matrix(c, *n, *n, *ldc).triangularView<Eigen::Upper>() *= beta;
|
||||
} else {
|
||||
matrix(c, *n, *n, *ldc).triangularView<Eigen::Lower>() *= beta;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*k == 0) return;
|
||||
|
||||
Eigen::internal::gemm_blocking_space<ColMajor, Scalar, Scalar, Dynamic, Dynamic, Dynamic> blocking(*n, *n, *k, 1,
|
||||
false);
|
||||
|
||||
int code = OP(*opa) | ((OP(*opb) << 2) + (UPLO(*uplo) * 12));
|
||||
func[code](*n, *k, a, *lda, b, *ldb, c, 1, *ldc, alpha, blocking);
|
||||
}
|
||||
|
||||
EIGEN_BLAS_FUNC(trsm)
|
||||
(const char *side, const char *uplo, const char *opa, const char *diag, const int *m, const int *n,
|
||||
const RealScalar *palpha, const RealScalar *pa, const int *lda, RealScalar *pb, const int *ldb) {
|
||||
// std::cerr << "in trsm " << *side << " " << *uplo << " " << *opa << " " << *diag << " " << *m << "," << *n << " "
|
||||
// << *palpha << " " << *lda << " " << *ldb<< "\n";
|
||||
using Eigen::ColMajor;
|
||||
using Eigen::DenseIndex;
|
||||
using Eigen::Dynamic;
|
||||
@ -240,8 +367,6 @@ EIGEN_BLAS_FUNC(trsm)
|
||||
EIGEN_BLAS_FUNC(trmm)
|
||||
(const char *side, const char *uplo, const char *opa, const char *diag, const int *m, const int *n,
|
||||
const RealScalar *palpha, const RealScalar *pa, const int *lda, RealScalar *pb, const int *ldb) {
|
||||
// std::cerr << "in trmm " << *side << " " << *uplo << " " << *opa << " " << *diag << " " << *m << " " << *n << " "
|
||||
// << *lda << " " << *ldb << " " << *palpha << "\n";
|
||||
using Eigen::ColMajor;
|
||||
using Eigen::DenseIndex;
|
||||
using Eigen::Dynamic;
|
||||
@ -381,8 +506,6 @@ EIGEN_BLAS_FUNC(trmm)
|
||||
EIGEN_BLAS_FUNC(symm)
|
||||
(const char *side, const char *uplo, const int *m, const int *n, const RealScalar *palpha, const RealScalar *pa,
|
||||
const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc) {
|
||||
// std::cerr << "in symm " << *side << " " << *uplo << " " << *m << "x" << *n << " lda:" << *lda << " ldb:" << *ldb
|
||||
// << " ldc:" << *ldc << " alpha:" << *palpha << " beta:" << *pbeta << "\n";
|
||||
const Scalar *a = reinterpret_cast<const Scalar *>(pa);
|
||||
const Scalar *b = reinterpret_cast<const Scalar *>(pb);
|
||||
Scalar *c = reinterpret_cast<Scalar *>(pc);
|
||||
@ -472,8 +595,6 @@ EIGEN_BLAS_FUNC(symm)
|
||||
EIGEN_BLAS_FUNC(syrk)
|
||||
(const char *uplo, const char *op, const int *n, const int *k, const RealScalar *palpha, const RealScalar *pa,
|
||||
const int *lda, const RealScalar *pbeta, RealScalar *pc, const int *ldc) {
|
||||
// std::cerr << "in syrk " << *uplo << " " << *op << " " << *n << " " << *k << " " << *palpha << " " << *lda << " "
|
||||
// << *pbeta << " " << *ldc << "\n";
|
||||
using Eigen::ColMajor;
|
||||
using Eigen::DenseIndex;
|
||||
using Eigen::Dynamic;
|
||||
@ -577,9 +698,6 @@ EIGEN_BLAS_FUNC(syr2k)
|
||||
Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
|
||||
Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
|
||||
|
||||
// std::cerr << "in syr2k " << *uplo << " " << *op << " " << *n << " " << *k << " " << alpha << " " << *lda << " "
|
||||
// << *ldb << " " << beta << " " << *ldc << "\n";
|
||||
|
||||
int info = 0;
|
||||
if (UPLO(*uplo) == INVALID)
|
||||
info = 1;
|
||||
@ -647,9 +765,6 @@ EIGEN_BLAS_FUNC(hemm)
|
||||
Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
|
||||
Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
|
||||
|
||||
// std::cerr << "in hemm " << *side << " " << *uplo << " " << *m << " " << *n << " " << alpha << " " << *lda << " "
|
||||
// << beta << " " << *ldc << "\n";
|
||||
|
||||
int info = 0;
|
||||
if (SIDE(*side) == INVALID)
|
||||
info = 1;
|
||||
@ -719,8 +834,6 @@ RowMajor,true,Conj, ColMajor, 1>
|
||||
EIGEN_BLAS_FUNC(herk)
|
||||
(const char *uplo, const char *op, const int *n, const int *k, const RealScalar *palpha, const RealScalar *pa,
|
||||
const int *lda, const RealScalar *pbeta, RealScalar *pc, const int *ldc) {
|
||||
// std::cerr << "in herk " << *uplo << " " << *op << " " << *n << " " << *k << " " << *palpha << " " << *lda << " "
|
||||
// << *pbeta << " " << *ldc << "\n";
|
||||
using Eigen::ColMajor;
|
||||
using Eigen::DenseIndex;
|
||||
using Eigen::Dynamic;
|
||||
@ -754,9 +867,6 @@ EIGEN_BLAS_FUNC(herk)
|
||||
RealScalar alpha = *palpha;
|
||||
RealScalar beta = *pbeta;
|
||||
|
||||
// std::cerr << "in herk " << *uplo << " " << *op << " " << *n << " " << *k << " " << alpha << " " << *lda << " " <<
|
||||
// beta << " " << *ldc << "\n";
|
||||
|
||||
int info = 0;
|
||||
if (UPLO(*uplo) == INVALID)
|
||||
info = 1;
|
||||
@ -810,9 +920,6 @@ EIGEN_BLAS_FUNC(her2k)
|
||||
Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
|
||||
RealScalar beta = *pbeta;
|
||||
|
||||
// std::cerr << "in her2k " << *uplo << " " << *op << " " << *n << " " << *k << " " << alpha << " " << *lda << " "
|
||||
// << *ldb << " " << beta << " " << *ldc << "\n";
|
||||
|
||||
int info = 0;
|
||||
if (UPLO(*uplo) == INVALID)
|
||||
info = 1;
|
||||
@ -875,4 +982,4 @@ EIGEN_BLAS_FUNC(her2k)
|
||||
}
|
||||
}
|
||||
|
||||
#endif // ISCOMPLEX
|
||||
#endif
|
||||
|
@ -1,3 +1,13 @@
|
||||
include(CheckLanguage)
|
||||
check_language(Fortran)
|
||||
if(CMAKE_Fortran_COMPILER)
|
||||
enable_language(Fortran)
|
||||
set(EIGEN_Fortran_COMPILER_WORKS ON)
|
||||
else()
|
||||
set(EIGEN_Fortran_COMPILER_WORKS OFF)
|
||||
endif()
|
||||
|
||||
if (EIGEN_Fortran_COMPILER_WORKS)
|
||||
|
||||
macro(ei_add_blas_test testname)
|
||||
|
||||
@ -38,3 +48,5 @@ ei_add_blas_test(zblat3)
|
||||
# add_custom_target(level1)
|
||||
# add_dependencies(level1 sblat1)
|
||||
|
||||
endif()
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
# Base configuration for linux cross-compilation.
|
||||
.build:linux:cross:
|
||||
needs: []
|
||||
extends: .common:linux:cross
|
||||
stage: build
|
||||
variables:
|
||||
@ -108,7 +109,7 @@ build:linux:docs:
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||
- if: $CI_PIPELINE_SOURCE == "web" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||
- if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||
- if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_NAMESPACE == "libeigen" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_PROJECT_NAMESPACE == "libeigen" && $CI_MERGE_REQUEST_LABELS =~ "/all-tests/"
|
||||
|
||||
|
||||
@ -144,61 +145,8 @@ build:linux:docs:
|
||||
-DEIGEN_CUDA_COMPUTE_ARCH=${EIGEN_CI_CUDA_COMPUTE_ARCH}
|
||||
-DEIGEN_TEST_CUDA_CLANG=${EIGEN_CI_TEST_CUDA_CLANG}
|
||||
tags:
|
||||
- eigen-runner
|
||||
- linux
|
||||
# Requires intel runner for cuda docker image support.
|
||||
- x86-64
|
||||
|
||||
# NVidia no longer provides docker images < CUDA 11.0.3.
|
||||
# # GCC-7, CUDA-9.2
|
||||
# build:linux:cuda-9.2:gcc-7:
|
||||
# extends: .build:linux:cuda
|
||||
# image: nvidia/cuda:9.2-devel-ubuntu18.04
|
||||
# variables:
|
||||
# # cuda 9.2 doesn't support sm_75, so lower to 70.
|
||||
# EIGEN_CI_CUDA_COMPUTE_ARCH: "50;70"
|
||||
# EIGEN_CI_C_COMPILER: gcc-7
|
||||
# EIGEN_CI_CXX_COMPILER: g++-7
|
||||
|
||||
# # Clang-10, CUDA-9.2
|
||||
# build:linux:cuda-9.2:clang-10:
|
||||
# extends: build:linux:cuda-9.2:gcc-7
|
||||
# variables:
|
||||
# EIGEN_CI_C_COMPILER: clang-10
|
||||
# EIGEN_CI_CXX_COMPILER: clang++-10
|
||||
# EIGEN_CI_TEST_CUDA_CLANG: "on"
|
||||
|
||||
# # GCC-8, CUDA-10.2
|
||||
# build:linux:cuda-10.2:gcc-8:
|
||||
# extends: .build:linux:cuda
|
||||
# image: nvidia/cuda:10.2-devel-ubuntu18.04
|
||||
# variables:
|
||||
# EIGEN_CI_C_COMPILER: gcc-8
|
||||
# EIGEN_CI_CXX_COMPILER: g++-8
|
||||
|
||||
# # Clang-10, CUDA-10.2
|
||||
# build:linux:cuda-10.2:clang-10:
|
||||
# extends: build:linux:cuda-10.2:gcc-8
|
||||
# variables:
|
||||
# EIGEN_CI_C_COMPILER: clang-10
|
||||
# EIGEN_CI_CXX_COMPILER: clang++-10
|
||||
# EIGEN_CI_TEST_CUDA_CLANG: "on"
|
||||
|
||||
# GCC-10, CUDA-11.4
|
||||
build:linux:cuda-11.4:gcc-10:
|
||||
extends: .build:linux:cuda
|
||||
image: nvidia/cuda:11.4.3-devel-ubuntu20.04
|
||||
variables:
|
||||
EIGEN_CI_C_COMPILER: gcc-10
|
||||
EIGEN_CI_CXX_COMPILER: g++-10
|
||||
|
||||
# Clang-12, CUDA-11.4
|
||||
build:linux:cuda-11.4:clang-12:
|
||||
extends: build:linux:cuda-11.4:gcc-10
|
||||
variables:
|
||||
EIGEN_CI_C_COMPILER: clang-12
|
||||
EIGEN_CI_CXX_COMPILER: clang++-12
|
||||
EIGEN_CI_TEST_CUDA_CLANG: "on"
|
||||
# Build on regular linux to limit GPU cost.
|
||||
- saas-linux-2xlarge-amd64
|
||||
|
||||
# GCC-10, CUDA-12.2
|
||||
build:linux:cuda-12.2:gcc-10:
|
||||
@ -228,10 +176,6 @@ build:linux:rocm-latest:gcc-10:
|
||||
EIGEN_CI_CXX_COMPILER: g++-10
|
||||
EIGEN_CI_BUILD_TARGET: buildtests_gpu
|
||||
EIGEN_CI_ADDITIONAL_ARGS: -DEIGEN_TEST_HIP=on
|
||||
tags:
|
||||
- eigen-runner
|
||||
- linux
|
||||
- x86-64
|
||||
|
||||
######## Arm ###################################################################
|
||||
|
||||
@ -343,6 +287,8 @@ build:linux:cross:x86-64:gcc-10:default:smoketest:
|
||||
EIGEN_CI_BUILD_TARGET: buildsmoketests
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
tags:
|
||||
- saas-linux-small-amd64
|
||||
|
||||
build:linux:cross:x86-64:clang-12:default:smoketest:
|
||||
extends: build:linux:cross:x86-64:clang-12:default
|
||||
@ -350,3 +296,5 @@ build:linux:cross:x86-64:clang-12:default:smoketest:
|
||||
EIGEN_CI_BUILD_TARGET: buildsmoketests
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
tags:
|
||||
- saas-linux-small-amd64
|
||||
|
@ -1,5 +1,6 @@
|
||||
# Base configuration for windows builds.
|
||||
.build:windows:
|
||||
needs: []
|
||||
extends: .common:windows
|
||||
stage: build
|
||||
variables:
|
||||
@ -25,15 +26,16 @@
|
||||
|
||||
######### MSVC #################################################################
|
||||
|
||||
# MSVC 14.16 (VS 2017)
|
||||
build:windows:x86-64:msvc-14.16:default:
|
||||
# MSVC 14.29 (VS 2019) 32 bit
|
||||
|
||||
build:windows:x86:msvc-14.29:default:
|
||||
extends: .build:windows
|
||||
variables:
|
||||
EIGEN_CI_MSVC_VER: "14.16"
|
||||
# Override to remove unsupported /d2ReducedOptimizeHugeFunctions.
|
||||
EIGEN_CI_TEST_CUSTOM_CXX_FLAGS: "/DEIGEN_STRONG_INLINE=inline;/Os"
|
||||
EIGEN_CI_MSVC_VER: "14.29"
|
||||
EIGEN_CI_MSVC_ARCH: "x86"
|
||||
|
||||
# MSVC 14.29 (VS 2019) 64 bit
|
||||
|
||||
# MSVC 14.29 (VS 2019)
|
||||
build:windows:x86-64:msvc-14.29:default:
|
||||
extends: .build:windows
|
||||
variables:
|
||||
@ -49,7 +51,9 @@ build:windows:x86-64:msvc-14.29:avx512dq:
|
||||
variables:
|
||||
EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX512DQ=on"
|
||||
|
||||
######### MSVC + CUDA ##########################################################
|
||||
|
||||
# MSVC 14.29 (VS 2019) + CUDA
|
||||
|
||||
.build:windows:cuda:
|
||||
extends: .build:windows
|
||||
variables:
|
||||
@ -65,46 +69,9 @@ build:windows:x86-64:msvc-14.29:avx512dq:
|
||||
- x86-64
|
||||
- cuda
|
||||
|
||||
# The CUDA 9.2 compiler crashes with an internal error.
|
||||
# # MSVC 14.16 + CUDA 9.2
|
||||
# build:windows:x86-64:cuda-9.2:msvc-14.16:
|
||||
# extends: .build:windows:cuda
|
||||
# variables:
|
||||
# # CUDA 9.2 doesn't support sm_75.
|
||||
# EIGEN_CI_CUDA_COMPUTE_ARCH: "50;70"
|
||||
# # CUDA 9.2 only supports up to VS 2017.
|
||||
# EIGEN_CI_MSVC_VER: "14.16"
|
||||
# EIGEN_CI_TEST_CUSTOM_CXX_FLAGS: "/DEIGEN_STRONG_INLINE=inline;/Os"
|
||||
# EIGEN_CI_BEFORE_SCRIPT: $$env:CUDA_PATH=$$env:CUDA_PATH_V9_2
|
||||
|
||||
# MSVC 14.29 + CUDA 10.2
|
||||
build:windows:x86-64:cuda-10.2:msvc-14.29:
|
||||
extends: .build:windows:cuda
|
||||
variables:
|
||||
EIGEN_CI_MSVC_VER: "14.29"
|
||||
EIGEN_CI_BEFORE_SCRIPT: $$env:CUDA_PATH=$$env:CUDA_PATH_V10_2
|
||||
|
||||
# MSVC 14.29 + CUDA 11.4
|
||||
build:windows:x86-64:cuda-11.4:msvc-14.29:
|
||||
extends: .build:windows:cuda
|
||||
variables:
|
||||
EIGEN_CI_MSVC_VER: "14.29"
|
||||
EIGEN_CI_BEFORE_SCRIPT: $$env:CUDA_PATH=$$env:CUDA_PATH_V11_4
|
||||
|
||||
######## MR Smoke Tests ########################################################
|
||||
|
||||
# MSVC 14.29 64-bit (VS 2019)
|
||||
build:windows:x86-64:msvc-14.29:avx512dq:smoketest:
|
||||
extends: build:windows:x86-64:msvc-14.29:avx512dq
|
||||
variables:
|
||||
EIGEN_CI_BUILD_TARGET: buildsmoketests
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
|
||||
# MSVC 14.29 32-bit (VS 2019)
|
||||
build:windows:x86:msvc-14.29:avx512dq:smoketest:
|
||||
extends: build:windows:x86-64:msvc-14.29:avx512dq:smoketest
|
||||
variables:
|
||||
EIGEN_CI_MSVC_ARCH: "x86"
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
EIGEN_CI_BEFORE_SCRIPT: $$env:CUDA_PATH=$$env:CUDA_PATH_V11_4
|
@ -9,8 +9,7 @@ deploy:tag:nightly:
|
||||
- git tag -f nightly $CI_COMMIT_SHORT_SHA
|
||||
- git push -f $EIGEN_CI_GIT_PUSH_URL tag nightly
|
||||
tags:
|
||||
- linux
|
||||
- eigen-runner
|
||||
- saas-linux-small-amd64
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_NAMESPACE == "libeigen" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
- if: $CI_PIPELINE_SOURCE == "web" && $CI_PROJECT_NAMESPACE == "libeigen" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
@ -33,11 +32,10 @@ deploy:docs:
|
||||
paths:
|
||||
- public
|
||||
tags:
|
||||
- eigen-runner
|
||||
- linux
|
||||
- saas-linux-small-amd64
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||
- if: $CI_PIPELINE_SOURCE == "web" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||
- if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_NAMESPACE == "libeigen"
|
||||
- if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_NAMESPACE == "libeigen" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
variables:
|
||||
PAGES_PREFIX: docs-$CI_COMMIT_REF_NAME
|
||||
|
0
ci/scripts/build.linux.script.sh
Normal file → Executable file
0
ci/scripts/build.linux.script.sh
Normal file → Executable file
0
ci/scripts/common.linux.before_script.sh
Normal file → Executable file
0
ci/scripts/common.linux.before_script.sh
Normal file → Executable file
0
ci/scripts/test.linux.after_script.sh
Normal file → Executable file
0
ci/scripts/test.linux.after_script.sh
Normal file → Executable file
0
ci/scripts/test.linux.script.sh
Normal file → Executable file
0
ci/scripts/test.linux.script.sh
Normal file → Executable file
0
ci/scripts/vars.linux.sh
Normal file → Executable file
0
ci/scripts/vars.linux.sh
Normal file → Executable file
@ -202,65 +202,7 @@ test:linux:x86-64:clang-12:avx512dq:unsupported:
|
||||
variables:
|
||||
EIGEN_CI_CTEST_LABEL: gpu
|
||||
tags:
|
||||
- eigen-runner
|
||||
- linux
|
||||
- x86-64
|
||||
- cuda
|
||||
|
||||
# NVidia no longer provides docker images < CUDA 11.0.3.
|
||||
# # GCC-7, CUDA-9.2
|
||||
# test:linux:cuda-9.2:gcc-7:
|
||||
# extends: .test:linux:cuda
|
||||
# image: nvidia/cuda:9.2-devel-ubuntu18.04
|
||||
# needs: [ build:linux:cuda-9.2:gcc-7 ]
|
||||
# variables:
|
||||
# EIGEN_CI_CXX_COMPILER: g++-7
|
||||
# EIGEN_CI_CC_COMPILER: gcc-7
|
||||
|
||||
# # Clang-10, CUDA-9.2
|
||||
# test:linux:cuda-9.2:clang-10:
|
||||
# extends: .test:linux:cuda
|
||||
# image: nvidia/cuda:9.2-devel-ubuntu18.04
|
||||
# needs: [ build:linux:cuda-9.2:clang-10 ]
|
||||
# variables:
|
||||
# EIGEN_CI_CXX_COMPILER: clang++-10
|
||||
# EIGEN_CI_CC_COMPILER: clang-10
|
||||
|
||||
# # GCC-8, CUDA-10.2
|
||||
# test:linux:cuda-10.2:gcc-8:
|
||||
# extends: .test:linux:cuda
|
||||
# image: nvidia/cuda:10.2-devel-ubuntu18.04
|
||||
# needs: [ build:linux:cuda-10.2:gcc-8 ]
|
||||
# variables:
|
||||
# EIGEN_CI_CXX_COMPILER: g++-8
|
||||
# EIGEN_CI_CC_COMPILER: gcc-8
|
||||
|
||||
# # Clang-10, CUDA-10.2
|
||||
# test:linux:cuda-10.2:clang-10:
|
||||
# extends: .test:linux:cuda
|
||||
# image: nvidia/cuda:10.2-devel-ubuntu18.04
|
||||
# needs: [ build:linux:cuda-10.2:clang-10 ]
|
||||
# variables:
|
||||
# EIGEN_CI_CXX_COMPILER: clang++-10
|
||||
# EIGEN_CI_CC_COMPILER: clang-10
|
||||
|
||||
# GCC-10, CUDA-11.4
|
||||
test:linux:cuda-11.4:gcc-10:
|
||||
extends: .test:linux:cuda
|
||||
image: nvidia/cuda:11.4.3-devel-ubuntu20.04
|
||||
needs: [ build:linux:cuda-11.4:gcc-10 ]
|
||||
variables:
|
||||
EIGEN_CI_CXX_COMPILER: g++-10
|
||||
EIGEN_CI_CC_COMPILER: gcc-10
|
||||
|
||||
# Clang-12, CUDA-11.4
|
||||
test:linux:cuda-11.4:clang-12:
|
||||
extends: .test:linux:cuda
|
||||
image: nvidia/cuda:11.4.3-devel-ubuntu20.04
|
||||
needs: [ build:linux:cuda-11.4:clang-12 ]
|
||||
variables:
|
||||
EIGEN_CI_CXX_COMPILER: clang++-12
|
||||
EIGEN_CI_CC_COMPILER: clang-12
|
||||
- saas-linux-medium-amd64-gpu-standard
|
||||
|
||||
# GCC-10, CUDA-12.2
|
||||
test:linux:cuda-12.2:gcc-10:
|
||||
@ -441,6 +383,8 @@ test:linux:x86-64:gcc-10:default:smoketest:
|
||||
EIGEN_CI_CTEST_LABEL: smoketest
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
tags:
|
||||
- saas-linux-small-amd64
|
||||
|
||||
test:linux:x86-64:clang-12:default:smoketest:
|
||||
extends: .test:linux:x86-64:clang-12:default
|
||||
@ -449,3 +393,5 @@ test:linux:x86-64:clang-12:default:smoketest:
|
||||
EIGEN_CI_CTEST_LABEL: smoketest
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
tags:
|
||||
- saas-linux-small-amd64
|
||||
|
@ -17,22 +17,8 @@
|
||||
|
||||
##### MSVC #####################################################################
|
||||
|
||||
# MSVC 14.16 (VS 2017)
|
||||
.test:windows:x86-64:msvc-14.16:default:
|
||||
extends: .test:windows
|
||||
needs: [ build:windows:x86-64:msvc-14.16:default ]
|
||||
# MSVC 14.29 (VS 2019) 64 bit
|
||||
|
||||
test:windows:x86-64:msvc-14.16:default:official:
|
||||
extends: .test:windows:x86-64:msvc-14.16:default
|
||||
variables:
|
||||
EIGEN_CI_CTEST_LABEL: Official
|
||||
|
||||
test:windows:x86-64:msvc-14.16:default:unsupported:
|
||||
extends: .test:windows:x86-64:msvc-14.16:default
|
||||
variables:
|
||||
EIGEN_CI_CTEST_LABEL: Unsupported
|
||||
|
||||
# MSVC 14.29 (VS 2019)
|
||||
.test:windows:x86-64:msvc-14.29:default:
|
||||
extends: .test:windows
|
||||
needs: [ build:windows:x86-64:msvc-14.29:default ]
|
||||
@ -80,7 +66,8 @@ test:windows:x86-64:msvc-14.29:avx512dq:unsupported:
|
||||
variables:
|
||||
EIGEN_CI_CTEST_LABEL: Unsupported
|
||||
|
||||
##### MSVC + CUDA ##############################################################
|
||||
# MSVC 14.29 (VS 2019) + CUDA
|
||||
|
||||
.test:windows:cuda:
|
||||
extends: .test:windows
|
||||
allow_failure: true
|
||||
@ -92,18 +79,7 @@ test:windows:x86-64:msvc-14.29:avx512dq:unsupported:
|
||||
- x86-64
|
||||
- cuda
|
||||
|
||||
# The CUDA 9.2 compiler crashes with an internal error.
|
||||
# # MSVC 14.16 + CUDA 9.2
|
||||
# test:windows:x86-64:cuda-9.2:msvc-14.16:
|
||||
# extends: .test:windows:cuda
|
||||
# needs: [ build:windows:x86-64:cuda-9.2:msvc-14.16 ]
|
||||
|
||||
# MSVC 14.29 + CUDA 10.2
|
||||
test:windows:x86-64:cuda-10.2:msvc-14.29:
|
||||
extends: .test:windows:cuda
|
||||
needs: [ build:windows:x86-64:cuda-10.2:msvc-14.29 ]
|
||||
|
||||
# MSVC 14.29 + CUDA 11.4
|
||||
test:windows:x86-64:cuda-11.4:msvc-14.29:
|
||||
extends: .test:windows:cuda
|
||||
needs: [ build:windows:x86-64:cuda-11.4:msvc-14.29 ]
|
||||
needs: [ build:windows:x86-64:cuda-11.4:msvc-14.29 ]
|
91
cmake/Eigen3ConfigVersion.cmake.in
Normal file
91
cmake/Eigen3ConfigVersion.cmake.in
Normal file
@ -0,0 +1,91 @@
|
||||
# This is a CMake version file for the Config-mode of find_package().
|
||||
#
|
||||
# The version constraint is compatible with the current package under the
|
||||
# following conditions:
|
||||
# - If a version range is specified, the package version falls within the
|
||||
# range up to the supplied version components.
|
||||
# - If a single version is specified, the current package version matches
|
||||
# only the requested version components.
|
||||
#
|
||||
# Examples:
|
||||
# - 3...5 matches 3.0.0.0 to <6.0.0.0
|
||||
# - 3...<5 matches 3.0.0.0 to <5.0.0.0
|
||||
# - 3...<5.1 matches 3.0.0.0 to <5.1.0.0
|
||||
# - 3 matches 3.0.0.0 to <4.0.0.0
|
||||
# - 3.4 matches 3.4.0.0 to <3.5.0.0
|
||||
|
||||
set(PACKAGE_VERSION "@CVF_VERSION@")
|
||||
|
||||
# Extract version components.
|
||||
if ("${PACKAGE_VERSION}" MATCHES "^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$")
|
||||
set(_PACKAGE_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
if (DEFINED CMAKE_MATCH_3)
|
||||
set(_PACKAGE_VERSION_MINOR "${CMAKE_MATCH_3}")
|
||||
else()
|
||||
set(_PACKAGE_VERSION_MINOR "0")
|
||||
endif()
|
||||
if (DEFINED CMAKE_MATCH_5)
|
||||
set(_PACKAGE_VERSION_PATCH "${CMAKE_MATCH_5}")
|
||||
else()
|
||||
set(_PACKAGE_VERSION_PATCH "0")
|
||||
endif()
|
||||
if (DEFINED CMAKE_MATCH_7)
|
||||
set(_PACKAGE_VERSION_TWEAK "${CMAKE_MATCH_7}")
|
||||
else()
|
||||
set(_PACKAGE_VERSION_TWEAK "0")
|
||||
endif()
|
||||
set(_PACKAGE_VERSION_FULL "${_PACKAGE_VERSION_MAJOR}.${_PACKAGE_VERSION_MINOR}.${_PACKAGE_VERSION_PATCH}.${_PACKAGE_VERSION_TWEAK}")
|
||||
endif()
|
||||
|
||||
if (PACKAGE_FIND_VERSION_RANGE)
|
||||
# Create exclusive bound for the range maximum.
|
||||
if (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE")
|
||||
set(_PACKAGE_FIND_VERSION_UPPER "${PACKAGE_FIND_VERSION_MAX_MAJOR}.${PACKAGE_FIND_VERSION_MAX_MINOR}.${PACKAGE_FIND_VERSION_MAX_PATCH}.${PACKAGE_FIND_VERSION_MAX_TWEAK}")
|
||||
else()
|
||||
# Increment the last supplied version number.
|
||||
if (PACKAGE_FIND_VERSION_MAX_COUNT EQUAL 1)
|
||||
math(EXPR _PACKAGE_FIND_VERSION_MAX_MAJOR "${PACKAGE_FIND_VERSION_MAX_MAJOR}+1")
|
||||
set(_PACKAGE_FIND_VERSION_UPPER "${_PACKAGE_FIND_VERSION_MAX_MAJOR}.0.0.0")
|
||||
elseif (PACKAGE_FIND_VERSION_MAX_COUNT EQUAL 2)
|
||||
math(EXPR _PACKAGE_FIND_VERSION_MAX_MINOR "${PACKAGE_FIND_VERSION_MAX_MINOR}+1")
|
||||
set(_PACKAGE_FIND_VERSION_UPPER "${PACKAGE_FIND_VERSION_MAX_MAJOR}.${_PACKAGE_FIND_VERSION_MAX_MINOR}.0.0")
|
||||
elseif (PACKAGE_FIND_VERSION_MAX_COUNT EQUAL 3)
|
||||
math(EXPR _PACKAGE_FIND_VERSION_MAX_PATCH "${PACKAGE_FIND_VERSION_MAX_PATCH}+1")
|
||||
set(_PACKAGE_FIND_VERSION_UPPER "${PACKAGE_FIND_VERSION_MAX_MAJOR}.${PACKAGE_FIND_VERSION_MAX_MINOR}.${_PACKAGE_FIND_VERSION_MAX_PATCH}.0")
|
||||
elseif (PACKAGE_FIND_VERSION_MAX_COUNT EQUAL 4)
|
||||
math(EXPR _PACKAGE_FIND_VERSION_MAX_TWEAK "${PACKAGE_FIND_VERSION_MAX_TWEAK}+1")
|
||||
set(_PACKAGE_FIND_VERSION_UPPER "${PACKAGE_FIND_VERSION_MAX_MAJOR}.${PACKAGE_FIND_VERSION_MAX_MINOR}.${PACKAGE_FIND_VERSION_MAX_PATCH}.${_PACKAGE_FIND_VERSION_MAX_TWEAK}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ((_PACKAGE_VERSION_FULL VERSION_LESS PACKAGE_FIND_VERSION_MIN)
|
||||
OR (_PACKAGE_VERSION_FULL VERSION_GREATER_EQUAL _PACKAGE_FIND_VERSION_UPPER))
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
endif()
|
||||
else()
|
||||
# Create exclusive upper bound.
|
||||
if (PACKAGE_FIND_VERSION_COUNT EQUAL 1)
|
||||
math(EXPR _PACKAGE_FIND_VERSION_MAJOR "${PACKAGE_FIND_VERSION_MAJOR}+1")
|
||||
set(_PACKAGE_FIND_VERSION_UPPER "${_PACKAGE_FIND_VERSION_MAJOR}.0.0.0")
|
||||
elseif (PACKAGE_FIND_VERSION_COUNT EQUAL 2)
|
||||
math(EXPR _PACKAGE_FIND_VERSION_MINOR "${PACKAGE_FIND_VERSION_MINOR}+1")
|
||||
set(_PACKAGE_FIND_VERSION_UPPER "${PACKAGE_FIND_VERSION_MAJOR}.${_PACKAGE_FIND_VERSION_MINOR}.0.0")
|
||||
elseif (PACKAGE_FIND_VERSION_COUNT EQUAL 3)
|
||||
math(EXPR _PACKAGE_FIND_VERSION_PATCH "${PACKAGE_FIND_VERSION_PATCH}+1")
|
||||
set(_PACKAGE_FIND_VERSION_UPPER "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${_PACKAGE_FIND_VERSION_PATCH}.0")
|
||||
elseif (PACKAGE_FIND_VERSION_COUNT EQUAL 4)
|
||||
math(EXPR _PACKAGE_FIND_VERSION_TWEAK "${PACKAGE_FIND_VERSION_TWEAK}+1")
|
||||
set(_PACKAGE_FIND_VERSION_UPPER "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH}.${_PACKAGE_FIND_VERSION_TWEAK}")
|
||||
endif()
|
||||
|
||||
if((_PACKAGE_VERSION_FULL VERSION_LESS PACKAGE_FIND_VERSION) OR (_PACKAGE_VERSION_FULL VERSION_GREATER_EQUAL _PACKAGE_FIND_VERSION_UPPER))
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
@ -453,6 +453,9 @@ macro(ei_set_sitename)
|
||||
endmacro()
|
||||
|
||||
macro(ei_get_compilerver VAR)
|
||||
if (NOT CMAKE_CXX_COMPILER_ID)
|
||||
set(CMAKE_CXX_COMPILER_ID "<unknown>")
|
||||
endif()
|
||||
if(MSVC)
|
||||
set(${VAR} "${CMAKE_CXX_COMPILER_VERSION}")
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "PGI")
|
||||
|
14
cmake/Version.in
Normal file
14
cmake/Version.in
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef EIGEN_VERSION_H
|
||||
#define EIGEN_VERSION_H
|
||||
|
||||
// The "WORLD" version will forever remain "3" for the "Eigen3" library.
|
||||
#define EIGEN_WORLD_VERSION 3
|
||||
// As of Eigen3 5.0.0, we have moved to Semantic Versioning (semver.org).
|
||||
#define EIGEN_MAJOR_VERSION ${EIGEN_MAJOR_VERSION}
|
||||
#define EIGEN_MINOR_VERSION ${EIGEN_MINOR_VERSION}
|
||||
#define EIGEN_PATCH_VERSION ${EIGEN_PATCH_VERSION}
|
||||
#define EIGEN_PRERELEASE_VERSION "${EIGEN_PRERELEASE_VERSION}"
|
||||
#define EIGEN_BUILD_VERSION "${EIGEN_BUILD_VERSION}"
|
||||
#define EIGEN_VERSION_STRING "${EIGEN_VERSION_STRING}"
|
||||
|
||||
#endif // EIGEN_VERSION_H
|
@ -1,235 +1,235 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||
|
||||
<!-- Fixed x Fixed Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,*,*,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,-1,-1,*,*,*>"/>
|
||||
<DisplayString>[{$T2}, {$T3}] (fixed matrix)</DisplayString>
|
||||
<Expand>
|
||||
<ArrayItems Condition="Flags%2"> <!-- row major layout -->
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? $T2 : $T3</Size>
|
||||
<ValuePointer>m_storage.m_data.array</ValuePointer>
|
||||
</ArrayItems>
|
||||
<ArrayItems Condition="!(Flags%2)"> <!-- column major layout -->
|
||||
<Direction>Backward</Direction>
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? $T2 : $T3</Size>
|
||||
<ValuePointer>m_storage.m_data.array</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- 2 x 2 Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,2,2,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,2,2,*,*,*>"/>
|
||||
<DisplayString>[2, 2] (fixed matrix)</DisplayString>
|
||||
<Expand>
|
||||
<Synthetic Name="[row 0]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 0]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[2]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[2]}, {m_storage.m_data.array[3]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[1]}, {m_storage.m_data.array[3]})</DisplayString>
|
||||
</Synthetic>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- 3 x 3 Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,3,3,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,3,3,*,*,*>"/>
|
||||
<DisplayString>[3, 3] (fixed matrix)</DisplayString>
|
||||
<Expand>
|
||||
<Synthetic Name="[row 0]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 0]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[3]}, {m_storage.m_data.array[6]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[3]}, {m_storage.m_data.array[4]}, {m_storage.m_data.array[5]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[1]}, {m_storage.m_data.array[4]}, {m_storage.m_data.array[7]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 2]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[6]}, {m_storage.m_data.array[7]}, {m_storage.m_data.array[8]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 2]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[2]}, {m_storage.m_data.array[5]}, {m_storage.m_data.array[8]})</DisplayString>
|
||||
</Synthetic>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- 4 x 4 Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,4,4,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,4,4,*,*,*>"/>
|
||||
<DisplayString>[4, 4] (fixed matrix)</DisplayString>
|
||||
<Expand>
|
||||
<Synthetic Name="[row 0]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]}, {m_storage.m_data.array[3]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 0]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[4]}, {m_storage.m_data.array[8]}, {m_storage.m_data.array[12]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[4]}, {m_storage.m_data.array[5]}, {m_storage.m_data.array[6]}, {m_storage.m_data.array[7]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[1]}, {m_storage.m_data.array[5]}, {m_storage.m_data.array[9]}, {m_storage.m_data.array[13]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 2]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[8]}, {m_storage.m_data.array[9]}, {m_storage.m_data.array[10]}, {m_storage.m_data.array[11]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 2]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[2]}, {m_storage.m_data.array[6]}, {m_storage.m_data.array[10]}, {m_storage.m_data.array[14]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 3]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[12]}, {m_storage.m_data.array[13]}, {m_storage.m_data.array[14]}, {m_storage.m_data.array[15]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 3]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[3]}, {m_storage.m_data.array[7]}, {m_storage.m_data.array[11]}, {m_storage.m_data.array[15]})</DisplayString>
|
||||
</Synthetic>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Dynamic x Dynamic Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,-1,-1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,-1,-1,*,*,*>"/>
|
||||
<DisplayString Condition="m_storage.m_data == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_rows}, {m_storage.m_cols}] (dynamic matrix)</DisplayString>
|
||||
<Expand>
|
||||
<ArrayItems Condition="Flags%2"> <!-- row major layout -->
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? m_storage.m_rows : m_storage.m_cols</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
<ArrayItems Condition="!(Flags%2)"> <!-- column major layout -->
|
||||
<Direction>Backward</Direction>
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? m_storage.m_rows : m_storage.m_cols</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Fixed x Dynamic Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,*,-1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,*,-1,*,*,*>"/>
|
||||
<DisplayString Condition="m_storage.m_data == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_storage.m_data != 0">[{$T2}, {m_storage.m_cols}] (dynamic column matrix)</DisplayString>
|
||||
<Expand>
|
||||
<ArrayItems Condition="Flags%2"> <!-- row major layout -->
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? $T2 : m_storage.m_cols</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
<ArrayItems Condition="!(Flags%2)"> <!-- column major layout -->
|
||||
<Direction>Backward</Direction>
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? $T2 : m_storage.m_cols</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Dynamic x Fixed Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,-1,*,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,-1,*,*,*,*>"/>
|
||||
<DisplayString Condition="m_storage.m_data == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_rows}, {$T2}] (dynamic row matrix)</DisplayString>
|
||||
<Expand>
|
||||
<ArrayItems Condition="Flags%2"> <!-- row major layout -->
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? m_storage.m_rows : $T2</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
<ArrayItems Condition="!(Flags%2)"> <!-- column major layout -->
|
||||
<Direction>Backward</Direction>
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? m_storage.m_rows : $T2</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Dynamic Column Vector -->
|
||||
<Type Name="Eigen::Matrix<*,1,-1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,1,-1,*,*,*>"/>
|
||||
<DisplayString Condition="m_storage.m_data == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_cols}] (dynamic column vector)</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[size]">m_storage.m_cols</Item>
|
||||
<ArrayItems>
|
||||
<Size>m_storage.m_cols</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Dynamic Row Vector -->
|
||||
<Type Name="Eigen::Matrix<*,-1,1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,-1,1,*,*,*>"/>
|
||||
<DisplayString Condition="m_storage.m_data == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_rows}] (dynamic row vector)</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[size]">m_storage.m_rows</Item>
|
||||
<ArrayItems>
|
||||
<Size>m_storage.m_rows</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Fixed Vector -->
|
||||
<Type Name="Eigen::Matrix<*,1,1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,1,1,*,*,*>"/>
|
||||
<DisplayString>[1] ({m_storage.m_data.array[0]})</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[x]">m_storage.m_data.array[0]</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="Eigen::Matrix<*,2,1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Matrix<*,1,2,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,2,1,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,1,2,*,*,*>"/>
|
||||
<DisplayString>[2] ({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]})</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[x]">m_storage.m_data.array[0]</Item>
|
||||
<Item Name="[y]">m_storage.m_data.array[1]</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="Eigen::Matrix<*,3,1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Matrix<*,1,3,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,3,1,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,1,3,*,*,*>"/>
|
||||
<DisplayString>[3] ({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]})</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[x]">m_storage.m_data.array[0]</Item>
|
||||
<Item Name="[y]">m_storage.m_data.array[1]</Item>
|
||||
<Item Name="[z]">m_storage.m_data.array[2]</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="Eigen::Matrix<*,4,1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Matrix<*,1,4,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,4,1,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,1,4,*,*,*>"/>
|
||||
<DisplayString>[4] ({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]}, {m_storage.m_data.array[3]})</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[x]">m_storage.m_data.array[0]</Item>
|
||||
<Item Name="[y]">m_storage.m_data.array[1]</Item>
|
||||
<Item Name="[z]">m_storage.m_data.array[2]</Item>
|
||||
<Item Name="[w]">m_storage.m_data.array[3]</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
</AutoVisualizer>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||
|
||||
<!-- Fixed x Fixed Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,*,*,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,-1,-1,*,*,*>"/>
|
||||
<DisplayString>[{$T2}, {$T3}] (fixed matrix)</DisplayString>
|
||||
<Expand>
|
||||
<ArrayItems Condition="Flags%2"> <!-- row major layout -->
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? $T2 : $T3</Size>
|
||||
<ValuePointer>m_storage.m_data.array</ValuePointer>
|
||||
</ArrayItems>
|
||||
<ArrayItems Condition="!(Flags%2)"> <!-- column major layout -->
|
||||
<Direction>Backward</Direction>
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? $T2 : $T3</Size>
|
||||
<ValuePointer>m_storage.m_data.array</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- 2 x 2 Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,2,2,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,2,2,*,*,*>"/>
|
||||
<DisplayString>[2, 2] (fixed matrix)</DisplayString>
|
||||
<Expand>
|
||||
<Synthetic Name="[row 0]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 0]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[2]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[2]}, {m_storage.m_data.array[3]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[1]}, {m_storage.m_data.array[3]})</DisplayString>
|
||||
</Synthetic>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- 3 x 3 Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,3,3,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,3,3,*,*,*>"/>
|
||||
<DisplayString>[3, 3] (fixed matrix)</DisplayString>
|
||||
<Expand>
|
||||
<Synthetic Name="[row 0]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 0]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[3]}, {m_storage.m_data.array[6]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[3]}, {m_storage.m_data.array[4]}, {m_storage.m_data.array[5]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[1]}, {m_storage.m_data.array[4]}, {m_storage.m_data.array[7]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 2]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[6]}, {m_storage.m_data.array[7]}, {m_storage.m_data.array[8]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 2]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[2]}, {m_storage.m_data.array[5]}, {m_storage.m_data.array[8]})</DisplayString>
|
||||
</Synthetic>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- 4 x 4 Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,4,4,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,4,4,*,*,*>"/>
|
||||
<DisplayString>[4, 4] (fixed matrix)</DisplayString>
|
||||
<Expand>
|
||||
<Synthetic Name="[row 0]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]}, {m_storage.m_data.array[3]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 0]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[4]}, {m_storage.m_data.array[8]}, {m_storage.m_data.array[12]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[4]}, {m_storage.m_data.array[5]}, {m_storage.m_data.array[6]}, {m_storage.m_data.array[7]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 1]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[1]}, {m_storage.m_data.array[5]}, {m_storage.m_data.array[9]}, {m_storage.m_data.array[13]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 2]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[8]}, {m_storage.m_data.array[9]}, {m_storage.m_data.array[10]}, {m_storage.m_data.array[11]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 2]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[2]}, {m_storage.m_data.array[6]}, {m_storage.m_data.array[10]}, {m_storage.m_data.array[14]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 3]" Condition="Flags%2">
|
||||
<DisplayString>({m_storage.m_data.array[12]}, {m_storage.m_data.array[13]}, {m_storage.m_data.array[14]}, {m_storage.m_data.array[15]})</DisplayString>
|
||||
</Synthetic>
|
||||
<Synthetic Name="[row 3]" Condition="!(Flags%2)">
|
||||
<DisplayString>({m_storage.m_data.array[3]}, {m_storage.m_data.array[7]}, {m_storage.m_data.array[11]}, {m_storage.m_data.array[15]})</DisplayString>
|
||||
</Synthetic>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Dynamic x Dynamic Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,-1,-1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,-1,-1,*,*,*>"/>
|
||||
<DisplayString Condition="m_storage.m_data == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_rows}, {m_storage.m_cols}] (dynamic matrix)</DisplayString>
|
||||
<Expand>
|
||||
<ArrayItems Condition="Flags%2"> <!-- row major layout -->
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? m_storage.m_rows : m_storage.m_cols</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
<ArrayItems Condition="!(Flags%2)"> <!-- column major layout -->
|
||||
<Direction>Backward</Direction>
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? m_storage.m_rows : m_storage.m_cols</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Fixed x Dynamic Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,*,-1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,*,-1,*,*,*>"/>
|
||||
<DisplayString Condition="m_storage.m_data == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_storage.m_data != 0">[{$T2}, {m_storage.m_cols}] (dynamic column matrix)</DisplayString>
|
||||
<Expand>
|
||||
<ArrayItems Condition="Flags%2"> <!-- row major layout -->
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? $T2 : m_storage.m_cols</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
<ArrayItems Condition="!(Flags%2)"> <!-- column major layout -->
|
||||
<Direction>Backward</Direction>
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? $T2 : m_storage.m_cols</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Dynamic x Fixed Matrix -->
|
||||
<Type Name="Eigen::Matrix<*,-1,*,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,-1,*,*,*,*>"/>
|
||||
<DisplayString Condition="m_storage.m_data == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_rows}, {$T2}] (dynamic row matrix)</DisplayString>
|
||||
<Expand>
|
||||
<ArrayItems Condition="Flags%2"> <!-- row major layout -->
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? m_storage.m_rows : $T2</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
<ArrayItems Condition="!(Flags%2)"> <!-- column major layout -->
|
||||
<Direction>Backward</Direction>
|
||||
<Rank>2</Rank>
|
||||
<Size>$i==0 ? m_storage.m_rows : $T2</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Dynamic Column Vector -->
|
||||
<Type Name="Eigen::Matrix<*,1,-1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,1,-1,*,*,*>"/>
|
||||
<DisplayString Condition="m_storage.m_data == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_cols}] (dynamic column vector)</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[size]">m_storage.m_cols</Item>
|
||||
<ArrayItems>
|
||||
<Size>m_storage.m_cols</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Dynamic Row Vector -->
|
||||
<Type Name="Eigen::Matrix<*,-1,1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,-1,1,*,*,*>"/>
|
||||
<DisplayString Condition="m_storage.m_data == 0">empty</DisplayString>
|
||||
<DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_rows}] (dynamic row vector)</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[size]">m_storage.m_rows</Item>
|
||||
<ArrayItems>
|
||||
<Size>m_storage.m_rows</Size>
|
||||
<ValuePointer>m_storage.m_data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- Fixed Vector -->
|
||||
<Type Name="Eigen::Matrix<*,1,1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Array<*,1,1,*,*,*>"/>
|
||||
<DisplayString>[1] ({m_storage.m_data.array[0]})</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[x]">m_storage.m_data.array[0]</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="Eigen::Matrix<*,2,1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Matrix<*,1,2,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,2,1,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,1,2,*,*,*>"/>
|
||||
<DisplayString>[2] ({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]})</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[x]">m_storage.m_data.array[0]</Item>
|
||||
<Item Name="[y]">m_storage.m_data.array[1]</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="Eigen::Matrix<*,3,1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Matrix<*,1,3,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,3,1,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,1,3,*,*,*>"/>
|
||||
<DisplayString>[3] ({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]})</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[x]">m_storage.m_data.array[0]</Item>
|
||||
<Item Name="[y]">m_storage.m_data.array[1]</Item>
|
||||
<Item Name="[z]">m_storage.m_data.array[2]</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="Eigen::Matrix<*,4,1,*,*,*>">
|
||||
<AlternativeType Name="Eigen::Matrix<*,1,4,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,4,1,*,*,*>"/>
|
||||
<AlternativeType Name="Eigen::Array<*,1,4,*,*,*>"/>
|
||||
<DisplayString>[4] ({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]}, {m_storage.m_data.array[3]})</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[x]">m_storage.m_data.array[0]</Item>
|
||||
<Item Name="[y]">m_storage.m_data.array[1]</Item>
|
||||
<Item Name="[z]">m_storage.m_data.array[2]</Item>
|
||||
<Item Name="[w]">m_storage.m_data.array[3]</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
</AutoVisualizer>
|
||||
|
@ -1,295 +1,295 @@
|
||||
; ***************************************************************
|
||||
; * Eigen Visualizer
|
||||
; *
|
||||
; * Author: Hauke Heibel <hauke.heibel@gmail.com>
|
||||
; *
|
||||
; * Support the enhanced debugging of the following Eigen
|
||||
; * types (*: any, +:fixed dimension) :
|
||||
; *
|
||||
; * - Eigen::Matrix<*,4,1,*,*,*> and Eigen::Matrix<*,1,4,*,*,*>
|
||||
; * - Eigen::Matrix<*,3,1,*,*,*> and Eigen::Matrix<*,1,3,*,*,*>
|
||||
; * - Eigen::Matrix<*,2,1,*,*,*> and Eigen::Matrix<*,1,2,*,*,*>
|
||||
; * - Eigen::Matrix<*,-1,-1,*,*,*>
|
||||
; * - Eigen::Matrix<*,+,-1,*,*,*>
|
||||
; * - Eigen::Matrix<*,-1,+,*,*,*>
|
||||
; * - Eigen::Matrix<*,+,+,*,*,*>
|
||||
; *
|
||||
; * Matrices are displayed properly independently of the memory
|
||||
; * alignment (RowMajor vs. ColMajor).
|
||||
; *
|
||||
; * This file is distributed WITHOUT ANY WARRANTY. Please ensure
|
||||
; * that your original autoexp.dat file is copied to a safe
|
||||
; * place before proceeding with its modification.
|
||||
; ***************************************************************
|
||||
|
||||
[Visualizer]
|
||||
|
||||
; Fixed size 4-vectors
|
||||
Eigen::Matrix<*,4,1,*,*,*>|Eigen::Matrix<*,1,4,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
x : ($c.m_storage.m_data.array)[0],
|
||||
y : ($c.m_storage.m_data.array)[1],
|
||||
z : ($c.m_storage.m_data.array)[2],
|
||||
w : ($c.m_storage.m_data.array)[3]
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
4,
|
||||
"](",
|
||||
#array(expr: $e.m_storage.m_data.array[$i], size: 4),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Fixed size 3-vectors
|
||||
Eigen::Matrix<*,3,1,*,*,*>|Eigen::Matrix<*,1,3,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
x : ($c.m_storage.m_data.array)[0],
|
||||
y : ($c.m_storage.m_data.array)[1],
|
||||
z : ($c.m_storage.m_data.array)[2]
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
3,
|
||||
"](",
|
||||
#array(expr: $e.m_storage.m_data.array[$i], size: 3),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Fixed size 2-vectors
|
||||
Eigen::Matrix<*,2,1,*,*,*>|Eigen::Matrix<*,1,2,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
x : ($c.m_storage.m_data.array)[0],
|
||||
y : ($c.m_storage.m_data.array)[1]
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
2,
|
||||
"](",
|
||||
#array(expr: $e.m_storage.m_data.array[$i], size: 2),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Fixed size 1-vectors
|
||||
Eigen::Matrix<*,1,1,*,*,*>|Eigen::Matrix<*,1,1,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
x : ($c.m_storage.m_data.array)[0]
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
1,
|
||||
"](",
|
||||
#array(expr: $e.m_storage.m_data.array[$i], size: 1),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Dynamic matrices (ColMajor and RowMajor support)
|
||||
Eigen::Matrix<*,-1,-1,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
rows: $c.m_storage.m_rows,
|
||||
cols: $c.m_storage.m_cols,
|
||||
; Check for RowMajorBit
|
||||
#if ($c.Flags & 0x1) (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[($i % $c.m_storage.m_rows)*$c.m_storage.m_cols + (($i- $i % $c.m_storage.m_rows)/$c.m_storage.m_rows)],
|
||||
size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.m_storage.m_cols
|
||||
)
|
||||
) #else (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[$i],
|
||||
size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.m_storage.m_cols
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
$c.m_storage.m_rows,
|
||||
",",
|
||||
$c.m_storage.m_cols,
|
||||
"](",
|
||||
#array(
|
||||
expr : [($c.m_storage.m_data)[$i],g],
|
||||
size : $c.m_storage.m_rows*$c.m_storage.m_cols
|
||||
),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Fixed rows, dynamic columns matrix (ColMajor and RowMajor support)
|
||||
Eigen::Matrix<*,*,-1,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
rows: $c.RowsAtCompileTime,
|
||||
cols: $c.m_storage.m_cols,
|
||||
; Check for RowMajorBit
|
||||
#if ($c.Flags & 0x1) (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[($i % $c.RowsAtCompileTime)*$c.m_storage.m_cols + (($i- $i % $c.RowsAtCompileTime)/$c.RowsAtCompileTime)],
|
||||
size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.m_storage.m_cols
|
||||
)
|
||||
) #else (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[$i],
|
||||
size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.m_storage.m_cols
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
$c.RowsAtCompileTime,
|
||||
",",
|
||||
$c.m_storage.m_cols,
|
||||
"](",
|
||||
#array(
|
||||
expr : [($c.m_storage.m_data)[$i],g],
|
||||
size : $c.RowsAtCompileTime*$c.m_storage.m_cols
|
||||
),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Dynamic rows, fixed columns matrix (ColMajor and RowMajor support)
|
||||
Eigen::Matrix<*,-1,*,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
rows: $c.m_storage.m_rows,
|
||||
cols: $c.ColsAtCompileTime,
|
||||
; Check for RowMajorBit
|
||||
#if ($c.Flags & 0x1) (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[($i % $c.m_storage.m_rows)*$c.ColsAtCompileTime + (($i- $i % $c.m_storage.m_rows)/$c.m_storage.m_rows)],
|
||||
size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.ColsAtCompileTime
|
||||
)
|
||||
) #else (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[$i],
|
||||
size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.ColsAtCompileTime
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
$c.m_storage.m_rows,
|
||||
",",
|
||||
$c.ColsAtCompileTime,
|
||||
"](",
|
||||
#array(
|
||||
expr : [($c.m_storage.m_data)[$i],g],
|
||||
size : $c.m_storage.m_rows*$c.ColsAtCompileTime
|
||||
),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Fixed size matrix (ColMajor and RowMajor support)
|
||||
Eigen::Matrix<*,*,*,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
rows: $c.RowsAtCompileTime,
|
||||
cols: $c.ColsAtCompileTime,
|
||||
; Check for RowMajorBit
|
||||
#if ($c.Flags & 0x1) (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data.array)[($i % $c.RowsAtCompileTime)*$c.ColsAtCompileTime + (($i- $i % $c.RowsAtCompileTime)/$c.RowsAtCompileTime)],
|
||||
size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.ColsAtCompileTime
|
||||
)
|
||||
) #else (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data.array)[$i],
|
||||
size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.ColsAtCompileTime
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
$c.RowsAtCompileTime,
|
||||
",",
|
||||
$c.ColsAtCompileTime,
|
||||
"](",
|
||||
#array(
|
||||
expr : [($c.m_storage.m_data.array)[$i],g],
|
||||
size : $c.RowsAtCompileTime*$c.ColsAtCompileTime
|
||||
),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
; ***************************************************************
|
||||
; * Eigen Visualizer
|
||||
; *
|
||||
; * Author: Hauke Heibel <hauke.heibel@gmail.com>
|
||||
; *
|
||||
; * Support the enhanced debugging of the following Eigen
|
||||
; * types (*: any, +:fixed dimension) :
|
||||
; *
|
||||
; * - Eigen::Matrix<*,4,1,*,*,*> and Eigen::Matrix<*,1,4,*,*,*>
|
||||
; * - Eigen::Matrix<*,3,1,*,*,*> and Eigen::Matrix<*,1,3,*,*,*>
|
||||
; * - Eigen::Matrix<*,2,1,*,*,*> and Eigen::Matrix<*,1,2,*,*,*>
|
||||
; * - Eigen::Matrix<*,-1,-1,*,*,*>
|
||||
; * - Eigen::Matrix<*,+,-1,*,*,*>
|
||||
; * - Eigen::Matrix<*,-1,+,*,*,*>
|
||||
; * - Eigen::Matrix<*,+,+,*,*,*>
|
||||
; *
|
||||
; * Matrices are displayed properly independently of the memory
|
||||
; * alignment (RowMajor vs. ColMajor).
|
||||
; *
|
||||
; * This file is distributed WITHOUT ANY WARRANTY. Please ensure
|
||||
; * that your original autoexp.dat file is copied to a safe
|
||||
; * place before proceeding with its modification.
|
||||
; ***************************************************************
|
||||
|
||||
[Visualizer]
|
||||
|
||||
; Fixed size 4-vectors
|
||||
Eigen::Matrix<*,4,1,*,*,*>|Eigen::Matrix<*,1,4,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
x : ($c.m_storage.m_data.array)[0],
|
||||
y : ($c.m_storage.m_data.array)[1],
|
||||
z : ($c.m_storage.m_data.array)[2],
|
||||
w : ($c.m_storage.m_data.array)[3]
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
4,
|
||||
"](",
|
||||
#array(expr: $e.m_storage.m_data.array[$i], size: 4),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Fixed size 3-vectors
|
||||
Eigen::Matrix<*,3,1,*,*,*>|Eigen::Matrix<*,1,3,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
x : ($c.m_storage.m_data.array)[0],
|
||||
y : ($c.m_storage.m_data.array)[1],
|
||||
z : ($c.m_storage.m_data.array)[2]
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
3,
|
||||
"](",
|
||||
#array(expr: $e.m_storage.m_data.array[$i], size: 3),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Fixed size 2-vectors
|
||||
Eigen::Matrix<*,2,1,*,*,*>|Eigen::Matrix<*,1,2,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
x : ($c.m_storage.m_data.array)[0],
|
||||
y : ($c.m_storage.m_data.array)[1]
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
2,
|
||||
"](",
|
||||
#array(expr: $e.m_storage.m_data.array[$i], size: 2),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Fixed size 1-vectors
|
||||
Eigen::Matrix<*,1,1,*,*,*>|Eigen::Matrix<*,1,1,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
x : ($c.m_storage.m_data.array)[0]
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
1,
|
||||
"](",
|
||||
#array(expr: $e.m_storage.m_data.array[$i], size: 1),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Dynamic matrices (ColMajor and RowMajor support)
|
||||
Eigen::Matrix<*,-1,-1,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
rows: $c.m_storage.m_rows,
|
||||
cols: $c.m_storage.m_cols,
|
||||
; Check for RowMajorBit
|
||||
#if ($c.Flags & 0x1) (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[($i % $c.m_storage.m_rows)*$c.m_storage.m_cols + (($i- $i % $c.m_storage.m_rows)/$c.m_storage.m_rows)],
|
||||
size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.m_storage.m_cols
|
||||
)
|
||||
) #else (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[$i],
|
||||
size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.m_storage.m_cols
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
$c.m_storage.m_rows,
|
||||
",",
|
||||
$c.m_storage.m_cols,
|
||||
"](",
|
||||
#array(
|
||||
expr : [($c.m_storage.m_data)[$i],g],
|
||||
size : $c.m_storage.m_rows*$c.m_storage.m_cols
|
||||
),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Fixed rows, dynamic columns matrix (ColMajor and RowMajor support)
|
||||
Eigen::Matrix<*,*,-1,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
rows: $c.RowsAtCompileTime,
|
||||
cols: $c.m_storage.m_cols,
|
||||
; Check for RowMajorBit
|
||||
#if ($c.Flags & 0x1) (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[($i % $c.RowsAtCompileTime)*$c.m_storage.m_cols + (($i- $i % $c.RowsAtCompileTime)/$c.RowsAtCompileTime)],
|
||||
size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.m_storage.m_cols
|
||||
)
|
||||
) #else (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[$i],
|
||||
size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.m_storage.m_cols
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
$c.RowsAtCompileTime,
|
||||
",",
|
||||
$c.m_storage.m_cols,
|
||||
"](",
|
||||
#array(
|
||||
expr : [($c.m_storage.m_data)[$i],g],
|
||||
size : $c.RowsAtCompileTime*$c.m_storage.m_cols
|
||||
),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Dynamic rows, fixed columns matrix (ColMajor and RowMajor support)
|
||||
Eigen::Matrix<*,-1,*,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
rows: $c.m_storage.m_rows,
|
||||
cols: $c.ColsAtCompileTime,
|
||||
; Check for RowMajorBit
|
||||
#if ($c.Flags & 0x1) (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[($i % $c.m_storage.m_rows)*$c.ColsAtCompileTime + (($i- $i % $c.m_storage.m_rows)/$c.m_storage.m_rows)],
|
||||
size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.ColsAtCompileTime
|
||||
)
|
||||
) #else (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data)[$i],
|
||||
size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.ColsAtCompileTime
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
$c.m_storage.m_rows,
|
||||
",",
|
||||
$c.ColsAtCompileTime,
|
||||
"](",
|
||||
#array(
|
||||
expr : [($c.m_storage.m_data)[$i],g],
|
||||
size : $c.m_storage.m_rows*$c.ColsAtCompileTime
|
||||
),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
; Fixed size matrix (ColMajor and RowMajor support)
|
||||
Eigen::Matrix<*,*,*,*,*,*>{
|
||||
children
|
||||
(
|
||||
#(
|
||||
[internals]: [$c,!],
|
||||
rows: $c.RowsAtCompileTime,
|
||||
cols: $c.ColsAtCompileTime,
|
||||
; Check for RowMajorBit
|
||||
#if ($c.Flags & 0x1) (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data.array)[($i % $c.RowsAtCompileTime)*$c.ColsAtCompileTime + (($i- $i % $c.RowsAtCompileTime)/$c.RowsAtCompileTime)],
|
||||
size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.ColsAtCompileTime
|
||||
)
|
||||
) #else (
|
||||
#array(
|
||||
rank: 2,
|
||||
base: 0,
|
||||
expr: ($c.m_storage.m_data.array)[$i],
|
||||
size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.ColsAtCompileTime
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
preview
|
||||
(
|
||||
#(
|
||||
"[",
|
||||
$c.RowsAtCompileTime,
|
||||
",",
|
||||
$c.ColsAtCompileTime,
|
||||
"](",
|
||||
#array(
|
||||
expr : [($c.m_storage.m_data.array)[$i],g],
|
||||
size : $c.RowsAtCompileTime*$c.ColsAtCompileTime
|
||||
),
|
||||
")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Doxyfile 1.13.0
|
||||
PROJECT_NAME = ${EIGEN_DOXY_PROJECT_NAME}
|
||||
PROJECT_NUMBER = ${EIGEN_VERSION}
|
||||
PROJECT_NUMBER = ${EIGEN_VERSION_STRING}
|
||||
PROJECT_LOGO = ${Eigen_SOURCE_DIR}/doc/Eigen_Silly_Professor_64x64.png
|
||||
OUTPUT_DIRECTORY = ${Eigen_BINARY_DIR}/doc${EIGEN_DOXY_OUTPUT_DIRECTORY_SUFFIX}
|
||||
FULL_PATH_NAMES = YES
|
||||
|
@ -449,7 +449,7 @@ conj(array1)
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
Some coefficient-wise operators are readily available for for matrices and vectors through the following cwise* methods:
|
||||
Some coefficient-wise operators are readily available for matrices and vectors through the following cwise* methods:
|
||||
<table class="manual">
|
||||
<tr><th>Matrix API \matrixworld</th><th>Via Array conversions</th></tr>
|
||||
<tr><td>\code
|
||||
|
@ -178,7 +178,7 @@ For direct methods, the solution are computed at the machine precision. Sometime
|
||||
\section BenchmarkRoutine
|
||||
Most of the time, all you need is to know how much time it will take to solve your system, and hopefully, what is the most suitable solver. In Eigen, we provide a benchmark routine that can be used for this purpose. It is very easy to use. In the build directory, navigate to `bench/spbench` and compile the routine by typing `make spbenchsolver`. Run it with `--help` option to get the list of all available options. Basically, the matrices to test should be in <a href="http://math.nist.gov/MatrixMarket/formats.html">MatrixMarket Coordinate format</a>, and the routine returns the statistics from all available solvers in Eigen.
|
||||
|
||||
To export your matrices and right-hand-side vectors in the matrix-market format, you can the the unsupported SparseExtra module:
|
||||
To export your matrices and right-hand-side vectors in the matrix-market format, you can use the unsupported SparseExtra module:
|
||||
\code
|
||||
#include <unsupported/Eigen/SparseExtra>
|
||||
...
|
||||
|
@ -7,16 +7,16 @@ namespace Eigen {
|
||||
%Eigen provides native CMake support which allows the library to be easily
|
||||
used in CMake projects.
|
||||
|
||||
\note %CMake 3.0 (or later) is required to enable this functionality.
|
||||
\note %CMake 3.5 (or later) is required to enable this functionality.
|
||||
|
||||
%Eigen exports a CMake target called `Eigen3::Eigen` which can be imported
|
||||
using the `find_package` CMake command and used by calling
|
||||
`target_link_libraries` as in the following example:
|
||||
\code{.cmake}
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
cmake_minimum_required (VERSION 3.5)
|
||||
project (myproject)
|
||||
|
||||
find_package (Eigen3 3.3 REQUIRED NO_MODULE)
|
||||
find_package (Eigen3 REQUIRED NO_MODULE)
|
||||
|
||||
add_executable (example example.cpp)
|
||||
target_link_libraries (example Eigen3::Eigen)
|
||||
@ -27,10 +27,19 @@ The above code snippet must be placed in a file called `CMakeLists.txt` alongsid
|
||||
\code{.sh}
|
||||
$ cmake path-to-example-directory
|
||||
\endcode
|
||||
CMake will produce project files that generate an executable called `example`
|
||||
which requires at least version 3.3 of %Eigen. Here, `path-to-example-directory`
|
||||
is the path to the directory that contains both `CMakeLists.txt` and
|
||||
`example.cpp`.
|
||||
CMake will produce project files that generate an executable called `example`.
|
||||
Here, `path-to-example-directory` is the path to the directory that contains
|
||||
both `CMakeLists.txt` and `example.cpp`. Note that if you have multiple
|
||||
instances of %Eigen installed, `find_package` will use the first one
|
||||
encountered. To request a specific version of %Eigen, use the `<version>`
|
||||
option in `find_package`:
|
||||
```
|
||||
find_package(Eigen3 3.4 REQUIRED NO_MODULE) # Restricts to 3.4.z
|
||||
```
|
||||
or to support a range of versions:
|
||||
```
|
||||
find_package(Eigen3 3.4...5 REQUIRED NO_MODULE) # Any version >=3.4.0 but <6.0.0.
|
||||
```
|
||||
|
||||
Do not forget to set the <a href="https://cmake.org/cmake/help/v3.7/variable/CMAKE_PREFIX_PATH.html">\c CMAKE_PREFIX_PATH </a> variable if Eigen is not installed in a default location or if you want to pick a specific version. For instance:
|
||||
\code{.sh}
|
||||
@ -44,7 +53,7 @@ $ cmake path-to-example-directory -DEigen3_DIR=$HOME/mypackages/share/eigen3/cma
|
||||
If the `REQUIRED` option is omitted when locating %Eigen using
|
||||
`find_package`, one can check whether the package was found as follows:
|
||||
\code{.cmake}
|
||||
find_package (Eigen3 3.3 NO_MODULE)
|
||||
find_package (Eigen3 NO_MODULE)
|
||||
|
||||
if (TARGET Eigen3::Eigen)
|
||||
# Use the imported target
|
||||
|
@ -97,7 +97,7 @@ endif()
|
||||
|
||||
set(EIGEN_LAPACK_TARGETS "")
|
||||
|
||||
add_library(eigen_lapack_static ${EigenLapack_SRCS} ${ReferenceLapack_SRCS})
|
||||
add_library(eigen_lapack_static STATIC ${EigenLapack_SRCS} ${ReferenceLapack_SRCS})
|
||||
list(APPEND EIGEN_LAPACK_TARGETS eigen_lapack_static)
|
||||
|
||||
if (EIGEN_BUILD_SHARED_LIBS)
|
||||
|
0
scripts/eigen_gen_docs
Normal file → Executable file
0
scripts/eigen_gen_docs
Normal file → Executable file
0
scripts/eigen_gen_split_test_help.cmake
Normal file → Executable file
0
scripts/eigen_gen_split_test_help.cmake
Normal file → Executable file
@ -323,6 +323,7 @@ ei_add_test(threads_runqueue "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
||||
ei_add_test(threads_non_blocking_thread_pool "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
||||
ei_add_test(threads_fork_join "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
|
||||
add_executable(bug1213 bug1213.cpp bug1213_main.cpp)
|
||||
target_link_libraries(bug1213 Eigen3::Eigen)
|
||||
|
||||
check_cxx_compiler_flag("-ffast-math" COMPILER_SUPPORT_FASTMATH)
|
||||
if(COMPILER_SUPPORT_FASTMATH)
|
||||
|
@ -734,7 +734,7 @@ void comparisons(const ArrayType& m) {
|
||||
VERIFY_IS_CWISE_EQUAL(m1.abs().cwiseLessOrEqual(NumTraits<Scalar>::highest()), bool_true);
|
||||
VERIFY_IS_CWISE_EQUAL(m1.abs().cwiseGreaterOrEqual(Scalar(0)), bool_true);
|
||||
|
||||
// test Select
|
||||
// test select
|
||||
VERIFY_IS_APPROX((m1 < m2).select(m1, m2), m1.cwiseMin(m2));
|
||||
VERIFY_IS_APPROX((m1 > m2).select(m1, m2), m1.cwiseMax(m2));
|
||||
Scalar mid = (m1.cwiseAbs().minCoeff() + m1.cwiseAbs().maxCoeff()) / Scalar(2);
|
||||
@ -762,6 +762,18 @@ void comparisons(const ArrayType& m) {
|
||||
VERIFY_IS_APPROX(((m1.abs() + 1) > RealScalar(0.1)).colwise().count(),
|
||||
ArrayOfIndices::Constant(cols, rows).transpose());
|
||||
VERIFY_IS_APPROX(((m1.abs() + 1) > RealScalar(0.1)).rowwise().count(), ArrayOfIndices::Constant(rows, cols));
|
||||
|
||||
// simple data type that does not permit implicit conversions
|
||||
struct scalar_wrapper {
|
||||
Scalar m_data;
|
||||
scalar_wrapper() : m_data(0) {}
|
||||
explicit scalar_wrapper(Scalar data) : m_data(data) {}
|
||||
bool operator==(scalar_wrapper other) const { return m_data == other.m_data; }
|
||||
};
|
||||
|
||||
// test bug2966: select did not support some scalar types that forbade implicit conversions from bool
|
||||
ArrayX<scalar_wrapper> m5(10);
|
||||
m5 = (m5 == scalar_wrapper(0)).select(m5, m5);
|
||||
}
|
||||
|
||||
template <typename ArrayType>
|
||||
|
@ -120,7 +120,7 @@ void comparisons(const MatrixType& m) {
|
||||
VERIFY((m1.array() == m1(r, c)).any());
|
||||
VERIFY(m1.cwiseEqual(m1(r, c)).any());
|
||||
|
||||
// test Select
|
||||
// test select
|
||||
VERIFY_IS_APPROX((m1.array() < m2.array()).select(m1, m2), m1.cwiseMin(m2));
|
||||
VERIFY_IS_APPROX((m1.array() > m2.array()).select(m1, m2), m1.cwiseMax(m2));
|
||||
Scalar mid = m1.cwiseAbs().minCoeff() / Scalar(2) + m1.cwiseAbs().maxCoeff() / Scalar(2);
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <limits>
|
||||
#include <Eigen/Eigenvalues>
|
||||
#include <Eigen/SparseCore>
|
||||
#include <unsupported/Eigen/MatrixFunctions>
|
||||
|
||||
template <typename MatrixType>
|
||||
void selfadjointeigensolver_essential_check(const MatrixType& m) {
|
||||
@ -135,11 +136,13 @@ void selfadjointeigensolver(const MatrixType& m) {
|
||||
VERIFY_RAISES_ASSERT(eiSymmUninitialized.eigenvectors());
|
||||
VERIFY_RAISES_ASSERT(eiSymmUninitialized.operatorSqrt());
|
||||
VERIFY_RAISES_ASSERT(eiSymmUninitialized.operatorInverseSqrt());
|
||||
VERIFY_RAISES_ASSERT(eiSymmUninitialized.operatorExp());
|
||||
|
||||
eiSymmUninitialized.compute(symmA, false);
|
||||
VERIFY_RAISES_ASSERT(eiSymmUninitialized.eigenvectors());
|
||||
VERIFY_RAISES_ASSERT(eiSymmUninitialized.operatorSqrt());
|
||||
VERIFY_RAISES_ASSERT(eiSymmUninitialized.operatorInverseSqrt());
|
||||
VERIFY_RAISES_ASSERT(eiSymmUninitialized.operatorExp());
|
||||
|
||||
// test Tridiagonalization's methods
|
||||
Tridiagonalization<MatrixType> tridiag(symmC);
|
||||
@ -167,6 +170,14 @@ void selfadjointeigensolver(const MatrixType& m) {
|
||||
eiSymmTridiag.eigenvectors().real().transpose());
|
||||
}
|
||||
|
||||
// Test matrix expponential from eigendecomposition.
|
||||
// First scale to avoid overflow.
|
||||
symmB = symmB / symmB.norm();
|
||||
eiSymm.compute(symmB);
|
||||
MatrixType expSymmB = eiSymm.operatorExp();
|
||||
symmB = symmB.template selfadjointView<Lower>();
|
||||
VERIFY_IS_APPROX(expSymmB, symmB.exp());
|
||||
|
||||
if (rows > 1 && rows < 20) {
|
||||
// Test matrix with NaN
|
||||
symmC(0, 0) = std::numeric_limits<typename MatrixType::RealScalar>::quiet_NaN();
|
||||
|
@ -340,7 +340,7 @@ EIGEN_DECLARE_TEST(evaluators) {
|
||||
matXcd_ref.imag() = mat2;
|
||||
VERIFY_IS_APPROX(matXcd, matXcd_ref);
|
||||
|
||||
// test Select
|
||||
// test select
|
||||
VERIFY_IS_APPROX_EVALUATOR(aX, (aXsrc > 0).select(aXsrc, -aXsrc));
|
||||
|
||||
// test Replicate
|
||||
|
@ -112,6 +112,27 @@ void homogeneous(void) {
|
||||
|
||||
VERIFY_IS_APPROX((t2.template triangularView<Lower>() * v0.homogeneous()).eval(),
|
||||
(t2.template triangularView<Lower>() * hv0));
|
||||
|
||||
{
|
||||
const MatrixType points = MatrixType::Random();
|
||||
const VectorType center = VectorType::Random();
|
||||
|
||||
const auto pts3 = points.rowwise() - center.transpose();
|
||||
const auto pts_xy1 = pts3.template leftCols<Size - 1>().rowwise().homogeneous();
|
||||
const auto pts_xy2 = pts3.template topRows<Size - 1>().colwise().homogeneous();
|
||||
|
||||
VERIFY_IS_APPROX(pts_xy1.transpose() * pts_xy1, pts_xy1.transpose() * pts_xy1.eval());
|
||||
VERIFY_IS_APPROX(pts_xy2 * pts_xy2.transpose(), pts_xy2.eval() * pts_xy2.transpose());
|
||||
}
|
||||
|
||||
{
|
||||
const Eigen::PermutationMatrix<Size> P{Eigen::Vector<int, Size>::EqualSpaced(0, 1)};
|
||||
const auto right = Eigen::Vector<Scalar, Size - 1>::Random().eval().homogeneous();
|
||||
const auto left = Eigen::RowVector<Scalar, Size - 1>::Random().eval().homogeneous();
|
||||
|
||||
VERIFY_IS_APPROX(P * right, P * right.eval());
|
||||
VERIFY_IS_APPROX(left * P, left.eval() * P);
|
||||
}
|
||||
}
|
||||
|
||||
EIGEN_DECLARE_TEST(geo_homogeneous) {
|
||||
|
@ -840,11 +840,21 @@ void check_tutorial_examples() {
|
||||
}
|
||||
}
|
||||
|
||||
void check_aliasing() {
|
||||
Eigen::Vector<float, 5> z = {0.0f, 1.1f, 2.2f, 3.3f, 4.4f};
|
||||
std::vector<int> left_indices = {0, 1, 3, 4};
|
||||
std::vector<int> right_indices = {1, 3, 4, 0};
|
||||
z(left_indices) = z(right_indices);
|
||||
Eigen::Vector<float, 5> expected = {1.1f, 3.3f, 2.2f, 4.4f, 0.0f};
|
||||
VERIFY_IS_EQUAL(z, expected);
|
||||
}
|
||||
|
||||
EIGEN_DECLARE_TEST(indexed_view) {
|
||||
for (int i = 0; i < g_repeat; i++) {
|
||||
CALL_SUBTEST_1(check_indexed_view());
|
||||
}
|
||||
CALL_SUBTEST_1(check_tutorial_examples());
|
||||
CALL_SUBTEST_1(check_aliasing());
|
||||
|
||||
// static checks of some internals:
|
||||
STATIC_CHECK((internal::is_valid_index_type<int>::value));
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <fstream>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user