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
This commit is contained in:
Marek Nečada 2019-07-24 19:06:29 +03:00
parent 1b63d75153
commit b939b1c177
2 changed files with 4 additions and 0 deletions

View File

@ -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));

View File

@ -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) {