| 80 | } |
| 81 | |
| 82 | class BM_ReprojErrorConstantPoint3DCostFunction : public benchmark::Fixture { |
| 83 | public: |
| 84 | void SetUp(::benchmark::State& state) { |
| 85 | cost_function.reset( |
| 86 | ReprojErrorConstantPoint3DCostFunctor<camera_model>::Create( |
| 87 | data.point2D, data.point3D)); |
| 88 | } |
| 89 | |
| 90 | ReprojErrorData data = CreateReprojErrorData(); |
| 91 | const double* parameters[3] = {data.cam_from_world.rotation().coeffs().data(), |
| 92 | data.cam_from_world.translation().data(), |
| 93 | data.camera_params.data()}; |
| 94 | double residuals[2]; |
| 95 | double jacobian_q[2 * 4]; |
| 96 | double jacobian_t[2 * 3]; |
| 97 | double jacobian_params[2 * camera_model::num_params]; |
| 98 | double* jacobians[3] = {jacobian_q, jacobian_t, jacobian_params}; |
| 99 | std::unique_ptr<ceres::CostFunction> cost_function; |
| 100 | }; |
| 101 | |
| 102 | BENCHMARK_F(BM_ReprojErrorConstantPoint3DCostFunction, Run) |
| 103 | (benchmark::State& state) { |
nothing calls this directly
no test coverage detected