|
|
1.1 root 1: #include "apl.h"
2:
3: ex_diot()
4: {
5: register struct item *p, *q, *r;
6: int i, j;
7:
8: p = fetch2();
9: q = sp[-2];
10: r = newdat(DA, q->rank, q->size);
11: copy(IN, q->dim, r->dim, q->rank);
12: for(i=0; i<q->size; i++) {
13: datum = getdat(q);
14: p->index = 0;
15: for(j=0; j<p->size; j++)
16: if(fuzz(getdat(p), datum) == 0)
17: break;
18: datum = j + thread.iorg;
19: putdat(r, datum);
20: }
21: pop();
22: pop();
23: push(r);
24: }
25:
26: ex_eps()
27: {
28: register struct item *p, *q, *r;
29: int i, j;
30: data d;
31:
32: p = fetch2();
33: q = sp[-2];
34: r = newdat(DA, p->rank, p->size);
35: copy(IN, p->dim, r->dim, p->rank);
36: for(i=0; i<p->size; i++) {
37: datum = getdat(p);
38: d = zero;
39: q->index = 0;
40: for(j=0; j<q->size; j++)
41: if(fuzz(getdat(q), datum) == 0) {
42: d = one;
43: break;
44: }
45: putdat(r, d);
46: }
47: pop();
48: pop();
49: push(r);
50: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.