| 28 | } |
| 29 | |
| 30 | class BM_ReprojErrorCostFunction : public benchmark::Fixture { |
| 31 | public: |
| 32 | void SetUp(::benchmark::State& state) { |
| 33 | cost_function.reset( |
| 34 | ReprojErrorCostFunctor<camera_model>::Create(data.point2D)); |
| 35 | } |
| 36 | |
| 37 | ReprojErrorData data = CreateReprojErrorData(); |
| 38 | const double* parameters[4] = {data.cam_from_world.rotation().coeffs().data(), |
| 39 | data.cam_from_world.translation().data(), |
| 40 | data.point3D.data(), |
| 41 | data.camera_params.data()}; |
| 42 | double residuals[2]; |
| 43 | double jacobian_q[2 * 4]; |
| 44 | double jacobian_t[2 * 3]; |
| 45 | double jacobian_p[2 * 3]; |
| 46 | double jacobian_params[2 * camera_model::num_params]; |
| 47 | double* jacobians[4] = {jacobian_q, jacobian_t, jacobian_p, jacobian_params}; |
| 48 | std::unique_ptr<ceres::CostFunction> cost_function; |
| 49 | }; |
| 50 | |
| 51 | BENCHMARK_F(BM_ReprojErrorCostFunction, Run)(benchmark::State& state) { |
| 52 | for (auto _ : state) { |
nothing calls this directly
no test coverage detected