How to generate all posible matrices with some conditions on the elements?
I need to make for given $n$ all $n\times n$ matrices $A=(a_{ij})$ with three conditions:
I. $a_{ij}=+1$ or $0$ or $-1$.
II. $a_{ij}=-a_{ji}$
III. if $a_{ij}\geq 0$ and $a_{jk}\geq 0$, then $a_{ik}\geq 0$; and $a_{ik}=0$ only if $a_{ij}=a_{jk}=0$
The only way I see is to expand these three conditions to equivalent but more elementary eight IF/ELSE conditions:
1) if $a_{ij}=+1$, then $a_{ji}=-1$
2) if $a_{ij}=+1$ and $a_{jk}=+1$, then $a_{ik}=+1$
3) $a_{ii}=0$
4) if $a_{ij}=0$, then $a_{ji}=0$
5) if $a_{ij}=0$ and $a_{jk}=0$, then $a_{ik}=0$
6) if $a_{ij}=+1$ and $a_{jk}=0$, then $a_{ik}=+1$
7) if $a_{ij}=0$ and $a_{jk}=+1$, then $a_{ik}=+1$
8) $a_{ij}=+1$ or $0$ or $-1$
And to generate for given $n$ all possible matrices, make it antisymmetric, then make all permutates of $+1$, $0$, $-1$; and after that deleting unnecessary cases with help of cycles. But it quickly became too complicated. Is there any more natural way?
PS this problem arised from this SE question and appeals to this book.