File: [local] / OpenXM / src / asir-doc / int-parts / datatype / algnum.texi (download)
Revision 1.1, Mon Apr 23 05:45:36 2001 UTC (23 years, 4 months ago) by noro
Branch: MAIN
CVS Tags: R_1_3_1-2, RELEASE_1_3_1_13b, RELEASE_1_2_3_12, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, KNOPPIX_2006, HEAD, DEB_REL_1_2_3-9
Risa/Asir manual on the internal specifications.
|
@comment $OpenXM: OpenXM/src/asir-doc/int-parts/datatype/algnum.texi,v 1.1 2001/04/23 05:45:36 noro Exp $
@section $BBe?tE*?t(B
@example
struct oAlg @{ $BBe?tE*?t(B
short id; $B<1JL;R(B (= O_N)
char nid; $B?t<1JL;R(B (= N_A)
char pad;
struct oObj *body; $BBe?tE*?t$rI=$9B?9`<0$^$?$OM-M}<0(B
@};
typedef struct oAlg *Alg;
struct oV @{ root
char *name; $BL>A0(B
pointer attr; $BDj5AB?9`<0(B ($B<gJQ?t$O(B #n )
pointer priv; $BBP1~$9$kITDj85(B (t#n) $B$X$N%]%$%s%?(B
@};
typedef struct oV *V;
struct oVL @{ root $B%j%9%H(B
V v; root
struct oVL *next; $B<!$X$N%]%$%s%?(B
@};
typedef struct oVL *VL;
extern VL ALG; $BDj5A:Q$_(B root $B$N%j%9%H(B
@end example
$BBe?tE*?t$O(B, root $B$H8F$P$l$kFC<l$JBe?tE*?t$NM-M}?t78?tB?9`<0$^$?$OM-M}<0(B
$B$H$7$FI=8=$5$l$k(B. root $B$H$O(B, $B$=$l$^$GDj5A$5$l$?(B root $B$GI=$5$l$kBe?tE*(B
$B?t$r78?t$H$9$k(B 1 $BJQ?tB?9`<0$N:,$H$7$FDj5A$5$l$k(B. root $B$O(B, $BDj5A$,?7$7$$(B
$B=g$K(B, $BB?9`<0$KBP$9$kJQ?t%j%9%H$HF1$87A<0$G(B, root $B%j%9%H$H$7$F(B
$BBg0hJQ?t(B @code{ALG} $B$KJ];}$5$l$k(B. root $B$ODj5A=g$K(B @code{#n} (@code{n} $B$O(B
0 $B$+$i;O$^$k(B) $B$H$$$&L>A0$GEPO?$5$l$k(B. $BBe?tE*?t$O(B, $B$=$l$^$G$KDj5A$5$l$?(B
$BITDj85$NM-M}<0$^$?$OB?9`<0$H$7$FI=8=$5$l$k$,(B, $B$3$l$r<B:]$KB?9`<0$H$7$F(B
$B07$&$?$a$K(B, $B3F(B root $B$K(B @code{t#n} $B$H$$$&L>A0$NFCJL$JITDj85$rBP1~$5$;$F(B
$B$$$k(B. $B$3$l$i$NA`:n$O(B, $B<!$K<($9(B @code{mkalg()} $B$K$h$j<+F0E*$K9T$o$l$k(B.
@subsection $BBe?tE*?t$N@8@.(B
@example
#include "ca.h"
MKAlg(a,b) (macro; Obj a; Real b)
$B@8@.85$NB?9`<0$^$?$OM-M}<0$+$iBe?tE*?t$r@8@.$9$k(B.
void mkalg(P p,Alg *r)
@code{p} $B$rDj5AB?9`<0$H$9$k(B root $B$r@8@.$9$k(B.
void algtorat(Num n,Obj *r)
$BBe?tE*?t(B @code{n} $B$N3F(B root $B$rBP1~$9$kITDj85$KCV$-49$($?M-M}<0$^$?$OB?9`<0$r@8@.$9$k(B.
void rattoalg(Obj obj,Alg *n)
root $B$KBP1~$9$kITDj85$r(B root $B$KCV$-49$($?Be?tE*?t$r@8@.$9$k(B.
@end example
@noindent
$B%^%/%m$GI,MW$JNN0h$O%^%/%mFb$G3NJ]$5$l$k(B.
@subsection $B;MB'(B
@noindent
$B$$$:$l$b(B, $BBe?tE*?t(B, $BM-M}?tN>J}$rF~NO$K$H$l$k(B. $B7k2L$O$9$Y$FBe?tE*?t$H$J$k(B.
@example
#include "ca.h"
addalg(Num a,Num b,Alg *rp)
*rp = a + b
subalg(Num a,Num b,Alg *rp)
*rp = a - b
mulalg(Num a,Num b,Alg *rp)
*rp = a * b
divalg(Num a,Num b,Alg *rp)
*rp = a / b
pwralg(Num a,Num e,Alg *rp)
*rp = a ^ e
int cmpalg(Num a,Num b)
root $B$NB?9`<0$"$k$$$OM-M}<0$H$7$FHf3S$9$k(B.
@end example
@code{cmpalg()} $B$N7k2L$O(B, $BBe?tE*?t$r(B, root $B$NB?9`<0$"$k$$$OM-M}<0$H$_$F(B,
root $B4V$N=g=x$r85$K$7$?=g=xHf3S$K$h$j7h$^$k(B. root $B4V$N=g=x$O(B, $B8e$GDj5A(B
$B$5$l$?$b$NDx=g=x$,9b$/$J$k$h$&$K@_Dj$5$l$F$$$k(B.