bridge/class-master/depend/pari/src/basemath/alglin1.c
/* Square of Hadamard bound for det(a), a square matrix.
 * Slightly improvement: instead of using the column norms, use the area of
 * the parallelogram formed by pairs of consecutive vectors */
Square of Hadamard bound for det(a), a square matrix.
Slightly improvement: instead of using the column norms, use the area of
the parallelogram formed by pairs of consecutive vectors
Square of Hadamard bound for det ( a ) a square matrix . Slightly improvement : instead of using the column norms use the area of the parallelogram formed by pairs of consecutive vectors
GEN
RgM_Hadamard(GEN a)
{
  pari_sp av = avma;
  long n = lg(a)-1, i;
  GEN B;
  if (n == 0) return gen_1;
  if (n == 1) return gsqr(gcoeff(a,1,1));
  a = RgM_gtofp(a, LOWDEFAULTPREC);
  B = gen_1;
  for (i = 1; i <= n/2; i++)
    B = gmul(B, parallelogramarea(gel(a,2*i-1), gel(a,2*i)));
  if (odd(n)) B = gmul(B, gnorml2(gel(a, n)));
  return gerepileuptoint(av, ceil_safe(B));
}
GEN RgM_Hadamard ( GEN a ) { pari_sp av = avma ; long n = lg ( a ) - 1 , i ; GEN B ; if ( n == 0 ) return gen_1 ; if ( n == 1 ) return gsqr ( gcoeff ( a , 1 , 1 ) ) ; a = RgM_gtofp ( a , LOWDEFAULTPREC ) ; B = gen_1 ; for ( i = 1 ; i <= n / 2 ; i ++ ) B = gmul ( B , parallelogramarea ( gel ( a , 2 * i - 1 ) , gel ( a , 2 * i ) ) ) ; if ( odd ( n ) ) B = gmul ( B , gnorml2 ( gel ( a , n ) ) ) ; return gerepileuptoint ( av , ceil_safe ( B ) ) ; }
Square of Hadamard bound for det(a), a square matrix.
Square of Hadamard bound for det ( a ) a square matrix .