Skip to content
Snippets Groups Projects
Commit 9cece142 authored by Bienchen's avatar Bienchen
Browse files

Fixing Eigen3/ making it work on in house system

parent 19188333
Branches
Tags
No related merge requests found
...@@ -60,7 +60,7 @@ Mat3 Vec3List::GetPrincipalAxes() const ...@@ -60,7 +60,7 @@ Mat3 Vec3List::GetPrincipalAxes() const
Mat3 inertia=this->GetInertia(); Mat3 inertia=this->GetInertia();
EMat3 inertia_mat(inertia.Data()); EMat3 inertia_mat(inertia.Data());
Eigen::JacobiSVD<EMat3> svd(inertia_mat,Eigen::ComputeThinU); Eigen::JacobiSVD<EMat3> svd(inertia_mat,Eigen::ComputeFullU);
EMat3 rot=svd.matrixU(); EMat3 rot=svd.matrixU();
Mat3 axes(rot.data()); Mat3 axes(rot.data());
return axes; return axes;
......
...@@ -97,7 +97,7 @@ void AddSuperposedFrame(CoordGroupHandle& superposed, EMatX3& ref_mat,EMatX3& re ...@@ -97,7 +97,7 @@ void AddSuperposedFrame(CoordGroupHandle& superposed, EMatX3& ref_mat,EMatX3& re
frame_center=frame_mat.rowwise().sum()/frame_mat.cols(); frame_center=frame_mat.rowwise().sum()/frame_mat.cols();
frame_centered=row_sub(frame_mat, frame_center); frame_centered=row_sub(frame_mat, frame_center);
//single value decomposition //single value decomposition
Eigen::JacobiSVD<EMat3> svd(frame_centered*ref_centered,Eigen::ComputeThinU | Eigen::ComputeThinV); Eigen::JacobiSVD<EMat3> svd(frame_centered*ref_centered,Eigen::ComputeFullU | Eigen::ComputeFullV);
EMat3 matrixVT=svd.matrixV().transpose(); EMat3 matrixVT=svd.matrixV().transpose();
//determine rotation //determine rotation
Real detv=matrixVT.determinant(); Real detv=matrixVT.determinant();
......
...@@ -376,7 +376,7 @@ SuperpositionResult MeanSquareMinimizerImpl::Minimize(const EMatX& atoms, const ...@@ -376,7 +376,7 @@ SuperpositionResult MeanSquareMinimizerImpl::Minimize(const EMatX& atoms, const
EMatX atoms_ref_shifted = MatrixShiftedBy(atoms_ref, avg_ref).transpose(); EMatX atoms_ref_shifted = MatrixShiftedBy(atoms_ref, avg_ref).transpose();
// determine rotational component // determine rotational component
Eigen::JacobiSVD<EMat3> svd(atoms_ref_shifted*atoms_shifted,Eigen::ComputeThinU | Eigen::ComputeThinV); Eigen::JacobiSVD<EMat3> svd(atoms_ref_shifted*atoms_shifted,Eigen::ComputeFullU | Eigen::ComputeFullV);
EMatX matrixVT=svd.matrixV().transpose(); EMatX matrixVT=svd.matrixV().transpose();
//determine rotation //determine rotation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment