1#include "kernel.pckh" 2 3#ifdef DIM4 4 5Sign predicate(det_compare)( 6 point(p0), point(p1), point(p2), point(p3), point(p4) DIM 7) { 8 9 scalar a3_0 = p4_0 - p3_0; 10 scalar a3_1 = p4_1 - p3_1; 11 scalar a3_2 = p4_2 - p3_2; 12 scalar a3_3 = p4_3 - p3_3; 13 14 scalar m12 = p1_0*p0_1 - p0_0*p1_1; 15 scalar m13 = p2_0*p0_1 - p0_0*p2_1; 16 scalar m14 = a3_0*p0_1 - p0_0*a3_1; 17 scalar m23 = p2_0*p1_1 - p1_0*p2_1; 18 scalar m24 = a3_0*p1_1 - p1_0*a3_1; 19 scalar m34 = a3_0*p2_1 - p2_0*a3_1; 20 21 scalar m123 = m23*p0_2 - m13*p1_2 + m12*p2_2; 22 scalar m124 = m24*p0_2 - m14*p1_2 + m12*a3_2; 23 scalar m134 = m34*p0_2 - m14*p2_2 + m13*a3_2; 24 scalar m234 = m34*p1_2 - m24*p2_2 + m23*a3_2; 25 26 scalar Delta = (m234*p0_3 - m134*p1_3 + m124*p2_3 - m123*a3_3); 27 return sign(Delta); 28} 29 30#endif 31