Add the two-dimensional subspace search to DoglegStrategy

Change-Id: I5163744c100cdf07dd93343d0734ffe0e80364f3
diff --git a/include/ceres/solver.h b/include/ceres/solver.h
index ef6c617..16c7387 100644
--- a/include/ceres/solver.h
+++ b/include/ceres/solver.h
@@ -58,6 +58,7 @@
     // Default constructor that sets up a generic sparse problem.
     Options() {
       trust_region_strategy_type = LEVENBERG_MARQUARDT;
+      dogleg_type = TRADITIONAL_DOGLEG;
       use_nonmonotonic_steps = false;
       max_consecutive_nonmonotonic_steps = 5;
       max_num_iterations = 50;
@@ -121,6 +122,9 @@
 
     TrustRegionStrategyType trust_region_strategy_type;
 
+    // Type of dogleg strategy to use.
+    DoglegType dogleg_type;
+
     // The classical trust region methods are descent methods, in that
     // they only accept a point if it strictly reduces the value of
     // the objective function.
diff --git a/include/ceres/types.h b/include/ceres/types.h
index d6474cc..3980885 100644
--- a/include/ceres/types.h
+++ b/include/ceres/types.h
@@ -187,6 +187,24 @@
   DOGLEG
 };
 
+// Ceres supports two different dogleg strategies.
+// The "traditional" dogleg method by Powell and the
+// "subspace" method described in
+// R. H. Byrd, R. B. Schnabel, and G. A. Shultz,
+// "Approximate solution of the trust region problem by minimization
+//  over two-dimensional subspaces", Mathematical Programming,
+// 40 (1988), pp. 247--263
+enum DoglegType {
+  // The traditional approach constructs a dogleg path
+  // consisting of two line segments and finds the furthest
+  // point on that path that is still inside the trust region.
+  TRADITIONAL_DOGLEG,
+
+  // The subspace approach finds the exact minimum of the model
+  // constrained to the subspace spanned by the dogleg path.
+  SUBSPACE_DOGLEG
+};
+
 enum SolverTerminationType {
   // The minimizer did not run at all; usually due to errors in the user's
   // Problem or the solver options.