-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add diagonal & isotropic sqrt_infos in geo factors
<NOTE> A core premise of this PR has turned out to be flawed. The idea was that we can overload the factors by the type of sqrt_info, but that only works if we actually call the factors with normal arguments, which isn't the normal use case. Rather, what the user would ordinarily do is pass the function pointer to a `sym::Factor` object, at which point it is impossible to disambiguate which overload is desired. Instead you would have to use a static_cast or something (which would be unpleasant as typing out the exact signature would be a pain). Now, the motivation to reduce op counts by taking advantage of simpler sqrt_infos is still present and valid, but will need to rethink where these variants will be located and what they will be named </NOTE> Often times the square root information matrix is a diagonal or isotropic matrix. However, in our generated geo factors we always assume they are full dense matrices leading to many more operations than needed. This commit modifies `geo_factors_codegen.py` to create 3 variants for each geo factor, one which assumes `sqrt_info` is a square matrix (the existing behavior), one which assumes it is a diagonal matrix, and one which assumes it is an isotropic matrix. These variants are all generated with the same name & are distinguished only by their signatures (thus this only works for C++, which is all we currently generate factors for anyway). The square version takes a square eigen matrix, the diagonal version a eigen vector whose entries are those of the diagonal of `sqrt_info`, and a single scalar for the isotropic version. The header that the user imports remains the same, except now rather than containing the implementation directly, it re-imports the headers for the 3 different versions (which are stores in sub-directories). Topic: sqrt_info_variants Relative: geo_factors_use_skip_directory_nesting
- Loading branch information
1 parent
f9a6f2d
commit 33be801
Showing
1 changed file
with
201 additions
and
26 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