bridge/class-master/depend/pari/src/basemath/gen2.c
/* as gcmp for vector/matrices, using lexicographic ordering on components */
as gcmp for vector/matrices, using lexicographic ordering on components
as gcmp for vector / matrices using lexicographic ordering on components
int
lexcmp(GEN x, GEN y)
{
  const long tx = roughtype(x), ty = roughtype(y);
  if (tx == ty)
    switch(tx)
    {
      case t_MAT:
      case t_VEC:
        return lexcmp_similar(x,y);
      case t_VECSMALL:
        return vecsmall_lexcmp(x,y);
      default:
        return gcmp(x,y);
    }
  if (tx == t_VECSMALL) return  lexcmp_vecsmall_other(x,y,ty);
  if (ty == t_VECSMALL) return -lexcmp_vecsmall_other(y,x,tx);
  if (tx == t_INT) return  lexcmp_scal_matvec(x,y); 
  if (ty == t_INT) return -lexcmp_scal_matvec(y,x);
  if (ty==t_MAT) return  lexcmp_vec_mat(x,y);
    return -lexcmp_vec_mat(y,x);
}
int lexcmp ( GEN x , GEN y ) { const long tx = roughtype ( x ) , ty = roughtype ( y ) ; if ( tx == ty ) switch ( tx ) { case t_MAT : case t_VEC : return lexcmp_similar ( x , y ) ; case t_VECSMALL : return vecsmall_lexcmp ( x , y ) ; default : return gcmp ( x , y ) ; } if ( tx == t_VECSMALL ) return lexcmp_vecsmall_other ( x , y , ty ) ; if ( ty == t_VECSMALL ) return - lexcmp_vecsmall_other ( y , x , tx ) ; if ( tx == t_INT ) return lexcmp_scal_matvec ( x , y ) ; if ( ty == t_INT ) return - lexcmp_scal_matvec ( y , x ) ; if ( ty == t_MAT ) return lexcmp_vec_mat ( x , y ) ; return - lexcmp_vec_mat ( y , x ) ; }
as gcmp for vector/matrices, using lexicographic ordering on components
as gcmp for vector / matrices using lexicographic ordering on components
/*scalar*/ /*tx==t_MAT*/