[Oberon] Offer and request, 1d/2d arrays

Felix Friedrich friedrich at gsf.de
Wed Jul 23 11:02:32 CEST 2003


Hello everybody,

as we are just preparing generic modules for operations on one and two 
dimensional arrays
(of Integer,Rational,Real,Cplx variables), I would like to ask all of you 
for comments on typically needed features for modules of that kind.

As future versions of Oberon/Aos will probably provide the functionalities 
that are just being collected, announcing desired features will be of use 
for all of us.

We are currently working on
	- monadic and dyadic Operators (+,-,*,/,MOD,DIV) [Array, Array-Array, 
Array-Value]
	- additional features on ARRAY OF / ARRAY OF ARRAY OF including
		-- Norms, Distances, MinMax, MeanSsq, kSmallest/Median
		-- Patterned Access (Copy,Add,Div etc. )
		-- Access on Indexes (Remove,Insert,Shift)
		-- Extract/Put Row/Col (on 2d only)
		-- SwapRows/SwapCols/Transpose (on 2d only)

A short version of the current interface of (the Integer) modules is 
appended below [the operators as +,-,*etc. are omited].

Comments/Requests/Questions/Concerns welcome !

Felix.


Array1d

	Array = POINTER TO ARRAY OF LONGINT;

	PROCEDURE Abs (VAR x: ARRAY OF LONGINT; VAR res: ARRAY OF LONGINT; offset, 
len: LONGINT);
	PROCEDURE AddAA (VAR x, y: ARRAY OF LONGINT; VAR res: ARRAY OF LONGINT; 
offset, len: LONGINT);
	PROCEDURE AddAV (VAR x: ARRAY OF LONGINT; y: LONGINT; VAR res: ARRAY OF 
LONGINT; offset, len: LONGINT);
	PROCEDURE AddAVPat (VAR x: ARRAY OF LONGINT; y: LONGINT; VAR res: ARRAY OF 
LONGINT; srcoffset, srcstep, destoffset, deststep, piecelen, pieces: LONGINT);
	PROCEDURE ApplyMap (map: Map; VAR res: ARRAY OF LONGINT; offset, len: 
LONGINT);
	PROCEDURE ApplyMapPat (map: Map; VAR res: ARRAY OF LONGINT; offset, step, 
piecelen, pieces: LONGINT);
	PROCEDURE Copy (VAR x: ARRAY OF LONGINT; VAR res: ARRAY OF LONGINT; 
srcoffset, destoffset, len: LONGINT);
	PROCEDURE CopyPat (VAR x: ARRAY OF LONGINT; VAR res: ARRAY OF LONGINT; 
srcoffset, srcstep, destoffset, deststep, piecelen, pieces: LONGINT);
	PROCEDURE DIV (): Array;
	PROCEDURE DivAA (VAR x, y: ARRAY OF LONGINT; VAR res: ARRAY OF LONGINT; 
offset, len: LONGINT);
	PROCEDURE DivAV (VAR x: ARRAY OF LONGINT; y: LONGINT; VAR res: ARRAY OF 
LONGINT; offset, len: LONGINT);
	PROCEDURE DivAVPat (VAR x: ARRAY OF LONGINT; y: LONGINT; VAR res: ARRAY OF 
LONGINT; srcoffset, srcstep, destoffset, deststep, piecelen, pieces: LONGINT);
	PROCEDURE DivVA (x: LONGINT; VAR y: ARRAY OF LONGINT; VAR res: ARRAY OF 
LONGINT; offset, len: LONGINT);
	PROCEDURE DivVAPat (x: LONGINT; VAR y: ARRAY OF LONGINT; VAR res: ARRAY OF 
LONGINT; srcoffset, srcstep, destoffset, deststep, piecelen, pieces: LONGINT);
	PROCEDURE EqualsAA (VAR x, y: ARRAY OF LONGINT; offset, len: LONGINT): 
BOOLEAN;
	PROCEDURE Fill (x: LONGINT; VAR res: ARRAY OF LONGINT; offset, len: LONGINT);
	PROCEDURE FillPat (x: LONGINT; VAR res: ARRAY OF LONGINT; offset, step, 
piecelen, pieces: LONGINT);
	PROCEDURE HammingDist (VAR x, y: ARRAY OF LONGINT; xoffset, yoffset, len: 
LONGINT): LONGINT;
	PROCEDURE HammingWeight (VAR x: ARRAY OF LONGINT; offset, len: LONGINT): 
