mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-30 09:00:37 +08:00
GradientProblem & related classes use std::unique_ptr
Previously these classes in analogy with ceres::Problem's interface had interfaces to allow bare pointers as well as unique_ptrs. This CL changes the API to always use unique_ptr, this is less error prone and makes the default ownership semantics clearer. Change-Id: I7577a90761f341c7e009c248c820f0fec2e6f32d
This commit is contained in:
@@ -52,8 +52,7 @@ class QuadraticCostFunctor {
|
||||
|
||||
TEST(NumericDiffFirstOrderFunction, BilinearDifferentiationTestStatic) {
|
||||
auto function = std::make_unique<
|
||||
NumericDiffFirstOrderFunction<QuadraticCostFunctor, CENTRAL, 4>>(
|
||||
new QuadraticCostFunctor(1.0));
|
||||
NumericDiffFirstOrderFunction<QuadraticCostFunctor, CENTRAL, 4>>(1.0);
|
||||
|
||||
double parameters[4] = {1.0, 2.0, 3.0, 4.0};
|
||||
double gradient[4];
|
||||
@@ -77,7 +76,7 @@ TEST(NumericDiffFirstOrderFunction, BilinearDifferentiationTestStatic) {
|
||||
TEST(NumericDiffFirstOrderFunction, BilinearDifferentiationTestDynamic) {
|
||||
auto function = std::make_unique<
|
||||
NumericDiffFirstOrderFunction<QuadraticCostFunctor, CENTRAL>>(
|
||||
new QuadraticCostFunctor(1.0), 4);
|
||||
std::make_unique<QuadraticCostFunctor>(1.0), 4);
|
||||
|
||||
double parameters[4] = {1.0, 2.0, 3.0, 4.0};
|
||||
double gradient[4];
|
||||
|
||||
Reference in New Issue
Block a user