add <pybind/stl.h> and fix constructor argument order

release/4.3a0
Gerry Chen 2021-08-27 11:23:38 -04:00
parent 15120ce9ab
commit b99bf4e929
2 changed files with 3 additions and 1 deletions

View File

@ -10,3 +10,5 @@
* Without this they will be automatically converted to a Python object, and all * Without this they will be automatically converted to a Python object, and all
* mutations on Python side will not be reflected on C++. * mutations on Python side will not be reflected on C++.
*/ */
#include <pybind11/stl.h>

View File

@ -25,7 +25,7 @@ class TestBasis(GtsamTestCase):
noise = gtsam.noiseModel.Unit.Create(1) noise = gtsam.noiseModel.Unit.Create(1)
def testBasis(fitter, basis, f=f): def testBasis(fitter, basis, f=f):
data = {x: f(x) for x in datax} data = {x: f(x) for x in datax}
fit = fitter(N, data, noise) fit = fitter(data, noise, N)
coeff = fit.parameters() coeff = fit.parameters()
interpy = basis.WeightMatrix(N, interpx) @ coeff interpy = basis.WeightMatrix(N, interpx) @ coeff
np.testing.assert_almost_equal(interpy, np.array([f(x) for x in interpx]), decimal=7) np.testing.assert_almost_equal(interpy, np.array([f(x) for x in interpx]), decimal=7)