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

[ROM Call]
Index=$2E2

[Description]
Searches an expression for a generalized variable.

[Explanation]
main_gen_var_index is a variant of <A HREF="$$LINK(index_main_var)">index_main_var</A>, but it
searches for a "generalized variable", which may also be a subexpression. For example,
if the expression is <CODE>'sin(x)+y'</CODE>, <A HREF="$$LINK(index_main_var)">index_main_var</A>
will return a pointer to <CODE>'x'</CODE>, but main_gen_var_index will return a pointer to
<CODE>'sin(x)'</CODE>. Generalized variable can be an ordinary variable, the base of a
noninteger power, or a kernel (like <CODE>'sin(x)'</CODE>), meaning any other irrational
subexpression.
<BR><BR>
More precise, main_gen_var_index skips all <A HREF="$$LINK(Tags)">ADD_TAG</A>,
<A HREF="$$LINK(Tags)">MUL_TAG</A> and <A HREF="$$LINK(Tags)">POW_TAG</A> tags, then stops at the
first tag which is not equal to some of them. In addition to this, if the tag is
<A HREF="$$LINK(Tags)">POW_TAG</A>, function <A HREF="$$LINK(next_expression_index)">next_expression_index</A>
will be called, to get access to the base of the power (note that "powers" cannot be
"reorganized" on such way that constants are always in front of variables, because <CODE>'2^x'</CODE>
and <CODE>'x^2'</CODE> are not the same expression). This implies that "main generalized variable"
of a sum, a product or an integer power is equal to the main generalized variable of a lead term,
a lead factor or a base respectively. Otherwise, main generalized variable is the expression
itself. For example, main "generalized variables" of expressions <CODE>'sin(x)^2*y+ln(z)'</CODE>,
<CODE>'3^(1/5)+2'</CODE> and <CODE>'(x+y)^(1/2)+x'</CODE> are <CODE>'sin(x)'</CODE>,
<CODE>'3'</CODE> and <CODE>'x+y'</CODE> respectively.

[References]
In=basfunc.h/did_push_anti_deriv, 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_desolve, basfunc.h/push_exp, 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_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, unknown.h/get_ub, unknown.h/is_term_improper, unknown.h/push_gcd_then_cofactors, unknown.h/push_make_proper, unknown.h/push_poly_qr, unknown.h/push_standardize, unknown.h/push_var_kern_tail
Out=next_expression_index, estack.h/is_whole_number
