summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2020-12-29 13:47:11 +0100
committerJaron Kent-Dobias <jaron@kent-dobias.com>2020-12-29 13:47:11 +0100
commit5698efde2e8bb86571dcf72d97ca4d702106b394 (patch)
treeac77e520fff4320baeed7475aeebbce2189f9de8
parenta63b07dc5f3ce1c670d28cad6a9e50693fac2248 (diff)
downloadcode-5698efde2e8bb86571dcf72d97ca4d702106b394.tar.gz
code-5698efde2e8bb86571dcf72d97ca4d702106b394.tar.bz2
code-5698efde2e8bb86571dcf72d97ca4d702106b394.zip
Nicer variable names in gradHess function.
-rw-r--r--langevin.cpp6
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> ε) {