diff options
Diffstat (limited to 'src/util.maple')
-rw-r--r-- | src/util.maple | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/util.maple b/src/util.maple index 958ab05..500a7b4 100644 --- a/src/util.maple +++ b/src/util.maple @@ -68,8 +68,8 @@ proc( algebraic, name = algebraic, list({algebraic, name = algebraic}), set ({algebraic, name = algebraic}) - }, - inert_fn::{name, procedure} + } + #inert_fn::{name, procedure} ) local nn, k, base, power, fbase, fpower, @@ -77,18 +77,18 @@ local nn, k, num, den, mult; # do we want to convert this expression? -if ((nargs >= 2) and inert_fn(expr, args[3..nargs])) - then return expr; -end if; +#if ((nargs >= 2) and inert_fn(expr, args[3..nargs])) +# then return expr; +#end if; # recurse over lists and sets if (type(expr, {list,set})) - then return map(fix_rationals, expr, args[2..nargs]); + then return map(fix_rationals, expr); end if; # recurse over equation right hand sides if (type(expr, name = algebraic)) - then return ( lhs(expr) = fix_rationals(rhs(expr), args[2..nargs]) ); + then return ( lhs(expr) = fix_rationals(rhs(expr)) ); end if; # recurse over functions other than RATIONAL() @@ -98,7 +98,7 @@ if (type(expr, function)) if (fn <> 'RATIONAL') then fn_args_list := [op(expr)]; - fn_args_list := map(fix_rationals, fn_args_list, args[2..nargs]); + fn_args_list := map(fix_rationals, fn_args_list); fn; return '%'( op(fn_args_list) ); end if; end if; @@ -107,7 +107,7 @@ nn := nops(expr); # recurse over sums if (type(expr, `+`)) - then return sum('fix_rationals(op(k,expr), args[2..nargs])', 'k'=1..nn); + then return sum('fix_rationals(op(k,expr))', 'k'=1..nn); end if; # recurse over products @@ -115,9 +115,8 @@ end if; if (type(expr, `*`)) then if (op(1, expr) = -1) - then return -1*fix_rationals(remove(type, expr, 'identical(-1)'), - args[2..nargs]); - else return product('fix_rationals(op(k,expr), args[2..nargs])', + then return -1*fix_rationals(remove(type, expr, 'identical(-1)')); + else return product('fix_rationals(op(k,expr))', 'k'=1..nn); end if; end if; @@ -129,10 +128,10 @@ if (type(expr, `^`)) base := op(1, expr); power := op(2, expr); - fbase := fix_rationals(base, args[2..nargs]); + fbase := fix_rationals(base); if (type(power, integer)) then fpower := power; - else fpower := fix_rationals(power, args[2..nargs]); + else fpower := fix_rationals(power); end if; return fbase ^ fpower; end if; @@ -154,7 +153,7 @@ if (type(expr, float)) then mult := op(1, expr); power := op(2, expr); - return fix_rationals(mult * 10^power, args[2..nargs]); + return fix_rationals(mult * 10^power); end if; # identity op on names |