From 083e70179ca145d2650f16939ca4736592127afc Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 11 Jun 2019 16:38:31 +1200 Subject: [PATCH] added function to get the eigenvector corresponding to the lowest eigenvalue --- potential.cc | 12 ++++++++++++ potential.h | 1 + 2 files changed, 13 insertions(+) diff --git a/potential.cc b/potential.cc index ed8c1c6..24c799d 100644 --- a/potential.cc +++ b/potential.cc @@ -157,6 +157,18 @@ vector< vector > pairPotential::calcHessian (structure &S) return hessianMatrix; } +vector pairPotential::getLowestEvec (vector< pair< double,vector > > V) +{ + vector evec; + sort(V.begin(),V.end()); + for (auto& i : V) + { + cout << i.first << endl; + } + evec = V[6].second; + + return evec; +} /*----------------------------------Optimization----------------------------------------*/ diff --git a/potential.h b/potential.h index d49f36c..569a86a 100644 --- a/potential.h +++ b/potential.h @@ -27,6 +27,7 @@ class pairPotential std::vector< std::vector > calcHessian (structure &S); structure optimize (std::ostream &min, structure &S, parameter &switches, parameter &opt); + std::vector getLowestEvec (std::vector< std::pair< double,std::vector > > V); };