Add the two-dimensional subspace search to DoglegStrategy

Change-Id: I5163744c100cdf07dd93343d0734ffe0e80364f3
diff --git a/examples/bundle_adjuster.cc b/examples/bundle_adjuster.cc
index 5173e79..68458a0 100644
--- a/examples/bundle_adjuster.cc
+++ b/examples/bundle_adjuster.cc
@@ -86,6 +86,7 @@
               "Options are: suitesparse and cxsparse");
 
 DEFINE_string(ordering_type, "schur", "Options are: schur, user, natural");
+DEFINE_string(dogleg_type, "traditional", "Options are: traditional, subspace");
 DEFINE_bool(use_block_amd, true, "Use a block oriented fill reducing "
             "ordering.");
 
@@ -255,6 +256,14 @@
     LOG(FATAL) << "Unknown trust region strategy: "
                << FLAGS_trust_region_strategy;
   }
+  if (FLAGS_dogleg_type == "traditional") {
+    options->dogleg_type = TRADITIONAL_DOGLEG;
+  } else if (FLAGS_dogleg_type == "subspace") {
+    options->dogleg_type = SUBSPACE_DOGLEG;
+  } else {
+    LOG(FATAL) << "Unknown dogleg type: "
+               << FLAGS_dogleg_type;
+  }
 }
 
 void SetSolverOptionsFromFlags(BALProblem* bal_problem,