LONGINT;
	PROCEDURE HammingWeightPat (map: Map; VAR x: ARRAY OF LONGINT; offset, 
step, piecelen, pieces: LONGINT): LONGINT;
	PROCEDURE InsertBlock (VAR x: ARRAY OF LONGINT; offset, len: LONGINT);
	PROCEDURE L1Dist (VAR x, y: ARRAY OF LONGINT; xoffset, yoffset, len: 
LONGINT): LONGINT;
	PROCEDURE L1Norm (VAR x: ARRAY OF LONGINT; offset, len: LONGINT): LONGINT;
	PROCEDURE L1NormPat (map: Map; VAR x: ARRAY OF LONGINT; offset, step, 
piecelen, pieces: LONGINT): LONGINT;
	PROCEDURE L2Dist (VAR x, y: ARRAY OF LONGINT; xoffset, yoffset, len: 
LONGINT): LONGINT;
	PROCEDURE L2Norm (VAR x: ARRAY OF LONGINT; offset, len: LONGINT): LONGINT;
	PROCEDURE L2NormPat (map: Map; VAR x: ARRAY OF LONGINT; offset, step, 
piecelen, pieces: LONGINT): LONGINT;
	PROCEDURE LInftyDist (VAR x, y: ARRAY OF LONGINT; xoffset, yoffset, len: 
LONGINT): LONGINT;
	PROCEDURE LInftyNorm (VAR x: ARRAY OF LONGINT; offset, len: LONGINT): LONGINT;
	PROCEDURE LInftyNormPat (map: Map; VAR x: ARRAY OF LONGINT; offset, step, 
piecelen, pieces: LONGINT): LONGINT;
	PROCEDURE Long (VAR x: ARRAY OF LONGINT; res: ARRAY OF MathH.HUGEINT; len: 
LONGINT);
	PROCEDURE Max (VAR x: ARRAY OF LONGINT; offset, len: LONGINT; VAR maxpos: 
LONGINT): LONGINT;
	PROCEDURE MeanSsq (VAR x: ARRAY OF LONGINT; offset, len: LONGINT; VAR 
mean, ssq: REAL);
	PROCEDURE Median (VAR a: ARRAY OF LONGINT; len: LONGINT): LONGINT;
	PROCEDURE Min (VAR x: ARRAY OF LONGINT; offset, len: LONGINT; VAR minpos: 
LONGINT): LONGINT;
	PROCEDURE MinMax (VAR x: ARRAY OF LONGINT; offset, len: LONGINT; VAR min, 
max: LONGINT; minpos, maxpos: LONGINT);
	PROCEDURE MinMaxPat (map: Map; VAR x: ARRAY OF LONGINT; offset, step, 
piecelen, pieces: LONGINT; VAR min, max: LONGINT; minpos, maxpos: LONGINT);
	PROCEDURE ModAA (VAR x, y: ARRAY OF LONGINT; VAR res: ARRAY OF LONGINT; 
offset, len: LONGINT);
	PROCEDURE ModAV (VAR x: ARRAY OF LONGINT; y: LONGINT; VAR res: ARRAY OF 
LONGINT; offset, len: LONGINT);
	PROCEDURE ModAVPat (VAR x: ARRAY OF LONGINT; y: LONGINT; VAR res: ARRAY OF 
LONGINT; srcoffset, srcstep, destoffset, deststep, piecelen, pieces: LONGINT);
	PROCEDURE ModVA (x: LONGINT; VAR y: ARRAY OF LONGINT; VAR res: ARRAY OF 
LONGINT; offset, len: LONGINT);
	PROCEDURE ModVAPat (x: LONGINT; VAR y: ARRAY OF LONGINT; VAR res: ARRAY OF 
LONGINT; srcoffset, srcstep, destoffset, deststep, piecelen, pieces: LONGINT);
	PROCEDURE MultAA (VAR x, y: ARRAY OF LONGINT; VAR res: ARRAY OF LONGINT; 
offset, len: LONGINT);
	PROCEDURE MultAV (VAR x: ARRAY OF LONGINT; y: LONGINT; VAR res: ARRAY OF 
LONGINT; offset, len: LONGINT);
	PROCEDURE MultAVPat (VAR x: ARRAY OF LONGINT; y: LONGINT; VAR res: ARRAY 
OF LONGINT; srcoffset, srcstep, destoffset, deststep, piecelen, pieces: 
LONGINT);
	PROCEDURE Negate (VAR x: ARRAY OF LONGINT; VAR res: ARRAY OF LONGINT; 
offset, len: LONGINT);
	PROCEDURE RemoveBlock (VAR x: ARRAY OF LONGINT; offset, len: LONGINT);
	PROCEDURE ScalarProduct (VAR x, y: ARRAY OF LONGINT; VAR res: LONGINT; 
offset, len: LONGINT);
	PROCEDURE SetLen (VAR a: Array; len: LONGINT);
	PROCEDURE ShiftBlock (VAR x: ARRAY OF LONGINT; from, to, len: LONGINT);
	PROCEDURE Short (VAR x: ARRAY OF LONGINT; res: ARRAY OF INTEGER; len: 
LONGINT);
	PROCEDURE Sort (VAR x: ARRAY OF LONGINT; offset, len: LONGINT);
	PROCEDURE SortByIndex (VAR x: ARRAY OF LONGINT; VAR index: ARRAY OF 
LONGINT; offset, len: LONGINT);
	PROCEDURE SortWithIndex (VAR x: ARRAY OF LONGINT; VAR index: ARRAY OF 
LONGINT; offset, len: LONGINT);
	PROCEDURE SubtractAA (VAR x, y: ARRAY OF LONGINT; VAR res: ARRAY OF 
LONGINT; offset, len: LONGINT);
	PROCEDURE SubtractAV (VAR x: ARRAY OF LONGINT; y: LONGINT; VAR res: ARRAY 
OF LONGINT; offset, len: LONGINT);
	PROCEDURE SubtractAVPat (VAR x: ARRAY OF LONGINT; y: LONGINT; VAR res: 
ARRAY OF LONGINT; srcoffset, srcstep, destoffset, deststep, piecelen, 
pieces: LONGINT);
	PROCEDURE SubtractVA (VAR x: LONGINT; VAR y: ARRAY OF LONGINT; VAR res: 
ARRAY OF LONGINT; offset, len: LONGINT);
	PROCEDURE SubtractVAPat (x: LONGINT; VAR y: ARRAY OF LONGINT; VAR res: 
ARRAY OF LONGINT; srcoffset, srcstep, destoffset, deststep, piecelen, 
pieces: LONGINT);
	PROCEDURE kSmallest (k: LONGINT; VAR a: ARRAY OF LONGINT; len: LONGINT): 
