0
0
mirror of https://gitlab.com/libeigen/eigen.git synced 2026-01-18 17:31:19 +01:00
Commit Graph

12853 Commits

Author SHA1 Message Date
Antonio Sánchez
7f85d5cf5b Implement assume_aligned using the standard API
This implements `Eigen::internal::assume_aligned` to match the API for C++20 standard as best as possible using either `std::assume_aligned` or `__builtin_assume_aligned` if available. If neither is available, the function is a no-op.

The override macro `EIGEN_ASSUME_ALIGNED` was changed to a `EIGEN_DONT_ASSUME_ALIGNED`, which now forces the function to be a no-op.

See merge request libeigen/eigen!2052


(cherry picked from commit 8716f109e4)

f8191848 Fix pcmp_* for HVX to to comply with the new definition of true = Scalar(1).
7cc169d9 Revert "Fix pcmp_* for HVX to to comply with the new definition of true = Scalar(1)."
06999845 Merge branch eigen:master into master
b5fde61f Merge branch eigen:master into master
10d10d60 Merge branch eigen:master into master
9398d6ad Merge branch eigen:master into master
7804d5a4 Merge branch eigen:master into master
0068623c Merge branch eigen:master into master
b0ffc9cf Merge branch eigen:master into master
f3791c80 Merge branch eigen:master into master
74275f0c Merge branch eigen:master into master
b095614e Merge branch eigen:master into master
1312a696 Merge branch eigen:master into master
e6dd44d2 Merge branch eigen:master into master
8ac67769 Implement assume_aligned using the standard API if available.
97b299fa Format.
b31798be Fix typos.
04b3d312 Unformat.

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
2025-11-05 21:26:04 +00:00
Antonio Sánchez
748962722c Fix SparseVector::insert(Index) assigning int to Scalar
Scalar doesn't necessarily support implicit construction from int or
assignment from int.

Here's the error message I got without this fix:
```
/home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/src/SparseCore/SparseVector.h:180:25: error: no match for ‘operator=’ (operand types are ‘Eigen::internal::CompressedStorage<ExplicitDouble, int>::Scalar’ {aka ‘ExplicitDouble’} and ‘int’)
  180 |     m_data.value(p + 1) = 0;
      |     ~~~~~~~~~~~~~~~~~~~~^~~
```

See merge request libeigen/eigen!2046


(cherry picked from commit 9234883914)

48d2b101 Fix SparseVector::insert(Index) assigning int to Scalar

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2025-11-05 21:24:44 +00:00
Antonio Sánchez
284dcc122b Fix doc references for nullary expressions.
<!-- 
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Fix doc references for nullary expressions.

### Reference issue
<!--
You can link to a specific issue using the gitlab syntax #<issue number>. 
If the MR fixes an issue, write "Fixes #<issue number>" to have the issue automatically closed on merge.
-->

Fixes #2997.

### Additional information
<!--Any additional information you think is important.-->

Closes #2997

See merge request libeigen/eigen!2054


(cherry picked from commit 04eb06b354)

31a2702e Fix doc references for nullary expressions.

Co-authored-by: Antonio Sánchez <cantonios@google.com>
2025-11-03 18:54:35 +00:00
Antonio Sánchez
691009cfa3 Allow user to configure if free is allowed at runtime.
<!--
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Allow user to configure if `free` is allowed at runtime.

Reverts to Eigen 3.4 behavior by default, where `free(...)` is allowed if `EIGEN_RUNTIME_NO_MALLOC` is defined but `set_is_malloc_allowed(true)`.  Adds a separate `set_is_free_allowed(...)` to explicitly control use of `std::free`.

### Reference issue
<!--
You can link to a specific issue using the gitlab syntax #<issue number>.
If the MR fixes an issue, write "Fixes #<issue number>" to have the issue automatically closed on merge.
-->

Fixes #2983.

### Additional information
<!--Any additional information you think is important.-->

Closes #2983

See merge request libeigen/eigen!2047

