bridge/class-master/depend/pari/src/basemath/ellisog.c
/* Given an elliptic curve E and a subgroup G of E, return the curve
 * E/G and, if only_image is zero, the isogeny corresponding
 * to the canonical surjection pi:E -> E/G. The variables vx and
 * vy are used to describe the isogeny (and are ignored if
 * only_image is zero). The subgroup G may be given either as
 * a generating point P on E or as a polynomial kerp whose roots are
 * the x-coordinates of the points in G */
Given an elliptic curve E and a subgroup G of E, return the curve
E/G and, if only_image is zero, the isogeny corresponding
to the canonical surjection pi:E -> E/G. The variables vx and
vy are used to describe the isogeny (and are ignored if
only_image is zero). The subgroup G may be given either as
a generating point P on E or as a polynomial kerp whose roots are
the x-coordinates of the points in G
Given an elliptic curve E and a subgroup G of E return the curve E / G and if only_image is zero the isogeny corresponding to the canonical surjection pi : E - > E / G . The variables vx and vy are used to describe the isogeny ( and are ignored if only_image is zero ) . The subgroup G may be given either as a generating point P on E or as a polynomial kerp whose roots are the x - coordinates of the points in G
GEN
ellisogeny(GEN E, GEN G, long only_image, long vx, long vy)
{
  pari_sp av = avma;
  GEN j, z;
  checkell(E);j = ell_get_j(E);
  if (vx < 0) vx = 0;
  if (vy < 0) vy = 1;
  if (varncmp(vx, vy) >= 0)
    pari_err_PRIORITY("ellisogeny", pol_x(vx), "<=", vy);
  if (!only_image && varncmp(vy, gvar(j)) >= 0)
    pari_err_PRIORITY("ellisogeny", j, ">=", vy);
  switch(typ(G))
  {
  case t_VEC:
    checkellpt(G);
    if (!ell_is_inf(G))
    {
      GEN x =  gel(G,1), y = gel(G,2);
      if (!only_image)
      {
        if (varncmp(vy, gvar(x)) >= 0)
          pari_err_PRIORITY("ellisogeny", x, ">=", vy);
        if (varncmp(vy, gvar(y)) >= 0)
          pari_err_PRIORITY("ellisogeny", y, ">=", vy);
      }
    }
    z = isogeny_from_kernel_point(E, G, only_image, vx, vy);
    break;
  case t_POL:
    if (!only_image && varncmp(vy, gvar(constant_coeff(G))) >= 0)
      pari_err_PRIORITY("ellisogeny", constant_coeff(G), ">=", vy);
    z = isogeny_from_kernel_poly(E, G, only_image, vx, vy);
    break;
  default:
    z = NULL;
    pari_err_TYPE("ellisogeny", G);
  }
  return gerepilecopy(av, z);
}
GEN ellisogeny ( GEN E , GEN G , long only_image , long vx , long vy ) { pari_sp av = avma ; GEN j , z ; checkell ( E ) ; j = ell_get_j ( E ) ; if ( vx < 0 ) vx = 0 ; if ( vy < 0 ) vy = 1 ; if ( varncmp ( vx , vy ) >= 0 ) pari_err_PRIORITY ( " " , pol_x ( vx ) , " " , vy ) ; if ( ! only_image && varncmp ( vy , gvar ( j ) ) >= 0 ) pari_err_PRIORITY ( " " , j , " " , vy ) ; switch ( typ ( G ) ) { case t_VEC : checkellpt ( G ) ; if ( ! ell_is_inf ( G ) ) { GEN x = gel ( G , 1 ) , y = gel ( G , 2 ) ; if ( ! only_image ) { if ( varncmp ( vy , gvar ( x ) ) >= 0 ) pari_err_PRIORITY ( " " , x , " " , vy ) ; if ( varncmp ( vy , gvar ( y ) ) >= 0 ) pari_err_PRIORITY ( " " , y , " " , vy ) ; } } z = isogeny_from_kernel_point ( E , G , only_image , vx , vy ) ; break ; case t_POL : if ( ! only_image && varncmp ( vy , gvar ( constant_coeff ( G ) ) ) >= 0 ) pari_err_PRIORITY ( " " , constant_coeff ( G ) , " " , vy ) ; z = isogeny_from_kernel_poly ( E , G , only_image , vx , vy ) ; break ; default : z = NULL ; pari_err_TYPE ( " " , G ) ; } return gerepilecopy ( av , z ) ; }
Given an elliptic curve E and a subgroup G of E, return the curve
 E/G and, if only_image is zero, the isogeny corresponding
 to the canonical surjection pi:E -> E/G.
Given an elliptic curve E and a subgroup G of E return the curve E / G and if only_image is zero the isogeny corresponding to the canonical surjection pi : E - > E / G .