version	U12.1.00
uid	matrix.u1-1784908800-0
impl	error
link	lu.u
global	10
	0,000005,matrix_width,1
	1,000005,matrix_height,1
	2,000005,write_matrix,4
	3,000005,copy_matrix,1
	4,000005,create_matrix,3
	5,000005,identity_matrix,2
	6,000005,add_matrix,2
	7,000005,mult_matrix,2
	8,000005,invert_matrix,1
	9,000005,determinant,1

proc matrix_width
	local	0,001000,M
	con	0,002000,1,1
	declend
	filen	matrix.icn
	line	27
	colm	11
	synt	any
	mark	L1
	mark	L2
	pnull
	pnull
	var	0
	int	0
	line	29
	colm	13
	synt	any
	subsc
	line	29
	colm	11
	synt	any
	size
	line	29
	colm	4
	synt	any
	pret
lab L2
	synt	any
	pfail
	unmark
lab L1
	pnull
	line	31
	colm	1
	synt	any
	pfail
	end
proc matrix_height
	local	0,001000,M
	declend
	line	33
	colm	11
	synt	any
	mark	L1
	mark	L2
	pnull
	var	0
	line	35
	colm	11
	synt	any
	size
	line	35
	colm	4
	synt	any
	pret
lab L2
	synt	any
	pfail
	unmark
lab L1
	pnull
	line	37
	colm	1
	synt	any
	pfail
	end
proc write_matrix
	local	0,001000,file
	local	1,001000,M
	local	2,001000,x
	local	3,001000,s
	local	4,000020,r
	local	5,000020,c
	local	6,000020,row
	local	7,000020,col
	local	8,000000,matrix_height
	local	9,000000,matrix_width
	local	10,000000,writes
	local	11,000000,write
	con	0,010000,1,040
	con	1,002000,1,1
	con	2,010000,1,133
	con	3,010000,2,054,040
	con	4,010000,1,135
	declend
	line	39
	colm	11
	synt	any
	mark	L1
	pnull
	pnull
	var	3
	line	41
	colm	4
	synt	any
	null
	str	0
	line	41
	colm	7
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	4
	var	8
	var	1
	line	42
	colm	22
	synt	any
	invoke	1
	line	42
	colm	6
	synt	any
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	5
	var	9
	var	1
	line	43
	colm	21
	synt	any
	invoke	1
	line	43
	colm	6
	synt	any
	asgn
	unmark
lab L3
	mark	L4
	line	45
	colm	4
	synt	ifelse
	mark	L5
	pnull
	var	2
	line	45
	colm	7
	synt	any
	null
	unmark
	line	46
	colm	7
	synt	every
	mark0
	pnull
	var	6
	pnull
	int	1
	var	4
	push1
	line	46
	colm	22
	synt	any
	toby
	line	46
	colm	17
	synt	any
	asgn
	pop
	mark0
	mark	L9
	line	47
	colm	10
	synt	every
	mark0
	pnull
	var	7
	pnull
	int	1
	var	5
	push1
	line	47
	colm	25
	synt	any
	toby
	line	47
	colm	20
	synt	any
	asgn
	pop
	mark0
	var	10
	var	0
	pnull
	pnull
	var	1
	var	6
	line	48
	colm	27
	synt	any
	subsc
	var	7
	line	48
	colm	32
	synt	any
	subsc
	var	3
	line	48
	colm	19
	synt	any
	invoke	3
	unmark
lab L10
	efail
lab L11
	line	47
	colm	10
	synt	endevery
	unmark
lab L9
	var	11
	var	0
	line	50
	colm	15
	synt	any
	invoke	1
	unmark
lab L7
	efail
lab L8
	line	46
	colm	7
	synt	endevery
	goto	L6
lab L5
	line	54
	colm	7
	synt	every
	mark0
	pnull
	var	6
	pnull
	int	1
	var	4
	push1
	line	54
	colm	22
	synt	any
	toby
	line	54
	colm	17
	synt	any
	asgn
	pop
	mark0
	mark	L14
	var	10
	var	0
	str	2
	line	55
	colm	16
	synt	any
	invoke	2
	unmark
