Skip to content

Add NumTraits::digits for Eigen 5 support - #251

Merged
bradbell merged 1 commit into
coin-or:mainfrom
benmwebb:eigen_5_random
Apr 30, 2026
Merged

Add NumTraits::digits for Eigen 5 support#251
bradbell merged 1 commit into
coin-or:mainfrom
benmwebb:eigen_5_random

Conversation

@benmwebb

Copy link
Copy Markdown
Contributor

The random number generator in Eigen 5 calls NumTraits<Scalar>::digits(). This is not currently implemented for CppAD types, causing a compile-time failure. Add such an implementation that simply uses std::numeric_limits<T>::digits. Closes #250.

The random number generator in Eigen 5 calls
NumTraits<Scalar>::digits(). This is not currently
implemented for CppAD types, causing a compile-time
failure. Add such an implementation that simply uses
std::numeric_limits<T>::digits. Closes coin-or#250.
@bradbell
bradbell merged commit 12d1e4c into coin-or:main Apr 30, 2026
7 of 9 checks passed
@bradbell

bradbell commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Nice job and thanks!

I have a few minor comments to help with future pull requests:

  1. Mention the users view of the changes in the whats new for the current year; e.g., see
    4af526f

  2. Put the name of the branch you are working on at the beginning of the log messages for the corresponding commits. This makes it easy to see which commits are on the main branch and correspond to a fully functioning CppAD. For example, the log message for the commit above begins with pull_251 because that is the branch I was working on. I use the following utility for this; bin/git_commit.sh and for some other nice features (like caching the previous commit message in git_commit.log).

  3. After I merge the pull request, I change the message to reflect that date at which the change became part of the CppAD releases; see
    dcc87a3

@bradbell

bradbell commented May 4, 2026

Copy link
Copy Markdown
Contributor

Perhaps we should change the testing of CppAD to use Eigen 5 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Random number generation does not work with Eigen 5, missing 'digits' method

2 participants