From 2ca13dd45a5a99e6677149ad4020c03e0e63d646 Mon Sep 17 00:00:00 2001 From: Krishna Vedala <7001608+kvedala@users.noreply.github.com> Date: Fri, 10 Jul 2020 22:16:14 -0400 Subject: [PATCH] Revert "test commit" This reverts commit dc6f32297567a9888eeb8ed24d26ded0ce5d1f43. --- numerical_methods/brent_method_extrema.cpp | 5 +++-- numerical_methods/durand_kerner_roots.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/numerical_methods/brent_method_extrema.cpp b/numerical_methods/brent_method_extrema.cpp index 399be5b38..654a69451 100644 --- a/numerical_methods/brent_method_extrema.cpp +++ b/numerical_methods/brent_method_extrema.cpp @@ -180,13 +180,14 @@ void test2() { } /** - * @brief Test function to find *minima* for the function + * @brief Test function to find *maxima* for the function * \f$f(x)= \cos x\f$ * in the interval \f$[0,12]\f$ * \n Expected result: \f$\pi\approx 3.14159265358979312\f$ */ void test3() { - // define the function to minimize as a lambda function + // define the function to maximize as a lambda function + // since we are maximixing, we negated the function return value std::function func = [](double x) { return std::cos(x); }; std::cout << "Test 3.... "; diff --git a/numerical_methods/durand_kerner_roots.cpp b/numerical_methods/durand_kerner_roots.cpp index 23419d1ed..9bf0619b8 100644 --- a/numerical_methods/durand_kerner_roots.cpp +++ b/numerical_methods/durand_kerner_roots.cpp @@ -212,7 +212,7 @@ void test1() { std::complex(0., -2.) // known expected roots }; - /* Initialize root approximations with random values */ + /* initialize root approximations with random values */ for (int n = 0; n < roots.size(); n++) { roots[n] = std::complex(std::rand() % 100, std::rand() % 100); roots[n] -= 50.f;