lab L14
	mark	L15
	line	56
	colm	10
	synt	every
	mark0
	pnull
	var	7
	pnull
	int	1
	var	5
	push1
	line	56
	colm	25
	synt	any
	toby
	line	56
	colm	20
	synt	any
	asgn
	pop
	mark0
	var	10
	var	0
	pnull
	pnull
	var	1
	var	6
	line	57
	colm	27
	synt	any
	subsc
	var	7
	line	57
	colm	32
	synt	any
	subsc
	str	3
	line	57
	colm	19
	synt	any
	invoke	3
	unmark
lab L16
	efail
lab L17
	line	56
	colm	10
	synt	endevery
	unmark
lab L15
	var	11
	var	0
	str	4
	line	59
	colm	15
	synt	any
	invoke	2
	unmark
lab L12
	efail
lab L13
	line	54
	colm	7
	synt	endevery
lab L6
	line	45
	colm	4
	synt	endifelse
	unmark
lab L4
	pnull
	line	63
	colm	1
	synt	any
	pfail
	end
proc copy_matrix
	local	0,001000,M
	local	1,000020,M1
	local	2,000020,n
	local	3,000020,i
	local	4,000000,list
	local	5,000000,copy
	con	0,002000,1,1
	declend
	line	65
	colm	11
	synt	any
	mark	L1
	pnull
	var	2
	pnull
	var	0
	line	68
	colm	9
	synt	any
	size
	line	68
	colm	6
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	1
	var	4
	var	2
	line	70
	colm	14
	synt	any
	invoke	1
	line	70
	colm	7
	synt	any
	asgn
	unmark
lab L2
	mark	L3
	line	72
	colm	4
	synt	every
	mark0
	pnull
	var	3
	pnull
	int	0
	var	2
	push1
	line	72
	colm	17
	synt	any
	toby
	line	72
	colm	12
	synt	any
	asgn
	pop
	mark0
	pnull
	pnull
	var	1
	var	3
	line	73
	colm	9
	synt	any
	subsc
	var	5
	pnull
	var	0
	var	3
	line	73
	colm	22
	synt	any
	subsc
	line	73
	colm	20
	synt	any
	invoke	1
	line	73
	colm	13
	synt	any
	asgn
	unmark
lab L4
	efail
lab L5
	line	72
	colm	4
	synt	endevery
	unmark
lab L3
	mark	L6
	mark	L7
	var	1
	line	75
	colm	4
	synt	any
	pret
lab L7
	synt	any
	pfail
	unmark
lab L6
	pnull
	line	77
	colm	1
	synt	any
	pfail
	end
proc create_matrix
	local	0,001000,n
	local	1,001000,m
	local	2,001000,x
	local	3,000020,M
	local	4,000000,list
	declend
	line	79
	colm	11
	synt	any
	mark	L1
	pnull
	var	3
	var	4
	var	0
	line	82
	colm	13
	synt	any
	invoke	1
	line	82
	colm	6
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	line	83
	colm	4
	synt	every
	mark0
	pnull
	pnull
	var	3
	line	83
	colm	10
	synt	any
	bang
	var	4
	var	1
	var	2
	line	83
	colm	20
	synt	any
	invoke	2
	line	83
	colm	13
	synt	any
	asgn
	pop
lab L3
	efail
lab L4
	line	83
	colm	4
	synt	endevery
	unmark
lab L2
	mark	L5
	mark	L6
	var	3
	line	85
	colm	4
	synt	any
	pret
lab L6
	synt	any
	pfail
	unmark
lab L5
	pnull
	line	87
	colm	1
	synt	any
	pfail
	end
