[Main]
Name=lead_term_index
Type=Function
Subtype=ROM Call
Header Files=estack.h
Definition=ESI lead_term_index (CESI ptr);
Attributes=__attribute__((__pure__))
MinAMS=1.01

[ROM Call]
Index=$2E1

[Description]
Gets the index of the lead term of an expression.

[Explanation]
If <I>ptr</I> points to the <A HREF="$$LINK(Tags)">ADD_TAG</A>, which is a case when it
points to an expression of form <I>term1</I>&nbsp;+&nbsp;<I>term2</I>&nbsp;+&nbsp;<B>...</B>
(i.e. if the expression is a sum of simpler terms), lead_term_index returns the pointer
to <I>term1</I> (i.e. to the lead term). If <I>ptr</I> does not point to the
<A HREF="$$LINK(Tags)">ADD_TAG</A> (i.e. if the expression is not a sum of simpler terms),
lead_term_index returns <I>ptr</I> (i.e. the pointer to the expression itself).
<BR><BR>
<B>Note:</B> Expressions in internal canonic form have the most main term shallowest, with less main
terms deeper (see <A HREF="$$LINK(compare_expressions)">compare_expressions</A> about more info about
"main" ordering). Also, the lead term of an internally-simplified sum is never a sum.
For example, the lead term of <CODE>'(2+x)+y'</CODE> converted to canonic form is <CODE>'x'</CODE>.
By default, similar powers of the main variable are collected in internal canonic forms.
For example, the lead term of <CODE>'x^2*y+x^2+5'</CODE> converted to canonic form is
<CODE>'x^2*(y+1)'</CODE>. See <A HREF="$$LINK(push_internal_simplify)">push_internal_simplify</A>
for more info about how to convert an expression into the internal canonic form.

[References]
In=index_of_lead_base_of_lead_term, basfunc.h/did_push_anti_deriv, basfunc.h/did_push_series, basfunc.h/push_1st_derivative, basfunc.h/push_abs, basfunc.h/push_acosh, basfunc.h/push_asin, basfunc.h/push_asinh, basfunc.h/push_atan, basfunc.h/push_atanh, basfunc.h/push_comdenom, basfunc.h/push_csolve, basfunc.h/push_czeros, basfunc.h/push_def_int, basfunc.h/push_desolve, basfunc.h/push_expand, basfunc.h/push_extended_prod, basfunc.h/push_factor, basfunc.h/push_floor, basfunc.h/push_lim, basfunc.h/push_max, basfunc.h/push_min, basfunc.h/push_nsolve, basfunc.h/push_phase, basfunc.h/push_sign, basfunc.h/push_sin2, basfunc.h/push_solve, basfunc.h/push_summation, basfunc.h/push_zeros, basop.h/did_push_to_polar, basop.h/push_equals, basop.h/push_exponentiate, basop.h/push_greater_than, basop.h/push_greater_than_or_equals, basop.h/push_less_than, basop.h/push_less_than_or_equals, basop.h/push_negate, basop.h/push_not_equals, basop.h/push_product, basop.h/push_sum, basop.h/push_to_cylin, basop.h/push_to_sphere, add_to_top, unknown.h/get_ub, unknown.h/index_if_pushed_binomial_info, unknown.h/index_reductum_with_tag_base, unknown.h/push_but_term, unknown.h/push_constant_terms, unknown.h/push_dependent_terms, unknown.h/push_gcd_then_cofactors, unknown.h/push_independent_terms, unknown.h/push_make_proper, unknown.h/push_nonconstant_terms, unknown.h/push_poly_qr, unknown.h/push_reciprocal, unknown.h/push_standardize, unknown.h/replace_top_with_post_simplified, unknown.h/replace_top2_with_sum
