|
From: Gordon K. <kin...@us...> - 2004-05-07 19:07:52
|
Update of /cvsroot/teem/teem/src/ell In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8904 Modified Files: ellMacros.h Log Message: why not some more macros Index: ellMacros.h =================================================================== RCS file: /cvsroot/teem/teem/src/ell/ellMacros.h,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ellMacros.h 8 Mar 2004 14:39:48 -0000 1.41 --- ellMacros.h 7 May 2004 19:07:44 -0000 1.42 *************** *** 87,90 **** --- 87,104 ---- : 1)) + #define ELL_2V_SET(v, a, b) \ + ((v)[0]=(a), (v)[1]=(b)) + + #define ELL_2V_DOT(v1, v2) ((v1)[0]*(v2)[0] + (v1)[1]*(v2)[1]) + + #define ELL_2V_LEN(v) (sqrt(ELL_2V_DOT((v),(v)))) + + #define ELL_2V_SCALE(v2, a, v1) \ + ((v2)[0] = (a)*(v1)[0], \ + (v2)[1] = (a)*(v1)[1]) + + #define ELL_2V_NORM(v2, v1, length) \ + (length = ELL_2V_LEN(v1), ELL_2V_SCALE(v2, 1.0/length, v1)) + #define _ELL_2M_DET(a,b,c,d) ((a)*(d) - (b)*(c)) *************** *** 732,738 **** ELL_4V_SET((m)+12, 0, 0, 0, 1)) - #define ELL_2V_SET(v, a, b) \ - ((v)[0]=(a), (v)[1]=(b)) - #define ELL_5V_SET(v, a, b, c, d, e) \ ((v)[0]=(a), (v)[1]=(b), (v)[2]=(c), (v)[3]=(d), (v)[4]=(e)) --- 746,749 ---- *************** *** 744,759 **** ((v)[0]=(a), (v)[1]=(b), (v)[2]=(c), (v)[3]=(d), (v)[4]=(e), (v)[5]=(f)) ! #define ELL_7V_SET(v, a, b, c, d, e, f, g) \ ! ((v)[0]=(a), (v)[1]=(b), (v)[2]=(c), (v)[3]=(d), \ ! (v)[4]=(e), (v)[5]=(f), (v)[6]=(g)) ! #define ELL_7V_COPY(v2, v1) \ ! ((v2)[0] = (v1)[0], \ ! (v2)[1] = (v1)[1], \ ! (v2)[2] = (v1)[2], \ ! (v2)[3] = (v1)[3], \ ! (v2)[4] = (v1)[4], \ ! (v2)[5] = (v1)[5], \ ! (v2)[6] = (v1)[6]) #define ELL_9V_SET(v, a, b, c, d, e, f, g, h, i) \ --- 755,773 ---- ((v)[0]=(a), (v)[1]=(b), (v)[2]=(c), (v)[3]=(d), (v)[4]=(e), (v)[5]=(f)) ! #define ELL_6V_SCALE_INCR2(v2, s0, v0, s1, v1) \ ! ((v2)[0] += (s0)*(v0)[0] + (s1)*(v1)[0], \ ! (v2)[1] += (s0)*(v0)[1] + (s1)*(v1)[1], \ ! (v2)[2] += (s0)*(v0)[2] + (s1)*(v1)[2], \ ! (v2)[3] += (s0)*(v0)[3] + (s1)*(v1)[3], \ ! (v2)[4] += (s0)*(v0)[4] + (s1)*(v1)[4], \ ! (v2)[5] += (s0)*(v0)[5] + (s1)*(v1)[5]) ! #define ELL_6V_SCALE(v2, a, v1) \ ! ((v2)[0] = (a)*(v1)[0], \ ! (v2)[1] = (a)*(v1)[1], \ ! (v2)[2] = (a)*(v1)[2], \ ! (v2)[3] = (a)*(v1)[3], \ ! (v2)[4] = (a)*(v1)[4], \ ! (v2)[5] = (a)*(v1)[5]) #define ELL_9V_SET(v, a, b, c, d, e, f, g, h, i) \ |