mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-30 00:50:37 +08:00
Replace scoped_ptr with C++11's unique_ptr
Change-Id: Ib5a504c491e3a79af52a95accf009df473470c6b
This commit is contained in:
@@ -31,7 +31,9 @@
|
||||
#include "ceres/program.h"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "ceres/array_utils.h"
|
||||
#include "ceres/casts.h"
|
||||
#include "ceres/compressed_row_sparse_matrix.h"
|
||||
@@ -274,7 +276,7 @@ Program* Program::CreateReducedProgram(
|
||||
CHECK_NOTNULL(fixed_cost);
|
||||
CHECK_NOTNULL(error);
|
||||
|
||||
scoped_ptr<Program> reduced_program(new Program(*this));
|
||||
std::unique_ptr<Program> reduced_program(new Program(*this));
|
||||
if (!reduced_program->RemoveFixedBlocks(removed_parameter_blocks,
|
||||
fixed_cost,
|
||||
error)) {
|
||||
@@ -292,7 +294,7 @@ bool Program::RemoveFixedBlocks(vector<double*>* removed_parameter_blocks,
|
||||
CHECK_NOTNULL(fixed_cost);
|
||||
CHECK_NOTNULL(error);
|
||||
|
||||
scoped_array<double> residual_block_evaluate_scratch;
|
||||
std::unique_ptr<double[]> residual_block_evaluate_scratch;
|
||||
residual_block_evaluate_scratch.reset(
|
||||
new double[MaxScratchDoublesNeededForEvaluate()]);
|
||||
*fixed_cost = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user