mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Removing using std::...
Change-Id: I584402e2a34869183c1d59071a15d97b216c52fb
This commit is contained in:
@@ -54,11 +54,6 @@
|
||||
|
||||
namespace ceres::internal {
|
||||
|
||||
using std::abs;
|
||||
using std::max;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
namespace {
|
||||
|
||||
class GradientCheckingCostFunction final : public CostFunction {
|
||||
@@ -67,7 +62,7 @@ class GradientCheckingCostFunction final : public CostFunction {
|
||||
const std::vector<const Manifold*>* manifolds,
|
||||
const NumericDiffOptions& options,
|
||||
double relative_precision,
|
||||
string extra_info,
|
||||
std::string extra_info,
|
||||
GradientCheckingIterationCallback* callback)
|
||||
: function_(function),
|
||||
gradient_checker_(function, manifolds, options),
|
||||
@@ -75,7 +70,7 @@ class GradientCheckingCostFunction final : public CostFunction {
|
||||
extra_info_(std::move(extra_info)),
|
||||
callback_(callback) {
|
||||
CHECK(callback_ != nullptr);
|
||||
const vector<int32_t>& parameter_block_sizes =
|
||||
const std::vector<int32_t>& parameter_block_sizes =
|
||||
function->parameter_block_sizes();
|
||||
*mutable_parameter_block_sizes() = parameter_block_sizes;
|
||||
set_num_residuals(function->num_residuals());
|
||||
@@ -104,7 +99,7 @@ class GradientCheckingCostFunction final : public CostFunction {
|
||||
MatrixRef(residuals, num_residuals, 1) = results.residuals;
|
||||
|
||||
// Copy the original jacobian blocks into the jacobians array.
|
||||
const vector<int32_t>& block_sizes = function_->parameter_block_sizes();
|
||||
const std::vector<int32_t>& block_sizes = function_->parameter_block_sizes();
|
||||
for (int k = 0; k < block_sizes.size(); k++) {
|
||||
if (jacobians[k] != nullptr) {
|
||||
MatrixRef(jacobians[k],
|
||||
@@ -126,7 +121,7 @@ class GradientCheckingCostFunction final : public CostFunction {
|
||||
const CostFunction* function_;
|
||||
GradientChecker gradient_checker_;
|
||||
double relative_precision_;
|
||||
string extra_info_;
|
||||
std::string extra_info_;
|
||||
GradientCheckingIterationCallback* callback_;
|
||||
};
|
||||
|
||||
@@ -197,7 +192,7 @@ std::unique_ptr<ProblemImpl> CreateGradientCheckingProblemImpl(
|
||||
|
||||
// For every ParameterBlock in problem_impl, create a new parameter block with
|
||||
// the same manifold and constancy.
|
||||
const vector<ParameterBlock*>& parameter_blocks = program->parameter_blocks();
|
||||
const std::vector<ParameterBlock*>& parameter_blocks = program->parameter_blocks();
|
||||
for (auto* parameter_block : parameter_blocks) {
|
||||
gradient_checking_problem_impl->AddParameterBlock(
|
||||
parameter_block->mutable_user_state(),
|
||||
@@ -224,17 +219,17 @@ std::unique_ptr<ProblemImpl> CreateGradientCheckingProblemImpl(
|
||||
// For every ResidualBlock in problem_impl, create a new
|
||||
// ResidualBlock by wrapping its CostFunction inside a
|
||||
// GradientCheckingCostFunction.
|
||||
const vector<ResidualBlock*>& residual_blocks = program->residual_blocks();
|
||||
const std::vector<ResidualBlock*>& residual_blocks = program->residual_blocks();
|
||||
for (int i = 0; i < residual_blocks.size(); ++i) {
|
||||
ResidualBlock* residual_block = residual_blocks[i];
|
||||
|
||||
// Build a human readable string which identifies the
|
||||
// ResidualBlock. This is used by the GradientCheckingCostFunction
|
||||
// when logging debugging information.
|
||||
string extra_info =
|
||||
std::string extra_info =
|
||||
StringPrintf("Residual block id %d; depends on parameters [", i);
|
||||
vector<double*> parameter_blocks;
|
||||
vector<const Manifold*> manifolds;
|
||||
std::vector<double*> parameter_blocks;
|
||||
std::vector<const Manifold*> manifolds;
|
||||
parameter_blocks.reserve(residual_block->NumParameterBlocks());
|
||||
manifolds.reserve(residual_block->NumParameterBlocks());
|
||||
for (int j = 0; j < residual_block->NumParameterBlocks(); ++j) {
|
||||
|
||||
Reference in New Issue
Block a user