summaryrefslogtreecommitdiff
path: root/series.mac
diff options
context:
space:
mode:
Diffstat (limited to 'series.mac')
-rw-r--r--series.mac15
1 files changed, 11 insertions, 4 deletions
diff --git a/series.mac b/series.mac
index ec4cb50..e2bc241 100644
--- a/series.mac
+++ b/series.mac
@@ -271,18 +271,25 @@ expand_term(expr, coeffs) := block(
/* Solve main equations term by term */
+print_progress : false;
+
/* TODO: Divide and conquer on term list for long expansions */
/* coeffs: facts already known about series expansions */
/* Series expansion inside each instance of a value in the terms of an equation
*/
-expand_equation(expr, coeffs) := block(
- [len, terms],
+expand_equation(expr, coeffs) := (
expr : rhs(expr) - lhs(expr),
0 = if atom(expr) then (
expr)
- elseif op(expr)="+" then (
- apply("+", map(lambda([term], expand_term(term, coeffs)), args(expr))))
+ elseif op(expr)="+" then block(
+ [i : 0, len : length(args(expr))],
+ apply("+", map(lambda([term],
+ i : i+1,
+ if print_progress then (
+ printf(true, "expand_equation [~a/~a]~%", i, len)),
+ expand_term(term, coeffs)),
+ args(expr))))
else (
expand_term(expr, coeffs)))$