Reduce Eigen allocations with fixed-size matrix and vector types - #1502
Open
schaubh wants to merge 9 commits into
Open
Reduce Eigen allocations with fixed-size matrix and vector types#1502schaubh wants to merge 9 commits into
schaubh wants to merge 9 commits into
Conversation
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Use row-major Eigen maps to avoid transpose temporaries, add overloads that preserve fixed-size Eigen expressions, and use fixed-size 3x3 matrices for geodetic frame conversions.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Pass BSpline, Discretize, and Saturate inputs by reference, avoid unnecessary vector copies during discretization, and use fixed two-column storage for saturation bounds.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Preallocate random, noise, and propagated-state vectors to avoid per-step allocations, and pass configuration and state data by reference.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Represent the SimpleNav and PlanetNav error transition matrices with compile-time dimensions and keep per-step propagation in fixed-size storage.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Represent six-element states and covariance transformations with compile-time Eigen types throughout Lambert planning, validation, and Runge-Kutta propagation.
schaubh
force-pushed
the
feature/fix_eigen_size
branch
from
July 31, 2026 17:36
549c290 to
8033d96
Compare
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Encode EKF and UKF state, covariance, sigma-point, and measurement dimensions in their Eigen types, and remove the redundant runtime dimension counters.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Constrain mass-matrix blocks and VSCMG steering matrices to their fixed three-row or three-column dimensions and avoid copying stored momentum into a dynamic vector.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Replace dynamic three-dimensional matrices and vectors with fixed-size types or direct maps in waypoint control, magnetic torque bars, gravity, radiation, and ground mapping.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Use row-major Eigen maps to avoid transpose temporaries, add overloads that preserve fixed-size Eigen expressions, and use fixed-size 3x3 matrices for geodetic frame conversions.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Pass BSpline, Discretize, and Saturate inputs by reference, avoid unnecessary vector copies during discretization, and use fixed two-column storage for saturation bounds.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Preallocate random, noise, and propagated-state vectors to avoid per-step allocations, and pass configuration and state data by reference.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Represent the SimpleNav and PlanetNav error transition matrices with compile-time dimensions and keep per-step propagation in fixed-size storage.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Represent six-element states and covariance transformations with compile-time Eigen types throughout Lambert planning, validation, and Runge-Kutta propagation.
schaubh
force-pushed
the
feature/fix_eigen_size
branch
from
July 31, 2026 21:09
8033d96 to
638d72c
Compare
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Encode EKF and UKF state, covariance, sigma-point, and measurement dimensions in their Eigen types, and remove the redundant runtime dimension counters.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Constrain mass-matrix blocks and VSCMG steering matrices to their fixed three-row or three-column dimensions and avoid copying stored momentum into a dynamic vector.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Replace dynamic three-dimensional matrices and vectors with fixed-size types or direct maps in waypoint control, magnetic torque bars, gravity, radiation, and ground mapping.
schaubh
added a commit
that referenced
this pull request
Jul 31, 2026
Use row-major Eigen maps to avoid transpose temporaries, add overloads that preserve fixed-size Eigen expressions, and use fixed-size 3x3 matrices for geodetic frame conversions.
Pass BSpline, Discretize, and Saturate inputs by reference, avoid unnecessary vector copies during discretization, and use fixed two-column storage for saturation bounds.
Preallocate random, noise, and propagated-state vectors to avoid per-step allocations, and pass configuration and state data by reference.
Represent the SimpleNav and PlanetNav error transition matrices with compile-time dimensions and keep per-step propagation in fixed-size storage.
Represent six-element states and covariance transformations with compile-time Eigen types throughout Lambert planning, validation, and Runge-Kutta propagation.
Encode EKF and UKF state, covariance, sigma-point, and measurement dimensions in their Eigen types, and remove the redundant runtime dimension counters.
Constrain mass-matrix blocks and VSCMG steering matrices to their fixed three-row or three-column dimensions and avoid copying stored momentum into a dynamic vector.
Replace dynamic three-dimensional matrices and vectors with fixed-size types or direct maps in waypoint control, magnetic torque bars, gravity, radiation, and ground mapping.
schaubh
force-pushed
the
feature/fix_eigen_size
branch
from
August 1, 2026 21:52
638d72c to
716196e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR reduces Eigen heap allocations and unnecessary copies by replacing dynamically sized matrices and vectors with fixed-size or partially fixed-size types where dimensions are known at compile time.
The commits are organized by subsystem:
The changes preserve existing numerical behavior and message interfaces. The SWIG-visible dynamic Eigen conversion functions remain available, while C++ overloads avoid converting fixed-size Eigen expressions to temporary
MatrixXdobjects.Verification
git diff --checkpasses.No tests were added or re-baselined because the changes optimize internal storage and expression evaluation without changing expected results. Existing conversion and module tests exercise the affected behavior.
Documentation
No module input/output documentation or user-facing configuration was invalidated.
Inline comments describing row-major and column-major conversions were updated for the new implementations. A release-note snippet documents the reduction in Eigen heap allocation across the affected utilities and modules.
Future work
No required follow-up is anticipated.