(cherry picked from commit 60122df698)
2025-10-29 08:40:21 -07:00
Tyler Veness
a9110bfc87 Fix ambiguous sqrt() overload caused by ADL
Here's the compiler error:
```
/home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/src/Householder/Householder.h:82:16: error: call of overloaded ‘sqrt(boost::decimal::decimal64_t)’ is ambiguous
   82 |     beta = sqrt(numext::abs2(c0) + tailSqNorm);
      |            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/src/Householder/Householder.h:82:16: note: there are 2 candidates
In file included from /home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/Core:198,
                 from /home/tav/git/Sleipnir/test/src/optimization/cart_pole_problem_test.cpp:8:
/home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/src/Core/MathFunctions.h:1384:75: note: candidate 1: ‘typename Eigen::internal::sqrt_retval<typename Eigen::internal::global_math_functions_filtering_base<Scalar>::type>::type Eigen::numext::sqrt(const Scalar&) [with Scalar = boost::decimal::decimal64_t; typename Eigen::internal::sqrt_retval<typename Eigen::internal::global_math_functions_filtering_base<Scalar>::type>::type = boost::decimal::decimal64_t; typename Eigen::internal::global_math_functions_filtering_base<Scalar>::type = boost::decimal::decimal64_t]’
 1384 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_MATHFUNC_RETVAL(sqrt, Scalar) sqrt(const Scalar& x) {
      |                                                                           ^~~~
In file included from /home/tav/git/Sleipnir/build/_deps/decimal-src/include/boost/decimal/detail/cmath/ellint_1.hpp:16,
                 from /home/tav/git/Sleipnir/build/_deps/decimal-src/include/boost/decimal/cmath.hpp:18,
                 from /home/tav/git/Sleipnir/build/_deps/decimal-src/include/boost/decimal.hpp:33,
                 from /home/tav/git/Sleipnir/test/include/scalar_types_under_test.hpp:6,
                 from /home/tav/git/Sleipnir/test/src/optimization/cart_pole_problem_test.cpp:19:
/home/tav/git/Sleipnir/build/_deps/decimal-src/include/boost/decimal/detail/cmath/sqrt.hpp:167:16: note: candidate 2: ‘constexpr T boost::decimal::sqrt(T) requires  is_decimal_floating_point_v<T> [with T = decimal64_t]’
  167 | constexpr auto sqrt(const T val) noexcept
      |                ^~~~
```

Calling a function via its unqualified name invokes argument-dependent lookup. In this case, since `using numext::sqrt;` was used, both `numext::sqrt()` and `boost::decimal::sqrt()` participated in overload resolution. Since only `numext::sqrt()` was intended, the fix is to call that overload directly instead.

See merge request libeigen/eigen!2044

(cherry picked from commit be56fff1ff)
2025-10-27 09:49:29 -07:00
Antonio Sánchez
da889c88f9 Clarify range spanning major versions only works with 3.4.1.
<!--
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Clarify range spanning major versions only works with 3.4.1.

### Reference issue
<!--
You can link to a specific issue using the gitlab syntax #<issue number>.
If the MR fixes an issue, write "Fixes #<issue number>" to have the issue automatically closed on merge.
-->

Fixes #2994.

Closes #2994

See merge request libeigen/eigen!2042

(cherry picked from commit 1a5eecd45e)
2025-10-27 09:49:14 -07:00
Antonio Sánchez
85e122408b Eliminate use of std::cout in ArpackSelfAdjointEigenSolver.
<!--
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Eliminate use of std::cout in ArpackSelfAdjointEigenSolver.

Instead set the appropriate error status on failure.

### Reference issue
<!--
You can link to a specific issue using the gitlab syntax #<issue number>.
If the MR fixes an issue, write "Fixes #<issue number>" to have the issue automatically closed on merge.
-->

### Additional information
<!--Any additional information you think is important.-->

See merge request libeigen/eigen!2041

(cherry picked from commit b4209fe984)
2025-10-27 09:49:02 -07:00
Tyler Veness
5aec73ab06 Fix SparseVector::insertBack() with custom scalar types
It fixes this compiler error:
```
/home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/src/SparseCore/SparseVector.h:143:19: error: cannot convert ‘int’ to ‘const Eigen::internal::CompressedStorage<boost::decimal::decimal64_t, int>::Scalar&’ {aka ‘const boost::decimal::decimal64_t&’}
  143 |     m_data.append(0, i);
      |                   ^
      |                   |
      |                   int
```

This change matches what SparseMatrix does:
https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/src/SparseCore/SparseMatrix.h#L430-L438

See merge request libeigen/eigen!2040

