Extend support writing linear least squares problems to disk.
1. Make the mechanism for writing problems to disk, generic and
controllable using an enum DumpType visible in the API.
2. Instead of single file containing protocol buffers, now matrices can
be written in a matlab/octave friendly format. This is now the default.
3. The support for writing problems to disk is moved into
linear_least_squares_problem.cc/h
4. SparseMatrix now has a ToTextFile virtual method which is
implemented by each of its subclasses to write a (i,j,s) triplets.
5. Minor changes to simple_bundle_adjuster to enable logging at startup.
diff --git a/include/ceres/solver.h b/include/ceres/solver.h
index 15fd733..bd66927 100644
--- a/include/ceres/solver.h
+++ b/include/ceres/solver.h
@@ -83,7 +83,8 @@
minimizer_progress_to_stdout = false;
return_initial_residuals = false;
return_final_residuals = false;
- lsqp_dump_format = "lm_iteration_%03d.lsqp";
+ lsqp_dump_directory = "/tmp";
+ lsqp_dump_format_type = TEXTFILE;
crash_and_dump_lsqp_on_failure = false;
check_gradients = false;
gradient_check_relative_precision = 1e-8;
@@ -213,12 +214,8 @@
//
// This is ignored if protocol buffers are disabled.
vector<int> lsqp_iterations_to_dump;
-
- // Format string for the file name used for dumping the least
- // squares problem to disk. If the format is 'ascii', then the
- // problem is logged to the screen; don't try this with large
- // problems or expect a frozen terminal.
- string lsqp_dump_format;
+ string lsqp_dump_directory;
+ DumpFormatType lsqp_dump_format_type;
// Dump the linear least squares problem to disk if the minimizer
// fails due to NUMERICAL_FAILURE and crash the process. This flag