bridge/class-master/depend/pari/src/basemath/qfisom.c
/* returns scalar product of vectors x and y with respect to Gram-matrix F */
returns scalar product of vectors x and y with respect to Gram-matrix F
returns scalar product of vectors x and y with respect to Gram - matrix F
static long
scp(GEN x, GEN F, GEN y)
{
  long i, j;
  ulong sum = 0;
  long n = lg(F)-1;
  for (i = 1; i <= n; ++i)
  {
    ulong xi = uel(x,i);
    if (xi)
    {
      GEN Fi = gel(F, i);
      for (j = 1; j <= n; ++j)
        sum += xi * uel(Fi,j) * uel(y,j);
    }
  }
  return sum;
}
static long scp ( GEN x , GEN F , GEN y ) { long i , j ; ulong sum = 0 ; long n = lg ( F ) - 1 ; for ( i = 1 ; i <= n ; ++ i ) { ulong xi = uel ( x , i ) ; if ( xi ) { GEN Fi = gel ( F , i ) ; for ( j = 1 ; j <= n ; ++ j ) sum += xi * uel ( Fi , j ) * uel ( y , j ) ; } } return sum ; }
returns scalar product of vectors x and y with respect to Gram-matrix F
returns scalar product of vectors x and y with respect to Gram - matrix F