From 5d7adc21c13d27c68ab8eadfa6add962a015a4b8 Mon Sep 17 00:00:00 2001 From: david-dg Date: Sun, 12 Nov 2017 10:28:54 +0100 Subject: [PATCH] variable name x changed to nz variable x is not defined, the result of gradient_descent() is stored in nz --- c++11/gradient_descent_nice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++11/gradient_descent_nice.cpp b/c++11/gradient_descent_nice.cpp index c345185..50356c0 100644 --- a/c++11/gradient_descent_nice.cpp +++ b/c++11/gradient_descent_nice.cpp @@ -39,7 +39,7 @@ int main (int argc, char* argv[]) cdouble z(-6, 1); auto nz= gradient_descent(z, 0.05, 0.001, f, g); - cout << "Found local minimum at (" << real(x)<< ", " << imag(x) << ")\n"; + cout << "Found local minimum at (" << real(nz)<< ", " << imag(nz) << ")\n"; return 0; }