diff options
-rw-r--r-- | langevin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/langevin.cpp b/langevin.cpp index 3e03f76..f29cd25 100644 --- a/langevin.cpp +++ b/langevin.cpp @@ -105,12 +105,12 @@ Matrix identity(unsigned N) { std::tuple<Vector, Matrix> gradHess(const Tensor& J, const Vector& z, std::complex<double> ε) { Matrix J1 = z.contract(J, ip); - Matrix H = ((p - 1) * (double)p / factorial(p)) * J1 - ((double)p * ε) * identity(z.size()); + Matrix hess = ((p - 1) * (double)p / factorial(p)) * J1 - ((double)p * ε) * identity(z.size()); Vector J2 = z.contract(J1, ip); - Vector g = ((double)p / factorial(p)) * J2 - ((double)p * ε) * z; + Vector grad = ((double)p / factorial(p)) * J2 - ((double)p * ε) * z; - return {g, H}; + return {grad, hess}; } std::tuple<double, Vector, std::complex<double>, Vector> WdW(const Tensor& J, const Vector& z, std::complex<double> ε) { |