diff --git a/modules/geom/src/vec3.cc b/modules/geom/src/vec3.cc index a21d150d620c3632355b906adfbdbc44d22131e3..84467ced5a4ddf66dd5ae23e1de054c7cb8e175d 100644 --- a/modules/geom/src/vec3.cc +++ b/modules/geom/src/vec3.cc @@ -48,11 +48,11 @@ Mat3 Vec3List::GetInertia() const Mat3 Vec3List::GetPrincipalAxes() const { Mat3 inertia=this->GetInertia(); - EMat3 inertia_mat(*reinterpret_cast<EMat3*>(&inertia)); + EMat3 inertia_mat(inertia.Data()); Eigen::SVD<EMat3> svd(inertia_mat); EMat3 rot=svd.matrixU(); - Mat3 axes(*reinterpret_cast<Mat3*>(&rot)); + Mat3 axes(rot.data()); return axes; } diff --git a/modules/mol/alg/src/superpose_frames.cc b/modules/mol/alg/src/superpose_frames.cc index defe8a324a896c8b18b03aec68f1aec7a50ff001..aafec9d78f986b69b08f0c2e12c160e48a680bec 100644 --- a/modules/mol/alg/src/superpose_frames.cc +++ b/modules/mol/alg/src/superpose_frames.cc @@ -35,26 +35,26 @@ typedef Eigen::Matrix<Real, Eigen::Dynamic, 3> EMatX3; inline geom::Vec3 rvec_to_gvec(const ERVec3 &vec) { - return *reinterpret_cast<const geom::Vec3*>(&vec); + return geom::Vec3(vec.data()); } inline geom::Vec3 cvec_to_gvec(const ECVec3 &vec) { - return *reinterpret_cast<const geom::Vec3*>(&vec); + return geom::Vec3(vec.data()); } inline geom::Mat3 emat_to_gmat(const EMat3 &mat) { - return *reinterpret_cast<const geom::Mat3*>(&mat); + return geom::Mat3(mat.data()); } inline ERVec3 gvec_to_rvec(const geom::Vec3 &vec) { - return *reinterpret_cast<const ERVec3*>(&vec); + return ERVec3(&vec[0]); } inline ECVec3 gvec_to_cvec(const geom::Vec3 &vec) { - return *reinterpret_cast<const ECVec3*>(&vec); + return ECVec3(&vec[0]); } inline EMat3X row_sub(const EMat3X& m, const ERVec3& s)