proc identity_matrix
	local	0,001000,n
	local	1,001000,m
	local	2,000020,r
	local	3,000020,c
	local	4,000020,M
	local	5,000000,create_matrix
	con	0,002000,1,0
	con	1,002000,1,1
	declend
	line	89
	colm	11
	synt	any
	mark	L1
	pnull
	var	4
	var	5
	var	0
	var	1
	int	0
	line	92
	colm	22
	synt	any
	invoke	3
	line	92
	colm	6
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	line	94
	colm	4
	synt	every
	mark0
	pnull
	var	2
	pnull
	int	1
	var	0
	push1
	line	94
	colm	17
	synt	any
	toby
	line	94
	colm	12
	synt	any
	asgn
	pop
	mark0
	line	95
	colm	7
	synt	every
	mark0
	pnull
	var	3
	pnull
	int	1
	var	1
	push1
	line	95
	colm	20
	synt	any
	toby
	line	95
	colm	15
	synt	any
	asgn
	pop
	mark0
	line	96
	colm	10
	synt	if
	mark0
	pnull
	var	2
	var	3
	line	96
	colm	15
	synt	any
	numeq
	unmark
	pnull
	pnull
	pnull
	var	4
	var	2
	line	96
	colm	25
	synt	any
	subsc
	var	3
	line	96
	colm	28
	synt	any
	subsc
	int	1
	line	96
	colm	32
	synt	any
	asgn
	line	96
	colm	10
	synt	endif
	unmark
lab L5
	efail
lab L6
	line	95
	colm	7
	synt	endevery
	unmark
lab L3
	efail
lab L4
	line	94
	colm	4
	synt	endevery
	unmark
lab L2
	mark	L7
	mark	L8
	var	4
	line	100
	colm	4
	synt	any
	pret
lab L8
	synt	any
	pfail
	unmark
lab L7
	pnull
	line	102
	colm	1
	synt	any
	pfail
	end
proc add_matrix
	local	0,001000,M1
	local	1,001000,M2
	local	2,000020,M3
	local	3,000020,r
	local	4,000020,c
	local	5,000020,n
	local	6,000020,m
	local	7,000000,stop
	local	8,000000,create_matrix
	con	0,002000,1,1
	con	1,010000,26,052,052,052,040,151,156,143,157,162,162,145,143,164,040,155,141,164,162,151,170,040,163,151,172,145,163
	declend
	line	104
	colm	11
	synt	any
	mark	L1
	line	107
	colm	4
	synt	if
	mark0
	mark	L2
	pnull
	pnull
	var	5
	pnull
	var	0
	line	107
	colm	14
	synt	any
	size
	line	107
	colm	11
	synt	any
	asgn
	pnull
	var	1
	line	107
	colm	22
	synt	any
	size
	line	107
	colm	19
	synt	any
	numne
	line	107
	colm	27
	synt	any
	esusp
	goto	L3
lab L2
	pnull
	pnull
	var	6
	pnull
	pnull
	var	0
	int	0
	line	107
	colm	39
	synt	any
	subsc
	line	107
	colm	36
	synt	any
	size
	line	107
	colm	33
	synt	any
	asgn
	pnull
	pnull
	var	1
	int	0
	line	107
	colm	50
	synt	any
	subsc
	line	107
	colm	47
	synt	any
	size
	line	107
	colm	44
	synt	any
	numne
lab L3
	unmark
	var	7
	str	1
	line	108
	colm	11
	synt	any
	invoke	1
	line	107
	colm	4
	synt	endif
	unmark
lab L1
	mark	L4
	pnull
	var	2
	var	8
	var	5
	var	6
	line	110
	colm	23
	synt	any
	invoke	2
	line	110
	colm	7
	synt	any
	asgn
	unmark
lab L4
	mark	L5
	line	112
	colm	4
	synt	every
	mark0
	pnull
	var	3
	pnull
	int	0
	var	5
	push1
	line	112
	colm	17
	synt	any
	toby
	line	112
	colm	12
	synt	any
	asgn
	pop
	mark0
	line	113
	colm	7
	synt	every
	mark0
	pnull
	var	4
	pnull
	int	0
	var	6
	push1
	line	113
	colm	20
	synt	any
	toby
	line	113
	colm	15
	synt	any
	asgn
	pop
	mark0
	pnull
	pnull
	pnull
	var	2
	var	3
	line	114
	colm	12
	synt	any
	subsc
	var	4
	line	114
	colm	15
	synt	any
	subsc
	pnull
	pnull
	pnull
	var	0
	var	3
	line	114
	colm	24
	synt	any
	subsc
	var	4
	line	114
	colm	27
	synt	any
	subsc
	pnull
	pnull
	var	1
	var	3
	line	114
	colm	35
	synt	any
	subsc
	var	4
	line	114
	colm	38
	synt	any
	subsc
	line	114
	colm	31
	synt	any
	plus
	line	114
	colm	19
	synt	any
	asgn
	unmark
