mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
Replace scoped_ptr with C++11's unique_ptr
Change-Id: Ib5a504c491e3a79af52a95accf009df473470c6b
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <numeric>
|
||||
#include <sstream>
|
||||
#include <unordered_set>
|
||||
@@ -337,7 +338,7 @@ bool CovarianceImpl::GetCovarianceMatrixInTangentOrAmbientSpace(
|
||||
// Assemble the blocks in the covariance matrix.
|
||||
MatrixRef covariance(covariance_matrix, covariance_size, covariance_size);
|
||||
const int num_threads = options_.num_threads;
|
||||
scoped_array<double> workspace(
|
||||
std::unique_ptr<double[]> workspace(
|
||||
new double[num_threads * max_covariance_block_size *
|
||||
max_covariance_block_size]);
|
||||
|
||||
@@ -706,7 +707,7 @@ bool CovarianceImpl::ComputeCovarianceValuesUsingSuiteSparseQR() {
|
||||
// Since the covariance matrix is symmetric, the i^th row and column
|
||||
// are equal.
|
||||
const int num_threads = options_.num_threads;
|
||||
scoped_array<double> workspace(new double[num_threads * num_cols]);
|
||||
std::unique_ptr<double[]> workspace(new double[num_threads * num_cols]);
|
||||
|
||||
#if !(defined(CERES_USE_TBB) || defined(CERES_USE_CXX11_THREADS))
|
||||
ThreadTokenProvider thread_token_provider(num_threads);
|
||||
@@ -915,7 +916,7 @@ bool CovarianceImpl::ComputeCovarianceValuesUsingEigenSparseQR() {
|
||||
// are equal.
|
||||
const int num_cols = jacobian.num_cols;
|
||||
const int num_threads = options_.num_threads;
|
||||
scoped_array<double> workspace(new double[num_threads * num_cols]);
|
||||
std::unique_ptr<double[]> workspace(new double[num_threads * num_cols]);
|
||||
|
||||
#if !(defined(CERES_USE_TBB) || defined(CERES_USE_CXX11_THREADS))
|
||||
ThreadTokenProvider thread_token_provider(num_threads);
|
||||
|
||||
Reference in New Issue
Block a user