bridge/class-master/depend/pari/src/basemath/concat.c
/* concat A and B vertically. Internal */
concat A and B vertically. Internal
concat A and B vertically . Internal
GEN
vconcat(GEN A, GEN B)
{
  long la, ha, hb, hc, i, j, T;
  GEN M, a, b, c;
  if (!A) return B;
  if (!B) return A;
  la = lg(A); if (la==1) return B;
  T = typ(gel(A,1)); 
  ha = lgcols(A); M = cgetg(la,t_MAT);
  hb = lgcols(B); hc = ha+hb-1;
  for (j=1; j<la; j++)
  {
    c = cgetg(hc, T); gel(M, j) = c;
    a = gel(A,j);
    b = gel(B,j);
    for (i=1; i<ha; i++) *++c = *++a;
    for (i=1; i<hb; i++) *++c = *++b;
  }
  return M;
}
GEN vconcat ( GEN A , GEN B ) { long la , ha , hb , hc , i , j , T ; GEN M , a , b , c ; if ( ! A ) return B ; if ( ! B ) return A ; la = lg ( A ) ; if ( la == 1 ) return B ; T = typ ( gel ( A , 1 ) ) ; ha = lgcols ( A ) ; M = cgetg ( la , t_MAT ) ; hb = lgcols ( B ) ; hc = ha + hb - 1 ; for ( j = 1 ; j < la ; j ++ ) { c = cgetg ( hc , T ) ; gel ( M , j ) = c ; a = gel ( A , j ) ; b = gel ( B , j ) ; for ( i = 1 ; i < ha ; i ++ ) * ++ c = * ++ a ; for ( i = 1 ; i < hb ; i ++ ) * ++ c = * ++ b ; } return M ; }
concat A and B vertically.
concat A and B vertically .
/* t_COL or t_VECSMALL */