lab L8
	efail
lab L9
	line	113
	colm	7
	synt	endevery
	unmark
lab L6
	efail
lab L7
	line	112
	colm	4
	synt	endevery
	unmark
lab L5
	mark	L10
	mark	L11
	var	2
	line	116
	colm	4
	synt	any
	pret
lab L11
	synt	any
	pfail
	unmark
lab L10
	pnull
	line	118
	colm	1
	synt	any
	pfail
	end
proc mult_matrix
	local	0,001000,M1
	local	1,001000,M2
	local	2,000020,M3
	local	3,000020,r
	local	4,000020,c
	local	5,000020,n
	local	6,000020,k
	local	7,000000,stop
	local	8,000000,create_matrix
	con	0,002000,1,1
	con	1,010000,26,052,052,052,040,151,156,143,157,162,162,145,143,164,040,155,141,164,162,151,170,040,163,151,172,145,163
	con	2,002000,1,0
	declend
	line	120
	colm	11
	synt	any
	mark	L1
	line	123
	colm	4
	synt	if
	mark0
	pnull
	pnull
	var	5
	pnull
	pnull
	var	0
	int	0
	line	123
	colm	16
	synt	any
	subsc
	line	123
	colm	13
	synt	any
	size
	line	123
	colm	10
	synt	any
	asgn
	pnull
	var	1
	line	123
	colm	24
	synt	any
	size
	line	123
	colm	21
	synt	any
	numne
	unmark
	var	7
	str	1
	line	123
	colm	37
	synt	any
	invoke	1
	line	123
	colm	4
	synt	endif
	unmark
lab L1
	mark	L2
	pnull
	var	2
	var	8
	pnull
	var	0
	line	125
	colm	24
	synt	any
	size
	pnull
	pnull
	var	1
	int	0
	line	125
	colm	31
	synt	any
	subsc
	line	125
	colm	28
	synt	any
	size
	line	125
	colm	23
	synt	any
	invoke	2
	line	125
	colm	7
	synt	any
	asgn
	unmark
lab L2
	mark	L3
	line	126
	colm	4
	synt	every
	mark0
	pnull
	var	3
	pnull
	int	0
	pnull
	var	0
	line	126
	colm	20
	synt	any
	size
	push1
	line	126
	colm	17
	synt	any
	toby
	line	126
	colm	12
	synt	any
	asgn
	pop
	mark0
	line	127
	colm	7
	synt	every
	mark0
	pnull
	var	4
	pnull
	int	0
	pnull
	pnull
	var	1
	int	0
	line	127
	colm	26
	synt	any
	subsc
	line	127
	colm	23
	synt	any
	size
	push1
	line	127
	colm	20
	synt	any
	toby
	line	127
	colm	15
	synt	any
	asgn
	pop
	mark0
	mark	L8
	pnull
	pnull
	pnull
	var	2
	var	3
	line	128
	colm	12
	synt	any
	subsc
	var	4
	line	128
	colm	15
	synt	any
	subsc
	int	2
	line	128
	colm	19
	synt	any
	asgn
	unmark
lab L8
	line	129
	colm	10
	synt	every
	mark0
	pnull
	var	6
	pnull
	int	0
	var	5
	push1
	line	129
	colm	23
	synt	any
	toby
	line	129
	colm	18
	synt	any
	asgn
	pop
	mark0
	pnull
	pnull
	pnull
	var	2
	var	3
	line	130
	colm	16
	synt	any
	subsc
	var	4
	line	130
	colm	19
	synt	any
	subsc
	dup
	pnull
	pnull
	pnull
	var	0
	var	3
	line	130
	colm	29
	synt	any
	subsc
	var	6
	line	130
	colm	32
	synt	any
	subsc
	pnull
	pnull
	var	1
	var	6
	line	130
	colm	40
	synt	any
	subsc
	var	4
	line	130
	colm	43
	synt	any
	subsc
	line	130
	colm	36
	synt	any
	mult
	line	130
	colm	23
	synt	any
	plus
	asgn
	unmark
lab L9
	efail
lab L10
	line	129
	colm	10
	synt	endevery
	unmark
