mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
ClangTidy cleanups
1. NULL -> nullptr 2. foo.reset(new Bar) -> = foo = std::make_unique<Bar>() 3. Missing std library includes & prefixes Change-Id: I260b261b484554be681ee5a7398126fdb3b3a789
This commit is contained in:
+13
-12
@@ -148,24 +148,25 @@ ceres_residual_block_id_t* ceres_problem_add_residual_block(
|
||||
double** parameters) {
|
||||
Problem* ceres_problem = reinterpret_cast<Problem*>(problem);
|
||||
|
||||
ceres::CostFunction* callback_cost_function =
|
||||
new CallbackCostFunction(cost_function,
|
||||
cost_function_data,
|
||||
num_residuals,
|
||||
num_parameter_blocks,
|
||||
parameter_block_sizes);
|
||||
auto callback_cost_function =
|
||||
std::make_unique<CallbackCostFunction>(cost_function,
|
||||
cost_function_data,
|
||||
num_residuals,
|
||||
num_parameter_blocks,
|
||||
parameter_block_sizes);
|
||||
|
||||
ceres::LossFunction* callback_loss_function = NULL;
|
||||
if (loss_function != NULL) {
|
||||
callback_loss_function =
|
||||
new CallbackLossFunction(loss_function, loss_function_data);
|
||||
std::unique_ptr<ceres::LossFunction> callback_loss_function;
|
||||
if (loss_function != nullptr) {
|
||||
callback_loss_function = std::make_unique<CallbackLossFunction>(
|
||||
loss_function, loss_function_data);
|
||||
}
|
||||
|
||||
std::vector<double*> parameter_blocks(parameters,
|
||||
parameters + num_parameter_blocks);
|
||||
return reinterpret_cast<ceres_residual_block_id_t*>(
|
||||
ceres_problem->AddResidualBlock(
|
||||
callback_cost_function, callback_loss_function, parameter_blocks));
|
||||
ceres_problem->AddResidualBlock(callback_cost_function.release(),
|
||||
callback_loss_function.release(),
|
||||
parameter_blocks));
|
||||
}
|
||||
|
||||
void ceres_solve(ceres_problem_t* c_problem) {
|
||||
|
||||
Reference in New Issue
Block a user