Rework Expression creation and insertion

Objects of 'Expression' can now be freely created and copied around.
This creation does NOT add them to the active ExpressionGraph any
more. The insertion into the graph is now done by ExpressionRef,
which explicitly call graph.add(...) in each operation.

This change brings the following advantages:

1. 'Expression' is now stand-alone and side-effect free
   - Remove the dependency Expression->ExpressionGraph
   - Expressions can be created by the optimizer

2. Explicit graph insertion
  - Previously CreateCompileTimeConstant not only created an
    expression, but also inserted it into the active graph. Now
    this insertion is done explicitly by ExpressionRef

3. It is now easier to insert new types and members
  - Should be straight forward now, because we got rid of the
    3-way dependency
  - This is a preparation patch for the new return-type member in
    https://ceres-solver-review.googlesource.com/c/ceres-solver/+/16224

Change-Id: Icef2fe529a4db001a10d1fb6816c9dc681b14ff2
10 files changed
tree: 2c2efabd2faffef6f5e305f4700f2bb7adf7e025
  1. .clang-format
  2. .gitignore
  3. .travis.yml
  4. BUILD
  5. CMakeLists.txt
  6. CONTRIBUTING.md
  7. LICENSE
  8. README.md
  9. WORKSPACE
  10. bazel/
  11. cmake/
  12. config/
  13. data/
  14. docs/
  15. examples/
  16. include/
  17. internal/
  18. package.xml
  19. scripts/
  20. travis/
README.md

Build Status

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.