As most people (on here at least) know a permutation matrix is a square binary matrix that has exactly one entry of 1 in each row and each column and 0s elsewhere. For the $n \times n$ case there are $n!$ permutation matrices.
A signed permutation matrix is a generalized permutation matrix whose nonzero entries are ±1 instead of just 1 as in a permutation matrix. For the $n \times n$ case there are $2^n n!$ signed permutation matrices.
So I wrote a little function to generate the signed permutation matrices for a given $n$.
spm[n_] := Module[
{n0 = n, spmlist, tuples},
tuples = Tuples[{-1, 1}, n0];
spmlist = {};
Do[
AppendTo[spmlist,
Map[Normal[#] &,
Map[SparseArray[Table[{i, i} -> tuples[[j, i]], {i, n0}]][[#]] &,
Permutations[Array[# &, n0]]]]],
{j, 1, Length@tuples}
];
Join @@ spmlist
]
Do[Print[i, " ", Length@spm[i]], {i, 2, 8}]
(*
2 8
3 48
4 384
5 3840
6 46080
7 645120
8 10321920
*)
This function works. But it looks a bit clunky to me. It's also slow (using AppendTo) though that doesn't concern me too much since I'll not need these for $n>6$ (maybe $n>7$ at a push).
The reason I posted this - does anyone know a less clunky/slicker way of doing this? I always learn something new when I ask a question like this.