convert line ends
[canaan.git] / prj / tech / libsrc / matrix / mxcvrt.h
blobb7d0a87c9fd1413ba1978b472a09f1d22904a637
1 // $Header: x:/prj/tech/libsrc/matrix/RCS/mxcvrt.h 1.1 1997/08/12 06:42:19 dc Exp $
3 #ifndef __MXCVRT_H
4 #define __MXCVRT_H
6 // Vector conversion
8 #define mx_vec_cvrt(dst,src,cast_type) \
9 do { \
10 (dst)->el[0]=(cast_type)(src)->el[0]; \
11 (dst)->el[1]=(cast_type)(src)->el[1]; \
12 (dst)->el[2]=(cast_type)(src)->el[2]; \
13 } while (0)
15 #define mx_vec_d_from_s(dst,src) mx_vec_cvrt(dst,src,double)
16 #define mx_vec_s_from_d(dst,src) mx_vec_cvrt(dst,src,float)
18 // Matrix conversion
20 #define mx_mat_cvrt(dst,src,cast_type) \
21 do { \
22 (dst)->el[0]=(cast_type)(src)->el[0]; \
23 (dst)->el[1]=(cast_type)(src)->el[1]; \
24 (dst)->el[2]=(cast_type)(src)->el[2]; \
25 (dst)->el[3]=(cast_type)(src)->el[3]; \
26 (dst)->el[4]=(cast_type)(src)->el[4]; \
27 (dst)->el[5]=(cast_type)(src)->el[5]; \
28 (dst)->el[6]=(cast_type)(src)->el[6]; \
29 (dst)->el[7]=(cast_type)(src)->el[7]; \
30 (dst)->el[8]=(cast_type)(src)->el[8]; \
31 } while (0)
33 #define mx_mat_d_from_s(dst,src) mx_mat_cvrt(dst,src,double)
34 #define mx_mat_s_from_d(dst,src) mx_mat_cvrt(dst,src,float)
36 #endif // __MXCVRT_H