From 8209ca60b99594f26f3e9b21ccdbc8695526eb93 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 5 Nov 2021 09:03:36 +0100 Subject: Work on Stokes lines, and new method involving parametric fits. --- dynamics.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'dynamics.hpp') diff --git a/dynamics.hpp b/dynamics.hpp index 10b1be2..561714e 100644 --- a/dynamics.hpp +++ b/dynamics.hpp @@ -113,3 +113,20 @@ std::tuple> metropolis(const Tensor& J, const Ve return {E, z}; } + +template +Vector randomSaddle(const Tensor& J, Distribution d, Generator& r, Real ε) { + Vector zSaddle; + bool foundSaddle = false; + + while (!foundSaddle) { + Vector z0 = normalize(randomVector(J.dimension(0), d, r.engine())); + + try { + zSaddle = findSaddle(J, z0, ε); + foundSaddle = true; + } catch (std::exception& e) {} + } + + return zSaddle; +} -- cgit v1.2.3-54-g00ecf