-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SymForce] Reduce # of public Linearizer methods
This is in support of adding a dense optimizer implementation to symforce. Since the Linearizer class is responsible for knowing how to transfer the outputs of the Factor linearization functions into the problem linearization, a process which depends intextricably on the representation of the linearization (whether its sparse or dense), a dense optimizer would require a different linearizer than the `Linearizer` class already present. Thus, the simpler the public api of the linearizer classes, the easier it is to swap out one for another. This PR removes 2 methods from the `Linearizer` class: - `CheckKeysAreContiguousAtStart`, whose implementation depends only on the `Keys()` and `StateIndex()` (which are already public), which it moves to the Optimizer because that is the only place it is used. - `SplitCovariancesByKey`, which it moves to the covariance_utils.h **Other notes** I thought the implementation of `CheckKeysAreContiguousAtStart could be rewritten to be easier to understand, so I did so in the first commit (after this one). In the second commit, I actually moved it out of `Linearizer` class and split it into two functions: `CheckKeyOrderMatchesLinearizerKeysStart` and `ComputeBlockDimension`. In the third commit, I just moved `SplitCovariancesByKey` out of the `Linearizer` class with only light modification (on account of the fact that it was being made a function from a method). Topic: reduce_surface_area_of_linearizer GitOrigin-RevId: 34cc5b3a2ba3b88eb041c3430efbc84f255a3f9a
- Loading branch information
1 parent
978ea34
commit 0abeb62
Showing
5 changed files
with
93 additions
and
92 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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