[BACK]Return to alg.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / engine

Annotation of OpenXM_contrib2/asir2000/engine/alg.c, Revision 1.1.1.1

1.1       noro        1: /* $OpenXM: OpenXM/src/asir99/engine/alg.c,v 1.1.1.1 1999/11/10 08:12:26 noro Exp $ */
                      2: #include "ca.h"
                      3: #include "base.h"
                      4:
                      5: extern VL ALG;
                      6:
                      7: Obj ToAlg();
                      8:
                      9: Obj ToAlg(a)
                     10: Num a;
                     11: {
                     12:        Obj t;
                     13:
                     14:        if ( !a || (NID(a) != N_A) )
                     15:                t = (Obj)a;
                     16:        else
                     17:                t = BDY((Alg)a);
                     18:        return t;
                     19: }
                     20:
                     21: void addalg(a,b,c)
                     22: Num a,b,*c;
                     23: {
                     24:        Obj t;
                     25:        Alg r;
                     26:
                     27:        addr(ALG,ToAlg(a),ToAlg(b),&t); MKAlg(t,r); *c = (Num)r;
                     28: }
                     29:
                     30: void subalg(a,b,c)
                     31: Num a,b,*c;
                     32: {
                     33:        Obj t;
                     34:        Alg r;
                     35:
                     36:        subr(ALG,ToAlg(a),ToAlg(b),&t); MKAlg(t,r); *c = (Num)r;
                     37: }
                     38:
                     39: void mulalg(a,b,c)
                     40: Num a,b,*c;
                     41: {
                     42:        Obj t;
                     43:        Alg r;
                     44:
                     45:        mulr(ALG,ToAlg(a),ToAlg(b),&t); MKAlg(t,r); *c = (Num)r;
                     46: }
                     47:
                     48: void divalg(a,b,c)
                     49: Num a,b,*c;
                     50: {
                     51:        Obj t;
                     52:        Alg r;
                     53:
                     54:        divr(ALG,ToAlg(a),ToAlg(b),&t); MKAlg(t,r); *c = (Num)r;
                     55: }
                     56:
                     57: void chsgnalg(a,c)
                     58: Num a,*c;
                     59: {
                     60:        Obj t;
                     61:        Alg r;
                     62:
                     63:        chsgnr(ToAlg(a),&t); MKAlg(t,r); *c = (Num)r;
                     64: }
                     65:
                     66: void pwralg(a,b,c)
                     67: Num a,b,*c;
                     68: {
                     69:        Obj t;
                     70:        Alg r;
                     71:
                     72:        pwrr(ALG,ToAlg(a),(Obj)b,&t); MKAlg(t,r); *c = (Num)r;
                     73: }
                     74:
                     75: int cmpalg(a,b)
                     76: Num a,b;
                     77: {
                     78:        return compr(ALG,ToAlg(a),ToAlg(b));
                     79: }

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