Addressing comments from Jim Roseborough. Change-Id: I9f5bdb4a81cd25ee4ea5de65aeddcaa0c5d18197
diff --git a/internal/ceres/array_utils.h b/internal/ceres/array_utils.h index 55e68a8..7f56947 100644 --- a/internal/ceres/array_utils.h +++ b/internal/ceres/array_utils.h
@@ -67,12 +67,19 @@ extern const double kImpossibleValue; -// array contains a list of (possibly repeating) non-negative -// integers. Let us assume that we have constructed another array `p` -// by sorting and uniquing the entries of array. +// This routine takes an array of integer values, sorts and uniques +// them and then maps each value in the array to its position in the +// sorted+uniqued array. By doing this, if there are are k unique +// values in the array, each value is replaced by an integer in the +// range [0, k-1], while preserving their relative order. // -// MapValuesToContiguousRange replaces each entry in "array" with its -// position in `p`. +// For example +// +// [1 0 3 5 0 1 5] +// +// gets mapped to +// +// [1 0 2 3 0 1 3] void MapValuesToContiguousRange(int size, int* array); } // namespace internal
diff --git a/internal/ceres/solver.cc b/internal/ceres/solver.cc index eb578ad..39efb23 100644 --- a/internal/ceres/solver.cc +++ b/internal/ceres/solver.cc
@@ -43,6 +43,10 @@ namespace ceres { namespace { +// TODO(sameeragarwal): These macros are not terribly informative when +// things do crash. It would be nice to actually print the offending +// value. + #define OPTION_GT(x, y) \ if (options.x <= y) { \ *error = string("Invalid configuration. Violated constraint " \