File: treecode1.doc

package info (click to toggle)
tela 1.28-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 6,596 kB
  • ctags: 5,519
  • sloc: ansic: 14,013; cpp: 13,376; lex: 1,651; fortran: 1,048; yacc: 834; sh: 715; makefile: 464
file content (264 lines) | stat: -rw-r--r-- 6,084 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264

TELA Treecode documentation 						PJ 12.1.1994
Version 1.0


AND

	AND[a,b] denotes (a && b), where a and b are integer (array or scalar)
	objects. If a is nonzero and b is nonzero, AND[a,b] is 1, otherwise 0.


APPEND

	APPEND[a,b,...] concatenates the argument arrays. If e.g. all arguments
	are vectors, the result is a longer vector. In general all arguments
	have the same rank r, however it is permissible that some of the args
	have rank r-1, in which case they are promoted to rank r before appending.


ARRAY

	ARRAY[a,b,...] constructs an array. The arguments may be scalars or arrays.
	The rank of the result is one higher than the rank r of the arguments.
	It is permissible that some of the arguments have rank r-1, in which case
	they are promoted to rank r before constructing the array. Scalars are
	treated as rank 0 arrays in this context.


BLOCK

	BLOCK[f1,f2,...fN] denotes sequential execution of f1,...,fN.


BREAK

	Break out of loop. Can only be used inside for, while and repeat-until loops.


CALL

	CALL[fn,arg1,arg2,...argN] calls function fn on given arguments. Restriction: N>=0.


CONTINUE

	Jump to end of loop body. Can only be used inside for, while and repeat-until loops.


CZEROS

	CZEROS[imax,jmax,...,kmax] returns a complex array of dimensions imax x jmax x ... x kmax.
	The arguments must be positive integers. The resulting array has all elements equal to zero.


DEFUN

	DEFUN[funcname,outargs,inargs,localvars,body] defines new function funcname.
	Outargs and inargs are the lists of output and input arguments. Both must either
	be LISTs or single symbols. Localvars can assume four forms:
        LOCAL            meaning all new symbols are local
        GLOBAL           meaning all new symbols are global
        LOCAL[a,b,..]    declaring a,b,.. local, others global
        GLOBAL[a,b,..]   declaring a,b,.. global, others local


DIFFERENCE
	
	DIFFERENCE[a,b] gives (a-b), where a and b are numerical objects.
	If both a and b are arrays, their dimensions must agree.


DISP

	DISP[f] displays f.


EMPTY_ARRAY

	EMPTY_ARRAY[] constructs an empty integer vector #().


FOR

	FOR[init,contcond,incr,body] has the same semantic as in C language:
	BLOCK[ init, WHILE[contcond,BLOCK[body,incr]] ].
	See WHILE.


FORMAL
	FORMAL[LIST[...]] declares the list to be a formal parameter list.
	LIST[...] can be used instead of the one-argument FORMAL.
	FORMAL[LIST[a,b,..], LIST[x,y,..]] declares a formal parameter list
	which has a,b,.. as obligatory parameters and x,y,.. as optional
	parameters. The Tela notation is a,b;x,y.


FORMAL_ELLIPSIS
	FORMAL_ELLIPSIS is similar to FORMAL (see above), except that
	FORMAL_ELLIPSIS declares a formal parameter list that has the
	ellipsis at the end. As FORMAL, FORMAL_ELLIPSIS can take one
	or two arguments.


EQ (equal)

	EQ[a,b] denotes (a==b). See GE.


GE (greater or equal)

	GE[a,b] denotes (a >= b), where a and b are numerical objects.
	The result of GE is 0 (false) or 1 (true) if a and b are scalars;
	if a and b are arrays (of equal dimensions), the result is an integer
	array with elements 0 and 1.


GT (greater than)

	GT[a,b] denotes (a > b). See GE.


IF

	IF[cond,thenpart] executes thenpart if cond succeeds (evaluates to nonzero
	integer scalar, or evaluates to integer array with all elements nonzero).
	IF[cond,thenpart,elsepart] executes thenpart if cond succeeds, otherwise
	it executes elsepart.


IZEROS

	IZEROS is the same as CZEROS (see it), but it gives an integer array
	instead of a complex array.


LE (less or equal)

	LT[a,b] denotes (a <= b). See GE.


LIST

	LIST[f1,f2,...,fN] is general notation for various lists, such as arguments
	and index lists. It has no semantic except as part of various other constructs.


LOCAL

	If the fourth argument of DEFUN is LOCAL, it means that all variables in the
	to-be-defined function body should be implicitly local. See DEFUN.


LT (less than)

	LT[a,b] denotes (a < b). See GE.


MAX (maximum)

	MAX[a] denotes the maximum element of array a, or a itself is a is scalar.
	The argument must be real, ie. integer or real array or scalar.


MIN (minimum)

	MIN[a] denotes the minimum element of array a, or a itself is a is scalar.
	The argument must be real, ie. integer or real array or scalar.

MINUS

	MINUS[a] denotes (-a), where a is any numerical object.


NE (not equal)

	NE[a,b] denotes (a != b). See GE.


NOP

	NOP[] means no operation. It is generated by an empty statement (;).

NOT
	
	NOT[a] means (!a), where a is integer array or scalar.
	If a is nonzero, NOT[a] is zero; if a is zero, NOT[a] is 1.	


PACKAGE

	PACKAGE[pkgname,localvars,body] sets up a package (module).
	pkgname is the name of the package (string). For syntax of localvars,
	see DEFUN.


PLUS

	PLUS[a,b] denotes (a+b), where a and b are numerical objects.

POWER

	POWER[a,b] denotes pow(a,b), or a^b. The arguments must be numerical
	objects.


QUOTIENT

	QUOTIENT[a,b] denotes (a/b).


RANGE

	RANGE[a,step,b] creates a monotonously increasing or decreasing vector
	(1D array) or integer or real values. If step is positive, the values
	are (a,a+s,a+2*s,...) such that all are <=b. If step is negative, the
	values are (a,a+s,a+2*s,...) such that all are >=b.


REF

	REF[A,i,j,...,k] references the array A. The dimensionality of A must
	agree with the number of arguments, which must be integer scalars
	(later: integer scalars or vectors).


REPEAT

	REPEAT[body,endcond] repeats body until endcond succeeds. Cf. Pascal's
	repeat ... until statement.


RETURN

	nyi


RZEROS

	RZEROS is the same as CZEROS (see it), but it gives a real array
	instead of a complex array.


SET

	SET[expr] evaluates and prints expr.

	SET[var,val] is the assignment (var=val). Var can be either symbol
	or a REF[]. Val can be arbitrary expression.


TIMES

	TIMES[a,b] denotes (a*b), where a and b are numerical objects.


WHILE

	WHILE[contcond,body] evaluates body while contcond succeeds.


OR

	OR[a,b] denotes (a || b), where a and b are integer (array or scalar)
	objects. If a is nonzero or b is nonzero, OR[a,b] is 1, otherwise 0.