-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kartik/typedef optional references #1
base: develop
Are you sure you want to change the base?
Conversation
a8d0fd2
to
138781a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to submit my comments :-(
@@ -6,6 +6,8 @@ if(NOT DEFINED CMAKE_MACOSX_RPATH) | |||
set(CMAKE_MACOSX_RPATH 0) | |||
endif() | |||
|
|||
set(CMAKE_CXX_STANDARD 17) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not do this somewhere else for c++11?
gtsam/base/OptionalJacobian.h
Outdated
map_(nullptr) { | ||
dynamic->resize(Rows, Cols); // no malloc if correct size | ||
usurp(dynamic->data()); | ||
OptionalJacobian(Eigen::MatrixXd* dynamic) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo reformat (noise in PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not formatting noise. I added a check to see if dynamic is not nullptr.
boost::optional<Matrix&> H1 = boost::none, | ||
boost::optional<Matrix&> H2 = boost::none) const | ||
{ | ||
OptionalMatrixType H1 = OptionalNone, OptionalMatrixType H2 = OptionalNone) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no using Base
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an expression factor. It doesn’t inherit from noisemodelfactorN
c0ef53b
to
0455c2e
Compare
…trix refererences
1b299f3
to
f95e445
Compare
Overview
This PR is part of a push to upgrade GTSAM to C++17, and remove boost dependencies from GTSAM. In this PR we want to update our factor interfaces and the factor implementations that use arguments of the type boost::optional<A&> to raw pointers of the type A*. We wish to do that because the semantics of raw pointers are the same as that of an optional to a reference. This is in accordance to google style guide’s recommendation for function input parameters, link here.
Details
Retaining
evaluateError
interface to accept both pointers and matricesThis was achieved by some templating and conditional compilation in
NoiseModelFactorN
class. A side-effect of this is that when a user inherits NoiseModelFactorN and implements it, they have to do something like this-using Base::evaluateError;
for all of the evaluateError overloads to be visible for the end user.Replacing std::binds with lambdas
std::bind had a problem inferring which evaluateError overload to use through template deduction. I replaced it with lambdas instead.
OptionalJacobian
I have replaced
boost::optional<Matrix&>
in functions whose, input argument sizes are known, with OptionalJacobians. This enables us to use that function with both pointers and l-value references of matrices.TODO
GeoGraphicLibs
and compile some tests that were excluded.boost::optional<Matrix&>
in the following lines of code after discussing with Frank:Pose3Upright.cpp
timePose2.cpp
(Deleted a test which looked like a copy paste to me)