Skip to content
Snippets Groups Projects
Commit 1b880241 authored by Ian Bell's avatar Ian Bell
Browse files

Align the eigenvectors to match the direction of the minimum concentration

parent 6f482cca
No related branches found
No related tags found
No related merge requests found
......@@ -95,6 +95,13 @@ struct CriticalTracing {
else {
throw std::invalid_argument("More than one non-zero concentration value found; not currently supported");
}
// Align with the eigenvector of the component with the smallest density, and make that one positive
Eigen::Index ind;
rhovec.minCoeff(&ind);
if (ed.eigenvectorscols.col(ind).minCoeff() < 0) {
ed.eigenvectorscols *= -1.0;
}
ed.v0 = ed.eigenvectorscols.col(0);
ed.v1 = ed.eigenvectorscols.col(1);
return ed;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment