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

[ROM Call]
Index=$2E0

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

[Explanation]
If <I>ptr</I> points to the <A HREF="$$LINK(estack.h/Tags)">MUL_TAG</A>, which is the case when it
points to an expression of form <I>factor1</I>&nbsp;*&nbsp;<I>factor2</I>&nbsp;*&nbsp;<B>...</B>
(i.e. if the expression is a product of simpler factors), lead_factor_index returns the pointer
to <I>factor1</I> (i.e. to the lead factor). If <I>ptr</I> does not point to the
<A HREF="$$LINK(estack.h/Tags)">MUL_TAG</A> (i.e. if the expression is not a product of simpler factors),
lead_factor_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 factor shallowest, with less main factors deeper
(see <A HREF="$$LINK(estack.h/compare_expressions)">compare_expressions</A> for more info about "main"
ordering). Also, the lead factor of an internally-simplified product is never a product.
For example, lead factor of <CODE>'(3*x^2)*y'</CODE> converted into canonic form is
<CODE>'x^2'</CODE>. Internally-simplified numeric denominator factors are combined with
numeric numerator factors into a fractional numeric factor. Non-numeric denominator
factors are internally simplified to be merged with numerator factors as negative powers.
For example, the lead factor of <CODE>'2/x'</CODE> converted into canonic form is
<CODE>'x^-1'</CODE>. A factor having a sum as its base orders shallower than a factor
having the sum’s main variable as its base. For example, the lead factor
of <CODE>'(x+1)^-2*x^3'</CODE> converted into canonic form is <CODE>'(x+1)^-2'</CODE>.
See <A HREF="$$LINK(estack.h/push_internal_simplify)">push_internal_simplify</A>
for more info about how to convert an expression into the internal canonic form.

[References]
In=estack.h/is_monomial_in_kernel, estack.h/lead_base_index, estack.h/lead_exponent_index, basfunc.h/did_push_anti_deriv, basfunc.h/did_push_series, basfunc.h/push_1st_derivative, basfunc.h/push_comdenom, basfunc.h/push_csolve, basfunc.h/push_czeros, basfunc.h/push_def_int, basfunc.h/push_denominator, basfunc.h/push_desolve, basfunc.h/push_expand, basfunc.h/push_extended_prod, basfunc.h/push_factor, basfunc.h/push_floor, basfunc.h/push_im, basfunc.h/push_lim, basfunc.h/push_ln, basfunc.h/push_max, basfunc.h/push_min, basfunc.h/push_nsolve, basfunc.h/push_numerator, basfunc.h/push_phase, basfunc.h/push_re, 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, estack.h/add_to_top, unknown.h/are_units_consistent, unknown.h/get_ub, unknown.h/index_if_pushed_qquad_info, unknown.h/index_rmng_factor, unknown.h/index_rmng_fctrs_start_fctr_tag, estack.h/is_negative, estack.h/is_nonnegative, estack.h/is_nonpositive, estack.h/is_positive, unknown.h/is_term_improper, unknown.h/push_auto_units_conversion, unknown.h/push_but_factor, unknown.h/push_but_term, unknown.h/push_constant_factors, unknown.h/push_constant_terms, unknown.h/push_dependent_factors, unknown.h/push_dependent_terms, unknown.h/push_gcd_then_cofactors, unknown.h/push_independent_factors, unknown.h/push_independent_terms, unknown.h/push_make_proper, unknown.h/push_nonconstant_factors, unknown.h/push_nonconstant_terms, unknown.h/push_nonnumeric_factors, unknown.h/push_poly_qr, unknown.h/push_reciprocal, unknown.h/push_standardize, unknown.h/raise_to_top, unknown.h/replace_top_with_post_simplified, unknown.h/replace_top2_with_pow, unknown.h/replace_top2_with_sum, unknown.h/_ROM_CALL_48D