LONGINT;
	PROCEDURE kSmallestModify (k: LONGINT; VAR a: ARRAY OF LONGINT; len: 
LONGINT): LONGINT;


Array2d:

	Array = POINTER TO ARRAY OF ARRAY OF LONGINT;

	PROCEDURE Col (x: LONGINT; VAR s: ARRAY OF ARRAY OF LONGINT): 
Array1dInt.Array;
	PROCEDURE Copy (VAR src: ARRAY OF ARRAY OF LONGINT; VAR dest: ARRAY OF 
ARRAY OF LONGINT; srcx, srcy, destx, desty, w, h: LONGINT);
	PROCEDURE CopyCol (x: LONGINT; VAR s: ARRAY OF ARRAY OF LONGINT; VAR res: 
ARRAY OF LONGINT; srcoffset, destoffset, len: LONGINT);
	PROCEDURE CopyRow (y: LONGINT; VAR s: ARRAY OF ARRAY OF LONGINT; VAR res: 
ARRAY OF LONGINT; srcoffset, destoffset, len: LONGINT);
	PROCEDURE CopyToCol (VAR s: ARRAY OF LONGINT; x: LONGINT; VAR res: ARRAY 
OF ARRAY OF LONGINT; srcoffset, destoffset, len: LONGINT);
	PROCEDURE CopyToRow (VAR s: ARRAY OF LONGINT; y: LONGINT; VAR res: ARRAY 
OF ARRAY OF LONGINT; srcoffset, destoffset, len: LONGINT);
	PROCEDURE Fill (val: LONGINT; VAR res: ARRAY OF ARRAY OF LONGINT; x, y, w, 
h: LONGINT);
	PROCEDURE MeanSsq (VAR s: ARRAY OF ARRAY OF LONGINT; x, y, w, h: LONGINT; 
VAR mean, ssq: REAL);
	PROCEDURE Median (VAR s: ARRAY OF ARRAY OF LONGINT; x, y, w, h: LONGINT): 
LONGINT;
	PROCEDURE MinMax (VAR s: ARRAY OF ARRAY OF LONGINT; x, y, w, h: LONGINT; 
VAR min, max, minx, miny, maxx, maxy: LONGINT);
	PROCEDURE Row (y: LONGINT; VAR s: ARRAY OF ARRAY OF LONGINT): 
Array1dInt.Array;
	PROCEDURE SwapCols (VAR s: ARRAY OF ARRAY OF LONGINT; x1, x2: LONGINT);
	PROCEDURE SwapRows (VAR s: ARRAY OF ARRAY OF LONGINT; y1, y2: LONGINT);
	PROCEDURE Transposed (VAR s: ARRAY OF ARRAY OF LONGINT): Array;
	PROCEDURE kSmallest (k: LONGINT; VAR s: ARRAY OF ARRAY OF LONGINT; x, y, 
w, h: LONGINT): LONGINT;


--

Felix Friedrich

Institut für Biomathematik und Biometrie
GSF - Forschungszentrum für Umwelt und Gesundheit, GmbH
Ingolstädter Landstraße 1, D-85764 Neuherberg

Tel:      ++49 89 3187 2436
email:  friedrich at gsf.de

--




More information about the Oberon mailing list