Rev 3265 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
!if $wims_read_parm!=slib_header
!goto proc
!endif
slib_title=Generates a random orthogonal matrix
slib_parms=3\
2,matrix size m\
4, N coefficient range\
2,product of n reflexions
Q,coefficient ring: Q for the time being ,R,C,G (Gauss ring)
slib_author=Bernadette PERRIN-RIOU
slib_out=the generated matrix
slib_comment= product of n reflexions associated to n independant linear vectors (so its determinant is (-1)^n), the vector coefficients are bounded by N
slib_example= 4,3,3
!exit
:proc
!distribute items $wims_read_parm into slib_size,slib_range,slib_n, slib_ring
!default slib_ring=Q
!bound slib_size between integer 2 and 20 default 2
!bound slib_n between integer 1 and $slib_size default 2
!bound slib_range between integer 1 and 1000000
!default slib_range=4
!if $slib_ring=Q
!readproc slib/matrix/givenrank $slib_n,$slib_size,$slib_n,$slib_range
!!slib_matrix=!translate internal ; to $\
$ in $slib_out
slib_matrix=$slib_out
slib_out=!exec pari {slib_A=matid($slib_size);slib_n=$slib_n; \\
slib_M= Mat([$slib_matrix]);\\
for(slib_j=1 , slib_n,slib_vv=slib_M[slib_j,]; slib_A=slib_A*(matid($slib_size)-2/norml2(slib_vv)*slib_vv~*slib_vv));\\
print(slib_A)}
slib_out= !trim $slib_out
slib_out=!line -1 of $slib_out
!endif