Skip to content

Conversation

@alexander-novo
Copy link
Collaborator

@alexander-novo alexander-novo commented Jan 6, 2026

Description

Adds a new structure, IdaStats, which keeps track of several statistics returned by IDA. A user can query these statistics from IDA by calling Ida::getStats() and can accumulate several runs of stats in the structure. There is also functionality to print a report, similar to the Ida::printFinalStats() function after the stats have been accumulated together.

Closes #322

@Steven-Roberts let me know if there's anything else you think I should put in.

Proposed changes

It makes sense for Ida::getStats() to be const, but then Ida::checkAllocation() and Ida::checkOutput() are inaccessible. These functions never touch any IDA state, so it makes sense for these functions to be static anyway.

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

There are not unit tests, but I have added a printout of the report to the rlcircuit example:

                         Steps :           70
                Residual evals :           86
         Linear decompositions :           19
           Error test failures :            0
                 Linear solves :           86
Nonlinear convergence failures :            0

Further comments

These functions never access object state - they should have been static anyways.

This allows `const` functions in Ida to call these functions.
@alexander-novo alexander-novo requested a review from pelesh January 6, 2026 23:42
Copy link
Collaborator

@Steven-Roberts Steven-Roberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Steven-Roberts let me know if there's anything else you think I should put in.

This looks like a reasonable set of stats to start with.

@nkoukpaizan nkoukpaizan added the enhancement New feature or request label Jan 7, 2026
Copy link
Collaborator

@pelesh pelesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of minor things to fix before this could be merged, otherwise very helpful. Thanks!

@pelesh pelesh requested a review from Steven-Roberts January 9, 2026 20:25
@pelesh pelesh merged commit 99b1014 into develop Jan 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get IDA stats as data

5 participants