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:
Mike Vitus
2018-02-22 10:28:39 -08:00
parent f217ccfb69
commit f408f89e8b
43 changed files with 458 additions and 85 deletions
+2
View File
@@ -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);