Annotation of OpenXM/src/kan96xx/Kan/check.c, Revision 1.2
1.2 ! takayama 1: /* $OpenXM$ */
1.1 maekawa 2: /* work7/check.c 1996, 3/19 */
3: /* should move to SSkan/Kan/check.c */
4: #include <stdio.h>
5: #define N0 4
6: struct ring {
7: int dummy;
8: };
9:
10: struct exps {
11: int x;
12: int D;
13: };
14:
15: struct monomial {
16: struct ring *ringp;
17: struct exps e[N0];
18: };
19:
20: /* --------------------------------------- */
21: struct monom {
22: struct ring *ringp;
23: int ee[N0*2];
24: };
25:
26: main() {
27: int i;
28: struct monomial *mp;
29: if (sizeof(struct monomial) != sizeof(struct monom)) {
30: fprintf(stderr,"Error: monomial != monom \n");
31: }
32:
33: mp = (struct monomial *)malloc(sizeof(struct monomial));
34: for (i=0; i<N0; i++) {
35: mp->e[i].x = i;
36: mp->e[i].D = -i;
37: }
38: for (i=0; i<N0*2; i++) {
39: printf(" %d ",((struct monom *)mp)->ee[i]);
40: }
41: printf("\n\n");
42: for (i=0; i<N0*2; i++) {
43: ((struct monom *)mp)->ee[i] = -i;
44: }
45: for (i=0; i<N0; i++) {
46: printf(" %d ",mp->e[i].x);
47: printf(" %d ",mp->e[i].D);
48: }
49: printf("\n\n");
50: }
51:
52:
53:
54:
55:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>