
NULLNAME Trans
* TRANS fast transform of a real/complex matrix
::
DUP TOTEMPSWAP
CODE
* Uses:
* D[A]	-number of cols in input mx (counter)
* B[A]	16*number of rows in input
* R0	-number of rows in input (counter)
* R1	-number of cols in input
* R2	address of first item on a new col in output m
	GOSBVL	=PopASavptr
	D0=A
	D0=D0+	10
	A=DAT0	A
	ST=0	1
	LC(5)	=DOREAL
	?A=C	A
	GOYES	real
	ST=1	1
real	D0=D0+	5
	A=DAT0	A
	A=A-1	A
	?A#0	A
	GOYES	ok2
	LA(5)	#501
	GOSBVL	=GETPTR
	GOVLNG	=Errjmp
ok2	D0=D0+	5
	A=DAT0	A
	D0=D0+	5
	C=DAT0	A
	C=-C	A
	R1=C
	D=C	A
	D0=D0+	5	* D0->1. item of inp.m.
	C=DAT1	A
	D1=C
	D1=D1+	20
	C=D	A
	C=-C	A
	DAT1=C	A
	D1=D1+	5
	DAT1=A	A
	D1=D1+	5
	B=A	A
	BSL	A
	?ST=0	1
	GOYES	real2
	B=B+B	A
	B=B-CON	A,16
real2	A=-A	A
	R0=A
	AD1EX
	D1=A		* Registers filled, D0 and D1 -> first items.
	R2=A
loop	A=DAT0	W
	DAT1=A	W
	D0=D0+	16
	?ST=0	1
	GOYES	real3
	D1=D1+	16
	A=DAT0	W
	?A=0	M
	GOYES	noconj
	SETDEC
	A=-A-1	S
	SETHEX
noconj	DAT1=A	W
	D0=D0+	16
real3	AD1EX
	A=A+B	A
	D1=A
	D=D+1	A
	GONC	loop
	C=R2.F	A
	C=C+CON	A,16
	?ST=0	1
	GOYES	real4
	C=C+CON	A,16
real4	R2=C.F	A
	D1=C
	C=R1.F	A
	D=C	A
	C=R0.F	A
	C=C+1	A
	R0=C.F	A
	GONC	loop
	GOVLNG	=GETPTRLOOP
ENDCODE
;