lab L6
	efail
lab L7
	line	127
	colm	7
	synt	endevery
	unmark
lab L4
	efail
lab L5
	line	126
	colm	4
	synt	endevery
	unmark
lab L3
	mark	L11
	mark	L12
	var	2
	line	135
	colm	4
	synt	any
	pret
lab L12
	synt	any
	pfail
	unmark
lab L11
	pnull
	line	137
	colm	1
	synt	any
	pfail
	end
proc invert_matrix
	local	0,001000,M
	local	1,000020,M1
	local	2,000020,Y
	local	3,000020,I
	local	4,000020,d
	local	5,000020,i
	local	6,000020,n
	local	7,000020,B
	local	8,000020,j
	local	9,000000,stop
	local	10,000000,copy_matrix
	local	11,000000,identity_matrix
	local	12,000000,list
	local	13,000000,lu_decomp
	local	14,000000,lu_back_sub
	con	0,002000,1,1
	con	1,010000,21,052,052,052,040,155,141,164,162,151,170,040,156,157,164,040,163,161,165,141,162,145
	con	2,002000,1,0
	con	3,010000,19,052,052,052,040,163,151,156,147,165,154,141,162,040,155,141,164,162,151,170
	declend
	line	139
	colm	11
	synt	any
	mark	L1
	pnull
	var	6
	pnull
	var	0
	line	142
	colm	9
	synt	any
	size
	line	142
	colm	6
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	line	143
	colm	4
	synt	if
	mark0
	pnull
	var	6
	pnull
	pnull
	var	0
	int	0
	line	143
	colm	14
	synt	any
	subsc
	line	143
	colm	12
	synt	any
	size
	line	143
	colm	9
	synt	any
	numne
	unmark
	var	9
	str	1
	line	143
	colm	27
	synt	any
	invoke	1
	line	143
	colm	4
	synt	endif
	unmark
lab L2
	mark	L3
	pnull
	var	1
	var	10
	var	0
	line	145
	colm	21
	synt	any
	invoke	1
	line	145
	colm	7
	synt	any
	asgn
	unmark
lab L3
	mark	L4
	pnull
	var	2
	var	11
	var	6
	var	6
	line	146
	colm	24
	synt	any
	invoke	2
	line	146
	colm	6
	synt	any
	asgn
	unmark
lab L4
	mark	L5
	pnull
	var	3
	var	12
	var	6
	int	2
	line	147
	colm	13
	synt	any
	invoke	2
	line	147
	colm	6
	synt	any
	asgn
	unmark
lab L5
	mark	L6
	pnull
	var	4
	mark	L7
	var	13
	var	1
	var	3
	line	152
	colm	18
	synt	any
	invoke	2
	line	152
	colm	26
	synt	any
	esusp
	goto	L8
lab L7
	var	9
	str	3
	line	152
	colm	32
	synt	any
	invoke	1
lab L8
	line	152
	colm	6
	synt	any
	asgn
	unmark
lab L6
	mark	L9
	line	154
	colm	4
	synt	every
	mark0
	pnull
	var	8
	pnull
	int	0
	var	6
	push1
	line	154
	colm	17
	synt	any
	toby
	line	154
	colm	12
	synt	any
	asgn
	pop
	mark0
	mark	L12
	pnull
	var	7
	var	12
	var	6
	line	155
	colm	16
	synt	any
	invoke	1
	line	155
	colm	9
	synt	any
	asgn
	unmark
lab L12
	mark	L13
	line	156
	colm	7
	synt	every
	mark0
	pnull
	var	5
	pnull
	int	0
	var	6
	push1
	line	156
	colm	20
	synt	any
	toby
	line	156
	colm	15
	synt	any
	asgn
	pop
	mark0
	pnull
	pnull
	var	7
	var	5
	line	157
	colm	11
	synt	any
	subsc
	pnull
	pnull
	var	2
	var	5
	line	157
	colm	19
	synt	any
	subsc
	var	8
	line	157
	colm	22
	synt	any
	subsc
	line	157
	colm	15
	synt	any
	asgn
	unmark
lab L14
	efail
lab L15
	line	156
	colm	7
	synt	endevery
	unmark
