From b939b1c1770ac0fb0f6433b15a03ac9b229b4689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Wed, 24 Jul 2019 19:06:29 +0300 Subject: [PATCH] I realised this approach is wrong. I must do the quaternion sorting in otherway, probably using a separate tree for each component (then what?). Former-commit-id: 6de715751ddd41f6ffc72b274cadf58a765b3edd --- qpms/pointgroups.c | 2 ++ qpms/quaternions.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/qpms/pointgroups.c b/qpms/pointgroups.c index 063768b..4daed5e 100644 --- a/qpms/pointgroups.c +++ b/qpms/pointgroups.c @@ -7,7 +7,9 @@ if ((a) > (b)) return 1;\ } +// THIS IS NUMERICALLY UNSTABLE! FIXME!!!!!! int qpms_pg_irot3_cmp(const qpms_irot3_t *p1, const qpms_irot3_t *p2) { + QPMS_WARN("NUMERICALLY UNSTABLE! DON'T USE ME!") PAIRCMP(p1->det, p2->det); const qpms_quat_t r1 = qpms_quat_standardise(p1->rot), r2 = qpms_quat_standardise(p2->rot); PAIRCMP(creal(r1.a), creal(r2.a)); diff --git a/qpms/quaternions.h b/qpms/quaternions.h index fb1e282..a1e93dd 100644 --- a/qpms/quaternions.h +++ b/qpms/quaternions.h @@ -99,6 +99,8 @@ static inline bool qpms_quat_isclose(const qpms_quat_t p, const qpms_quat_t q, d /// "Standardises" a quaternion to have the largest component "positive". /** + * FIXME + * NUMERICALLY UNSTABLE. DON'T USE * This is to remove the ambiguity stemming from the double cover of SO(3). */ static inline qpms_quat_t qpms_quat_standardise(qpms_quat_t p) {