Fix a typo in sampled_function.cc Thanks to Pablo Speciale for reporting this. Change-Id: Icd526856f91dba98f7abf86b098b210a89556445
diff --git a/examples/sampled_function.cc b/examples/sampled_function.cc index 700ef6d..44566f4 100644 --- a/examples/sampled_function.cc +++ b/examples/sampled_function.cc
@@ -68,7 +68,7 @@ // Evaluate the function f(x) = (x - 4.5)^2; const int kNumSamples = 10; double values[kNumSamples]; - for (int i = 0; i < 10; ++i) { + for (int i = 0; i < kNumSamples; ++i) { values[i] = (i - 4.5) * (i - 4.5); } @@ -84,5 +84,6 @@ Solver::Summary summary; Solve(options, &problem, &summary); std::cout << summary.BriefReport() << "\n"; + std::cout << "Expected x: 4.5. Actual x : " << x << std::endl; return 0; }