Skip to content

Commit 77008c0

Browse files
authored
Merge pull request #1198 from borglab/release/4.2a7
2 parents 468f903 + 30412b8 commit 77008c0

File tree

293 files changed

+18751
-6310
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+18751
-6310
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@
1717
# for QtCreator:
1818
CMakeLists.txt.user*
1919
xcode/
20+
/Dockerfile
21+
/python/gtsam/notebooks/.ipynb_checkpoints/ellipses-checkpoint.ipynb

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endif()
1010
set (GTSAM_VERSION_MAJOR 4)
1111
set (GTSAM_VERSION_MINOR 2)
1212
set (GTSAM_VERSION_PATCH 0)
13-
set (GTSAM_PRERELEASE_VERSION "a6")
13+
set (GTSAM_PRERELEASE_VERSION "a7")
1414
math (EXPR GTSAM_VERSION_NUMERIC "10000 * ${GTSAM_VERSION_MAJOR} + 100 * ${GTSAM_VERSION_MINOR} + ${GTSAM_VERSION_PATCH}")
1515

1616
if (${GTSAM_VERSION_PATCH} EQUAL 0)

cmake/HandlePython.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ if(GTSAM_BUILD_PYTHON OR GTSAM_INSTALL_MATLAB_TOOLBOX)
1616

1717
set(Python_VERSION_MAJOR ${PYTHON_VERSION_MAJOR})
1818
set(Python_VERSION_MINOR ${PYTHON_VERSION_MINOR})
19+
set(Python_VERSION_PATCH ${PYTHON_VERSION_PATCH})
1920
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
2021

2122
else()
@@ -31,11 +32,12 @@ if(GTSAM_BUILD_PYTHON OR GTSAM_INSTALL_MATLAB_TOOLBOX)
3132

3233
set(Python_VERSION_MAJOR ${Python3_VERSION_MAJOR})
3334
set(Python_VERSION_MINOR ${Python3_VERSION_MINOR})
35+
set(Python_VERSION_PATCH ${Python3_VERSION_PATCH})
3436

3537
endif()
3638

3739
set(GTSAM_PYTHON_VERSION
38-
"${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}"
40+
"${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}.${Python_VERSION_PATCH}"
3941
CACHE STRING "The version of Python to build the wrappers against."
4042
FORCE)
4143

gtsam/base/OptionalJacobian.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#pragma once
2121
#include <gtsam/config.h> // Configuration from CMake
2222
#include <Eigen/Dense>
23+
#include <stdexcept>
24+
#include <string>
2325

2426
#ifndef OPTIONALJACOBIAN_NOBOOST
2527
#include <boost/optional.hpp>
@@ -96,6 +98,24 @@ class OptionalJacobian {
9698
usurp(dynamic->data());
9799
}
98100

101+
/**
102+
* @brief Constructor from an Eigen::Ref *value*. Will not usurp if dimension is wrong
103+
* @note This is important so we don't overwrite someone else's memory!
104+
*/
105+
template<class MATRIX>
106+
OptionalJacobian(Eigen::Ref<MATRIX> dynamic_ref) :
107+
map_(nullptr) {
108+
if (dynamic_ref.rows() == Rows && dynamic_ref.cols() == Cols && !dynamic_ref.IsRowMajor) {
109+
usurp(dynamic_ref.data());
110+
} else {
111+
throw std::invalid_argument(
112+
std::string("OptionalJacobian called with wrong dimensions or "
113+
"storage order.\n"
114+
"Expected: ") +
115+
"(" + std::to_string(Rows) + ", " + std::to_string(Cols) + ")");
116+
}
117+
}
118+
99119
#ifndef OPTIONALJACOBIAN_NOBOOST
100120

101121
/// Constructor with boost::none just makes empty

gtsam/discrete/AlgebraicDecisionTree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ namespace gtsam {
160160
const typename Base::LabelFormatter& labelFormatter =
161161
&DefaultFormatter) const {
162162
auto valueFormatter = [](const double& v) {
163-
return (boost::format("%4.4g") % v).str();
163+
return (boost::format("%4.8g") % v).str();
164164
};
165165
Base::print(s, labelFormatter, valueFormatter);
166166
}

0 commit comments

Comments
 (0)