lab L13
	mark	L16
	var	14
	var	1
	var	3
	var	7
	line	158
	colm	18
	synt	any
	invoke	3
	unmark
lab L16
	line	159
	colm	7
	synt	every
	mark0
	pnull
	var	5
	pnull
	int	0
	var	6
	push1
	line	159
	colm	20
	synt	any
	toby
	line	159
	colm	15
	synt	any
	asgn
	pop
	mark0
	pnull
	pnull
	pnull
	var	2
	var	5
	line	160
	colm	11
	synt	any
	subsc
	var	8
	line	160
	colm	14
	synt	any
	subsc
	pnull
	var	7
	var	5
	line	160
	colm	22
	synt	any
	subsc
	line	160
	colm	18
	synt	any
	asgn
	unmark
lab L17
	efail
lab L18
	line	159
	colm	7
	synt	endevery
	unmark
lab L10
	efail
lab L11
	line	154
	colm	4
	synt	endevery
	unmark
lab L9
	mark	L19
	mark	L20
	var	2
	line	163
	colm	4
	synt	any
	pret
lab L20
	synt	any
	pfail
	unmark
lab L19
	pnull
	line	165
	colm	1
	synt	any
	pfail
	end
proc determinant
	local	0,001000,M
	local	1,000020,M1
	local	2,000020,I
	local	3,000020,result
	local	4,000020,i
	local	5,000020,n
	local	6,000000,stop
	local	7,000000,copy_matrix
	local	8,000000,list
	local	9,000000,lu_decomp
	con	0,002000,1,1
	con	1,010000,21,052,052,052,040,155,141,164,162,151,170,040,156,157,164,040,163,161,165,141,162,145
	con	2,002000,1,0
	con	3,010000,19,052,052,052,040,163,151,156,147,165,154,141,162,040,155,141,164,162,151,170
	declend
	line	167
	colm	11
	synt	any
	mark	L1
	pnull
	var	5
	pnull
	var	0
	line	170
	colm	9
	synt	any
	size
	line	170
	colm	6
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	line	171
	colm	4
	synt	if
	mark0
	pnull
	var	5
	pnull
	pnull
	var	0
	int	0
	line	171
	colm	14
	synt	any
	subsc
	line	171
	colm	12
	synt	any
	size
	line	171
	colm	9
	synt	any
	numne
	unmark
	var	6
	str	1
	line	171
	colm	27
	synt	any
	invoke	1
	line	171
	colm	4
	synt	endif
	unmark
lab L2
	mark	L3
	pnull
	var	1
	var	7
	var	0
	line	173
	colm	21
	synt	any
	invoke	1
	line	173
	colm	7
	synt	any
	asgn
	unmark
lab L3
	mark	L4
	pnull
	var	2
	var	8
	var	5
	int	2
	line	174
	colm	13
	synt	any
	invoke	2
	line	174
	colm	6
	synt	any
	asgn
	unmark
lab L4
	mark	L5
	pnull
	var	3
	mark	L6
	var	9
	var	1
	var	2
	line	176
	colm	23
	synt	any
	invoke	2
	line	176
	colm	31
	synt	any
	esusp
	goto	L7
lab L6
	var	6
	str	3
	line	176
	colm	37
	synt	any
	invoke	1
lab L7
	line	176
	colm	11
	synt	any
	asgn
	unmark
lab L5
	mark	L8
	line	178
	colm	4
	synt	every
	mark0
	pnull
	var	4
	pnull
	int	0
	var	5
	push1
	line	178
	colm	17
	synt	any
	toby
	line	178
	colm	12
	synt	any
	asgn
	pop
	mark0
	pnull
	var	3
	dup
	pnull
	pnull
	var	1
	var	4
	line	179
	colm	20
	synt	any
	subsc
	var	4
	line	179
	colm	23
	synt	any
	subsc
	line	179
	colm	14
	synt	any
	mult
	asgn
	unmark
lab L9
	efail
lab L10
	line	178
	colm	4
	synt	endevery
	unmark
lab L8
	mark	L11
	mark	L12
	var	3
	line	181
	colm	4
	synt	any
	pret
lab L12
	synt	any
	pfail
	unmark
lab L11
	pnull
	line	183
	colm	1
	synt	any
	pfail
	end
