Skip to content

Commit

Permalink
added function to get the eigenvector corresponding to the lowest
Browse files Browse the repository at this point in the history
eigenvalue
  • Loading branch information
Trombach committed Jun 11, 2019
1 parent 2ce12d0 commit 083e701
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions potential.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ vector< vector<double> > pairPotential::calcHessian (structure &S)
return hessianMatrix;
}

vector<double> pairPotential::getLowestEvec (vector< pair< double,vector<double> > > V)
{
vector<double> evec;
sort(V.begin(),V.end());
for (auto& i : V)
{
cout << i.first << endl;
}
evec = V[6].second;

return evec;
}

/*----------------------------------Optimization----------------------------------------*/

Expand Down
1 change: 1 addition & 0 deletions potential.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class pairPotential
std::vector< std::vector<double> > calcHessian (structure &S);

structure optimize (std::ostream &min, structure &S, parameter<int> &switches, parameter<double> &opt);
std::vector<double> getLowestEvec (std::vector< std::pair< double,std::vector<double> > > V);
};


Expand Down

0 comments on commit 083e701

Please sign in to comment.