mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-30 09:00:37 +08:00
Modernize include/ceres headers to C++17 and Abseil conventions
- include/ceres/autodiff_manifold.h: Replace manual zero-initialization loops with value-initialization ({}) in PlusJacobian and MinusJacobian.
- include/ceres/dynamic_numeric_diff_cost_function.h: Replace std::vector with absl::FixedArray for temporary evaluation buffers and use std::copy_n instead of memcpy in Evaluate.
- include/ceres/numeric_diff_cost_function.h: Replace memcpy with std::copy_n in Evaluate.
Change-Id: I13b546458185d9fdd22b086094ca1072c57c40ed
This commit is contained in:
@@ -160,6 +160,7 @@
|
||||
#ifndef CERES_PUBLIC_NUMERIC_DIFF_COST_FUNCTION_H_
|
||||
#define CERES_PUBLIC_NUMERIC_DIFF_COST_FUNCTION_H_
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
@@ -261,9 +262,9 @@ class NumericDiffCostFunction final
|
||||
ParameterDims::GetUnpackedParameters(parameters_copy.data());
|
||||
|
||||
for (int block = 0; block < kNumParameterBlocks; ++block) {
|
||||
memcpy(parameters_reference_copy[block],
|
||||
parameters[block],
|
||||
sizeof(double) * ParameterDims::GetDim(block));
|
||||
std::copy_n(parameters[block],
|
||||
ParameterDims::GetDim(block),
|
||||
parameters_reference_copy[block]);
|
||||
}
|
||||
|
||||
internal::EvaluateJacobianForParameterBlocks<kMethod,
|
||||
|
||||
Reference in New Issue
Block a user