Preserve caller orderings during preprocessing

Trust-region preprocessing removes constant blocks from parameter
orderings. Solver::Options copies share these objects. Removal therefore
changes the caller's ordering, and a later Solve can reject it.

Copy supplied linear solver and inner iteration orderings before
preprocessing mutates them. Keep automatic ordering creation unchanged.

Add public Solve tests for both supplied orderings. The linear solver
test makes a constant block variable between calls. The inner iteration
test checks caller group membership after both calls.

Tests: focused regressions 2/2 and affected CTest targets 3/3.
Full build passed. Full CTest passed 139/191; 52 bundle tests could
not find source data from the out-of-tree build. Each of those 52 tests
passed with TEST_SRCDIR set to internal/ceres within the checkout.
Tested on arm64 macOS with Apple Clang 21.0.0.

Issue: https://github.com/ceres-solver/ceres-solver/issues/836

Codex used.

Change-Id: Ia0df3722c0905715cf37677621933040d18c1fa6
2 files changed
tree: 39000b66bf86ae20d8a6a0804598e8662e325ebd
  1. .github/
  2. bazel/
  3. cmake/
  4. config/
  5. data/
  6. docs/
  7. examples/
  8. include/
  9. internal/
  10. scripts/
  11. third_party/
  12. .clang-format
  13. .gitignore
  14. .gitmodules
  15. .readthedocs.yaml
  16. BUILD
  17. CITATION.cff
  18. CMakeLists.txt
  19. CONTRIBUTING.md
  20. LICENSE
  21. MODULE.bazel
  22. package.xml
  23. README.md
  24. WORKSPACE
README.md

Android Linux macOS Windows

Ceres Solver

Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.

  1. Non-linear Least Squares problems with bounds constraints.
  2. General unconstrained optimization problems.

Please see ceres-solver.org for more information.