Permanent(n, R)ΒΆ
perman.spad line 73 [edit on github]
R: Join(Ring, CommutativeStar)
Permanent implements the functions permanent, the permanent for square matrices.
- permanent: SquareMatrix(n, R) -> R
permanent(x)
computes the permanent of a square matrixx
. The permanent is equivalent to the determinant except that coefficients have no change of sign. This function is much more difficult to compute than the determinant. The formula used is byH
.J
. Ryser, improved by [Nijenhuis and Wilf,Ch
. 19]. Note: permanent(x
) choose one of three algorithms, depending on the underlying ringR
and onn
, the number of rows (and columns) ofx:
begin{items} item 1. if 2 has an inverse inR
we can use the algorithm of [Nijenhuis and Wilf,ch
.19,p
.158]; if 2 has no inverse, some modifications are necessary: item 2. if n > 6 andR
is an integral domain with characteristic different from 2 (the algorithm works if and only 2 is not a zero-divisor ofR
and characteristic()$R ~= 2, but how to check that for any givenR
?), the local function permanent2 is called; item 3. else, the local function permanent3 is called (works for all commutative ringsR
). end{items}