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:
Sameer Agarwal
2026-03-23 11:24:32 -07:00
parent ea4de24c2e
commit 2b9a2d77c3
3 changed files with 15 additions and 22 deletions
+4 -3
View File
@@ -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,