bridge/class-master/depend/pari/src/language/intnum.c
/* Assigns the values of the function weighted by w[k] at quadrature points x[k]
 * [replacing the weights]. Return the index of the last non-zero coeff */
Assigns the values of the function weighted by w[k] at quadrature points x[k]
[replacing the weights]. Return the index of the last non-zero coeff
Assigns the values of the function weighted by w [ k ] at quadrature points x [ k ] [ replacing the weights ] . Return the index of the last non - zero coeff
static long
weight(void *E, GEN (*eval)(void *, GEN), GEN x, GEN w)
{
  long k, l = lg(x);
  for (k = 1; k < l; k++) gel(w,k) = gmul(gel(w,k), eval(E, gel(x,k)));
  k--; while (k >= 1) if (!gequal0(gel(w,k--))) break;
  return k;
}
static long weight ( void * E , GEN ( * eval ) ( void * , GEN ) , GEN x , GEN w ) { long k , l = lg ( x ) ; for ( k = 1 ; k < l ; k ++ ) gel ( w , k ) = gmul ( gel ( w , k ) , eval ( E , gel ( x , k ) ) ) ; k -- ; while ( k >= 1 ) if ( ! gequal0 ( gel ( w , k -- ) ) ) break ; return k ; }
Assigns the values of the function weighted by w[k] at quadrature points x[k]
 [replacing the weights].
Assigns the values of the function weighted by w [ k ] at quadrature points x [ k ] [ replacing the weights ] .