Determinant and permanent: Difference between revisions

m
(+Stata)
Line 2,128:
Two auxiliary functions: '''range1(n,i)''' returns the column vector with numbers 1 to n except i is removed.
And '''submat(a,i,j)''' returns matrix a with row i and column j removed.
For x=-1, the main function '''sumrec(a,x)''' computes the determinant of a by developpingdeveloping the determinant along the first column. For x=1, one gets the permanent.
 
<lang>real vector range1(real scalar n, real scalar i) {
1,336

edits