[BACK]Return to check.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan

Annotation of OpenXM/src/kan96xx/Kan/check.c, Revision 1.1

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>