-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
break up preamble and specializations so there are no duplicate includes
- Loading branch information
1 parent
9bafebb
commit f33e6a8
Showing
22 changed files
with
304 additions
and
65 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `PYBIND11_MAKE_OPAQUE` will mark the type as "opaque" for the pybind11 | ||
* automatic STL binding, such that the raw objects can be accessed in Python. | ||
* Without this they will be automatically converted to a Python object, and all | ||
* mutations on Python side will not be reflected on C++. | ||
*/ | ||
|
||
PYBIND11_MAKE_OPAQUE(std::vector<gtsam::IndexPair>); | ||
|
||
PYBIND11_MAKE_OPAQUE(std::vector<gtsam::Matrix>); // JacobianVector |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `PYBIND11_MAKE_OPAQUE` will mark the type as "opaque" for the pybind11 | ||
* automatic STL binding, such that the raw objects can be accessed in Python. | ||
* Without this they will be automatically converted to a Python object, and all | ||
* mutations on Python side will not be reflected on C++. | ||
*/ | ||
|
||
PYBIND11_MAKE_OPAQUE( | ||
std::vector<gtsam::Point2, Eigen::aligned_allocator<gtsam::Point2>>); | ||
PYBIND11_MAKE_OPAQUE(gtsam::Point3Pairs); | ||
PYBIND11_MAKE_OPAQUE(gtsam::Pose3Pairs); | ||
PYBIND11_MAKE_OPAQUE(std::vector<gtsam::Pose3>); | ||
PYBIND11_MAKE_OPAQUE( | ||
gtsam::CameraSet<gtsam::PinholeCamera<gtsam::Cal3Bundler>>); | ||
PYBIND11_MAKE_OPAQUE(gtsam::CameraSet<gtsam::PinholeCamera<gtsam::Cal3_S2>>); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `PYBIND11_MAKE_OPAQUE` will mark the type as "opaque" for the pybind11 | ||
* automatic STL binding, such that the raw objects can be accessed in Python. | ||
* Without this they will be automatically converted to a Python object, and all | ||
* mutations on Python side will not be reflected on C++. | ||
*/ | ||
#ifdef GTSAM_ALLOCATOR_TBB | ||
PYBIND11_MAKE_OPAQUE(std::vector<gtsam::Key, tbb::tbb_allocator<gtsam::Key>>); | ||
#else | ||
PYBIND11_MAKE_OPAQUE(std::vector<gtsam::Key>); | ||
#endif |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `PYBIND11_MAKE_OPAQUE` will mark the type as "opaque" for the pybind11 | ||
* automatic STL binding, such that the raw objects can be accessed in Python. | ||
* Without this they will be automatically converted to a Python object, and all | ||
* mutations on Python side will not be reflected on C++. | ||
*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `PYBIND11_MAKE_OPAQUE` will mark the type as "opaque" for the pybind11 | ||
* automatic STL binding, such that the raw objects can be accessed in Python. | ||
* Without this they will be automatically converted to a Python object, and all | ||
* mutations on Python side will not be reflected on C++. | ||
*/ | ||
|
||
// TODO(fan): This is to fix the Argument-dependent lookup (ADL) of std::pair. | ||
// We should find a way to NOT do this. | ||
namespace std { | ||
using gtsam::operator<<; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `PYBIND11_MAKE_OPAQUE` will mark the type as "opaque" for the pybind11 | ||
* automatic STL binding, such that the raw objects can be accessed in Python. | ||
* Without this they will be automatically converted to a Python object, and all | ||
* mutations on Python side will not be reflected on C++. | ||
*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `PYBIND11_MAKE_OPAQUE` will mark the type as "opaque" for the pybind11 | ||
* automatic STL binding, such that the raw objects can be accessed in Python. | ||
* Without this they will be automatically converted to a Python object, and all | ||
* mutations on Python side will not be reflected on C++. | ||
*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `PYBIND11_MAKE_OPAQUE` will mark the type as "opaque" for the pybind11 | ||
* automatic STL binding, such that the raw objects can be accessed in Python. | ||
* Without this they will be automatically converted to a Python object, and all | ||
* mutations on Python side will not be reflected on C++. | ||
*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `PYBIND11_MAKE_OPAQUE` will mark the type as "opaque" for the pybind11 | ||
* automatic STL binding, such that the raw objects can be accessed in Python. | ||
* Without this they will be automatically converted to a Python object, and all | ||
* mutations on Python side will not be reflected on C++. | ||
*/ | ||
|
||
PYBIND11_MAKE_OPAQUE( | ||
std::vector<boost::shared_ptr<gtsam::BetweenFactor<gtsam::Pose3> > >); | ||
PYBIND11_MAKE_OPAQUE( | ||
std::vector<boost::shared_ptr<gtsam::BetweenFactor<gtsam::Pose2> > >); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `PYBIND11_MAKE_OPAQUE` will mark the type as "opaque" for the pybind11 | ||
* automatic STL binding, such that the raw objects can be accessed in Python. | ||
* Without this they will be automatically converted to a Python object, and all | ||
* mutations on Python side will not be reflected on C++. | ||
*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `py::bind_vector` and similar machinery gives the std container a Python-like | ||
* interface, but without the `<pybind11/stl.h>` copying mechanism. Combined | ||
* with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python, | ||
* and saves one copy operation. | ||
*/ | ||
|
||
py::bind_map<gtsam::IndexPairSetMap>(m_, "IndexPairSetMap"); | ||
py::bind_vector<gtsam::IndexPairVector>(m_, "IndexPairVector"); | ||
|
||
py::bind_vector<std::vector<gtsam::Matrix> >(m_, "JacobianVector"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `py::bind_vector` and similar machinery gives the std container a Python-like | ||
* interface, but without the `<pybind11/stl.h>` copying mechanism. Combined | ||
* with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python, | ||
* and saves one copy operation. | ||
*/ | ||
|
||
py::bind_vector< | ||
std::vector<gtsam::Point2, Eigen::aligned_allocator<gtsam::Point2>>>( | ||
m_, "Point2Vector"); | ||
py::bind_vector<std::vector<gtsam::Point3Pair>>(m_, "Point3Pairs"); | ||
py::bind_vector<std::vector<gtsam::Pose3Pair>>(m_, "Pose3Pairs"); | ||
py::bind_vector<std::vector<gtsam::Pose3>>(m_, "Pose3Vector"); | ||
py::bind_vector<gtsam::CameraSet<gtsam::PinholeCamera<gtsam::Cal3_S2>>>( | ||
m_, "CameraSetCal3_S2"); | ||
py::bind_vector<gtsam::CameraSet<gtsam::PinholeCamera<gtsam::Cal3Bundler>>>( | ||
m_, "CameraSetCal3Bundler"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `py::bind_vector` and similar machinery gives the std container a Python-like | ||
* interface, but without the `<pybind11/stl.h>` copying mechanism. Combined | ||
* with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python, | ||
* and saves one copy operation. | ||
*/ | ||
|
||
#ifdef GTSAM_ALLOCATOR_TBB | ||
py::bind_vector<std::vector<gtsam::Key, tbb::tbb_allocator<gtsam::Key> > >(m_, "KeyVector"); | ||
py::implicitly_convertible<py::list, std::vector<gtsam::Key, tbb::tbb_allocator<gtsam::Key> > >(); | ||
#else | ||
py::bind_vector<std::vector<gtsam::Key> >(m_, "KeyVector"); | ||
py::implicitly_convertible<py::list, std::vector<gtsam::Key> >(); | ||
#endif |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `py::bind_vector` and similar machinery gives the std container a Python-like | ||
* interface, but without the `<pybind11/stl.h>` copying mechanism. Combined | ||
* with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python, | ||
* and saves one copy operation. | ||
*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `py::bind_vector` and similar machinery gives the std container a Python-like | ||
* interface, but without the `<pybind11/stl.h>` copying mechanism. Combined | ||
* with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python, | ||
* and saves one copy operation. | ||
*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `py::bind_vector` and similar machinery gives the std container a Python-like | ||
* interface, but without the `<pybind11/stl.h>` copying mechanism. Combined | ||
* with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python, | ||
* and saves one copy operation. | ||
*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `py::bind_vector` and similar machinery gives the std container a Python-like | ||
* interface, but without the `<pybind11/stl.h>` copying mechanism. Combined | ||
* with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python, | ||
* and saves one copy operation. | ||
*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `py::bind_vector` and similar machinery gives the std container a Python-like | ||
* interface, but without the `<pybind11/stl.h>` copying mechanism. Combined | ||
* with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python, | ||
* and saves one copy operation. | ||
*/ | ||
|
||
py::bind_vector<std::vector<gtsam::BinaryMeasurement<gtsam::Unit3> > >( | ||
m_, "BinaryMeasurementsUnit3"); | ||
py::bind_map<gtsam::KeyPairDoubleMap>(m_, "KeyPairDoubleMap"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* Please refer to: | ||
* https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html | ||
* These are required to save one copy operation on Python calls. | ||
* | ||
* NOTES | ||
* ================= | ||
* | ||
* `py::bind_vector` and similar machinery gives the std container a Python-like | ||
* interface, but without the `<pybind11/stl.h>` copying mechanism. Combined | ||
* with `PYBIND11_MAKE_OPAQUE` this allows the types to be modified with Python, | ||
* and saves one copy operation. | ||
*/ | ||
|
||
py::bind_vector< | ||
std::vector<boost::shared_ptr<gtsam::BetweenFactor<gtsam::Pose3> > > >( | ||
m_, "BetweenFactorPose3s"); | ||
py::bind_vector< | ||
std::vector<boost::shared_ptr<gtsam::BetweenFactor<gtsam::Pose2> > > >( | ||
m_, "BetweenFactorPose2s"); |
Oops, something went wrong.