Add comment on functor signature

release/4.3a0
Fan Jiang 2021-05-17 14:40:17 -04:00
parent 66e397cb38
commit 4708d7ad0e
1 changed files with 8 additions and 0 deletions

View File

@ -27,6 +27,14 @@ typedef std::vector<Matrix> JacobianVector;
class CustomFactor;
/*
* NOTE
* ==========
* pybind11 will invoke a copy if this is `JacobianVector &`, and modifications in Python will not be reflected.
*
* This is safe because this is passing a const pointer, and pybind11 will maintain the `std::vector` memory layout.
* Thus the pointer will never be invalidated.
*/
typedef std::function<Vector(const CustomFactor&, const Values&, const JacobianVector*)> CustomErrorFunction;
/**