From 252ad65ae0af4249bc089cd18aad4ab739b80d70 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 5 Jan 2021 18:15:00 +0100 Subject: Small clean-up. --- p-spin.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p-spin.hpp b/p-spin.hpp index a522aee..b90d80b 100644 --- a/p-spin.hpp +++ b/p-spin.hpp @@ -34,7 +34,7 @@ std::tuple WdW(const Tensor& J, const Vector& z) { Matrix hessian; std::tie(std::ignore, gradient, hessian) = hamGradHess(J, z); - Vector projectedGradient = (gradient - ((Scalar)(gradient.transpose() * z) / (double)z.size()) * z).conjugate(); + Vector projectedGradient = (gradient - ((gradient.transpose() * z) * z / (double)z.size())).conjugate(); double W = projectedGradient.cwiseAbs2().sum(); Vector dW = hessian * projectedGradient - ((z.transpose() * gradient) * projectedGradient + (z.transpose() * projectedGradient) * (gradient + hessian * z)) / (double)z.size(); -- cgit v1.2.3-70-g09d2