bridge/class-master/depend/pari/src/basemath/mftrace.c
/* merge two vector of fmt_dim's for the same vector of characters. If CHI
 * is not NULL, remove dim-0 spaces and add character from CHI */
merge two vector of fmt_dim's for the same vector of characters. If CHI
is not NULL, remove dim-0 spaces and add character from CHI
merge two vector of fmt_dim ' s for the same vector of characters . If CHI is not NULL remove dim - 0 spaces and add character from CHI
static GEN
merge_dims(GEN V, GEN W, GEN CHI)
{
  long i, j, id, l = lg(V);
  GEN A = cgetg(l, t_VEC);
  if (l == 1) return A;
  id = CHI? 1: 3;
  for (i = j = 1; i < l; i++)
  {
    GEN v = gel(V,i), w = gel(W,i);
    long dv = itou(gel(v,id)), dvh = itou(gel(v,id+1)), d;
    long dw = itou(gel(w,id)), dwh = itou(gel(w,id+1));
    d = dv + dw;
    if (d || CHI)
      gel(A,j++) = CHI? fmt_dim(gel(CHI,i),d, dvh+dwh)
                      : mkvec2s(d,dvh+dwh);
  }
  setlg(A, j); return A;
}
static GEN merge_dims ( GEN V , GEN W , GEN CHI ) { long i , j , id , l = lg ( V ) ; GEN A = cgetg ( l , t_VEC ) ; if ( l == 1 ) return A ; id = CHI ? 1 : 3 ; for ( i = j = 1 ; i < l ; i ++ ) { GEN v = gel ( V , i ) , w = gel ( W , i ) ; long dv = itou ( gel ( v , id ) ) , dvh = itou ( gel ( v , id + 1 ) ) , d ; long dw = itou ( gel ( w , id ) ) , dwh = itou ( gel ( w , id + 1 ) ) ; d = dv + dw ; if ( d || CHI ) gel ( A , j ++ ) = CHI ? fmt_dim ( gel ( CHI , i ) , d , dvh + dwh ) : mkvec2s ( d , dvh + dwh ) ; } setlg ( A , j ) ; return A ; }
merge two vector of fmt_dim's for the same vector of characters.
merge two vector of fmt_dim ' s for the same vector of characters .