(cherry picked from commit ac3ef16f30)
2025-10-27 09:48:45 -07:00
Charles Schlosser
9071c1cd07 CI enhancements: visual indication of flaky tests
<!--
Thanks for contributing a merge request! Please name and fully describe your MR as you would for a commit message.
If the MR fixes an issue, please include "Fixes #issue" in the commit message and the MR description.

In addition, we recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen) and [git page](https://eigen.tuxfamily.org/index.php?title=Git), which will help you submit a more standardized MR.

Before submitting the MR, you also need to complete the following checks:
- Make one PR per feature/bugfix (don't mix multiple changes into one PR). Avoid committing unrelated changes.
- Rebase before committing
- For code changes, run the test suite (at least the tests that are likely affected by the change).
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- If possible, add a test (both for bug-fixes as well as new features)
- Make sure new features are documented

Note that we are a team of volunteers; we appreciate your patience during the review process.

Again, thanks for contributing! -->

### Reference issue
<!-- You can link to a specific issue using the gitlab syntax #<issue number>  -->

### What does this implement/fix?
<!--Please explain your changes.-->

Currently, we run each test 3 times to account for flaky tests. Sometimes, the test fails so quickly that the random seed is the same for the subsequent test, which fails the exact same way.

This MR uses a nanosecond seed which resolves the issue described above. Now, if the test does not pass on the first attempt but passes on the retries, the gitlab job status will be yellow but still be treated as a pass in the ci/cd pipeline. Hopefully, this means we will get more passes and help us identify room for improvement.

### Additional information
<!--Any additional information you think is important.-->

See merge request libeigen/eigen!2025

(cherry picked from commit 40da5b64ce)
2025-10-27 09:48:36 -07:00
Antonio Sánchez
41e848c558 Support AVX for i686.
<!--
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Support AVX for i686.

There was an existing work-around for windows.  Added the more generic
architecture comparison to also apply for linux.

### Reference issue
<!--
You can link to a specific issue using the gitlab syntax #<issue number>.
If the MR fixes an issue, write "Fixes #<issue number>" to have the issue automatically closed on merge.
-->

Fixes #2991.

Closes #2991

See merge request libeigen/eigen!2037

(cherry picked from commit 8e60d4173c)
2025-10-27 09:48:15 -07:00
Antonio Sánchez
66375a8dc9 Fix commit references in changelog.
(cherry picked from commit f5907c5930)
2025-10-27 09:48:01 -07:00
Antonio Sanchez
076e524362 Try disabling the cache again for ROCm.
(cherry picked from commit 73da4623b1)
2025-10-27 09:47:47 -07:00
Saran Tunyasuvunakool
55d059108e Add a missing #include <version> to Core.
(cherry picked from commit db02f97850)
2025-10-27 09:47:32 -07:00
Antonio Sánchez
a5c3f697fa Fix DLL builds and c++ lapack declarations.
(cherry picked from commit e1f1a608be)
2025-10-27 09:47:17 -07:00
Antonio Sanchez
bdacccda15 Grammar fix "must has" --> "must have".
(cherry picked from commit 52358cb93b)
2025-10-27 09:47:04 -07:00
Antonio Sánchez
c9c2c1300a Disable ROCm job cache.
(cherry picked from commit 3bd0bfe0e0)
2025-10-27 09:46:47 -07:00
Charlie Schlosser
9ad6809b32 assume_aligned uses bytes not bits
(cherry picked from commit cd4f989f8f)
2025-10-27 09:46:30 -07:00
Antonio Sánchez
4f240eee3f Add a bunch of useful scripts for planning releases.
(cherry picked from commit ac7c192e1b)
2025-10-27 09:46:15 -07:00
Damiano Franzò
0f80c3d7e5 Fix jacobi svd for TriangularBase
(cherry picked from commit 5bc944a3ef)
2025-10-27 09:46:04 -07:00
Antonio Sánchez
e2e711aabe Fix BLAS/LAPACK DLL usage on Windows.
(cherry picked from commit dbe9e6961e)
2025-10-27 09:45:51 -07:00
Antonio Sánchez
6c1a886042 Add workaround for using std::fma for scalar multiply-add.
(cherry picked from commit ef3c5c1d1d)
2025-10-27 09:45:41 -07:00
Charles Schlosser
a34d8eee5c Fix alignment bug in avx pcast<Packet4l, Packet4d>
(cherry picked from commit 5996176b88)
2025-10-27 09:45:26 -07:00
Laurenz
92d5da40ac Fix SSE PacketMath Compilation Error on QNX
(cherry picked from commit 4bd382df56)
2025-10-27 09:45:08 -07:00
Charles Schlosser
b5848287be fix errors in windows builds and tests
(cherry picked from commit 13bd14974d)
2025-10-27 09:44:55 -07:00
Charles Schlosser
0ea30a44f3 get rid of a bunch of windows jobs
(cherry picked from commit f9f515fb55)
2025-10-27 09:43:13 -07:00
Antonio Sánchez
4abf3bd540 Update dev version number.
(cherry picked from commit ccde35bcd5)
2025-10-27 09:40:18 -07:00
Sergiu Deitsch
b89b549f96 Eliminate possible -Wstringop-overflow warning in .setZero()
(cherry picked from commit 32b0f386bc)
2025-10-27 09:39:01 -07:00
Antonio Sanchez
be7d8d37f2 Fix line-endings for MSVC files. 2025-10-27 09:37:58 -07:00
Jeremy Nimmer
b27f784ca5 Fix scalar_inner_product_op when binary ops return a different type 2025-10-06 18:19:59 +00:00
Guilhem Saurel
c08497ae1c tests: add missing link
(cherry picked from commit a67f9dabb0)
2025-10-02 10:10:05 -07:00
Antonio Sánchez
514221aee5 Update geo_homogeneous test, add eval() to PermutationMatrix.
(cherry picked from commit 4916887f2c)
2025-10-02 10:09:37 -07:00
Eugene Zhulenev
b60f763ec0 The 'CompressedStorageIterator<>' needs to satisfy the RandomAccessIterator
(cherry picked from commit 5c1029be1a)
2025-10-02 10:08:49 -07:00
Antonio Sanchez
63b5f63a6a Enable docs for the 5.0 branch on push. 2025-10-01 09:01:44 -07:00
Antonio Sanchez
549bf8c75b Add 5.0 changelog. 5.0.0 2025-09-28 00:24:17 -07:00
Charlie Schlosser
151b95d078 bump to 5.0.0 2025-09-28 00:24:17 -07:00
Hans Johnson
2e5447e620 STYLE: Scripts with shebang should be executable 2025-09-28 06:38:59 +00:00
Sergiu Deitsch
8d7ebac6ec Disambiguate multiplication of a permutation matrix and a homogeneous vector 2025-09-27 14:05:28 +02:00
Charles Schlosser
bea7f7c582 SparseMatrixBase: delete redundant/shadowed typedef 2025-09-26 09:32:28 +00:00
Julien Schueller
7292c78e18 blas: Fix parenthesis suggestion warning 2025-09-24 19:14:55 +00:00
Sergiu Deitsch
e524488eb2 Convert Mercurial hgeol to gitattributes 2025-09-24 19:14:40 +00:00
Charles Schlosser
dbd25f632b Fix select: return typed comparisons if vectorized 2025-09-24 05:38:12 +00:00
Antonio Sánchez
027dc5bc8d Extend the range of supported CMake package config versions 2025-09-23 19:52:35 +00:00
Sergiu Deitsch
4df215785b Support matrix multiplication of homogeneous row vectors 2025-09-23 14:56:28 +00:00
Rasmus Munk Larsen
2d170aea11 Define pcmp_le generically in terms of pcmp_eq and pcmp_lt. 2025-09-23 14:34:57 +00:00
Sergiu Deitsch
ea869e183b Add missing bool SSE2 PacketMath comparison 2025-09-22 21:28:45 +02:00
Julien Schueller
6ef18340a1 CMake: Explicit STATIC libs 2025-09-22 18:32:36 +00:00
Sergiu Deitsch
14477c5d43 Replace deprecated std::is_trivial by an internal definition 2025-09-22 16:59:10 +00:00
Antonio Sánchez
b2ec79a23c Move smoketests to small GitLab runners. 2025-09-22 16:45:02 +00:00
Sergiu Deitsch
62fbd276e0 Provide hints for deprecated functionality 2025-09-22 16:00:42 +00:00
Mark Shachkov
d38d669fdb Fix real schur exceptional shift 2025-09-22 15:57:14 +00:00