mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
Adds a Ceres Context structure.
A Ceres Context holds common global state that can be re-used within Ceres. The Context current contains a thread pool if compiling with C++11 threading support. Threads are expensive to create and destroy so it is good to maintain across multiple Ceres solves. Tested by compiling with and without TBB support and ran unit tests. Ran bazel as well. Change-Id: I82f598dfae642aa0e81a6039dc174608a5e8dbfb
This commit is contained in:
@@ -71,6 +71,8 @@ LinearSolverType LinearSolver::LinearSolverForZeroEBlocks(
|
||||
}
|
||||
|
||||
LinearSolver* LinearSolver::Create(const LinearSolver::Options& options) {
|
||||
CHECK(options.context != NULL);
|
||||
|
||||
switch (options.type) {
|
||||
case CGNR:
|
||||
return new CgnrSolver(options);
|
||||
|
||||
Reference in New Issue
Block a user