From 2175d025a61089d483dee3cbe8127b17aafbbeb2 Mon Sep 17 00:00:00 2001 From: Sameer Agarwal Date: Mon, 27 Apr 2015 06:54:12 -0700 Subject: [PATCH] Make the robust curve fitting example robust. Change-Id: Iffcde8f168b7cd68e56f351c43088d7aef1e5e2f --- examples/robust_curve_fitting.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/robust_curve_fitting.cc b/examples/robust_curve_fitting.cc index 65da4e587..67aca033e 100644 --- a/examples/robust_curve_fitting.cc +++ b/examples/robust_curve_fitting.cc @@ -147,7 +147,9 @@ int main(int argc, char** argv) { CostFunction* cost_function = new AutoDiffCostFunction( new ExponentialResidual(data[2 * i], data[2 * i + 1])); - problem.AddResidualBlock(cost_function, NULL, &m, &c); + problem.AddResidualBlock(cost_function, + new CauchyLoss(0.5), + &m, &c); } Solver::Options options;