diff options
| author | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-07-22 23:07:55 +0200 |
|---|---|---|
| committer | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-07-22 23:07:55 +0200 |
| commit | 1bae52f590f3c34a41bcf25bc8ba62e8ab7f5220 (patch) | |
| tree | 5960d23c33990baa1223fe0cbaf38f3d00ee46be /series.mac | |
| parent | bf3c49ef7d1e4ea97b1f1f5828b1fc9f4e1cb6ca (diff) | |
Add optional progress message in series expansion
Diffstat (limited to 'series.mac')
| -rw-r--r-- | series.mac | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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)))$ |
