From 9f5c65e5cd2f9ac69848a30fc848511e7493eee3 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Mon, 22 Apr 2024 12:05:31 +0200 Subject: Reordered declarations. --- least_squares.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/least_squares.cpp b/least_squares.cpp index a4ee727..125557e 100644 --- a/least_squares.cpp +++ b/least_squares.cpp @@ -118,8 +118,8 @@ public: Vector gradientAscent(const QuadraticModel& M, const Vector& x₀, Real ε = 1e-13) { Vector xₜ = x₀; - Real α = 1; Real Hₜ = M.H(x₀); + Real α = 1; Real m; Vector ∇H; @@ -127,8 +127,8 @@ Vector gradientAscent(const QuadraticModel& M, const Vector& x₀, Real ε = 1e- ∇H = M.∇H(xₜ), m = ∇H.squaredNorm(), m / M.N > ε ) { - Real Hₜ₊₁; Vector xₜ₊₁; + Real Hₜ₊₁; while( xₜ₊₁ = normalize(xₜ + α * ∇H), Hₜ₊₁ = M.H(xₜ₊₁), -- cgit v1.2.3-70-g09d2