Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Rupert Swarbrick <rswarbrick@us...>  20130414 13:07:19

This is an automated email from the git hooks/postreceive script. It was generated because a ref change was pushed to the repository containing the project "Maxima CAS". The branch, master has been updated via 566a0b8520c160fe99f1d1c9c2b19c1a2142b678 (commit) via f57ffe7b0fe24794fe30ba15a096b5a2e58c45ce (commit) from a0fe071997c8c39e5c88a5520800471139ee5fd5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.  Log  commit 566a0b8520c160fe99f1d1c9c2b19c1a2142b678 Author: Rupert Swarbrick <rswarbrick@...> Date: Sun Apr 14 14:06:28 2013 +0100 Fix variable capture bug in diag.mac We did have something of the form mat_function (f, A) := blah blah f(A) blah blah The problem is that if you bind f(x) := bar(x) somewhere else, it's used in preference to the f given as an argument. This is one fix. Another would be to use local(). diff git a/share/contrib/diag.mac b/share/contrib/diag.mac index 41027fd..3c28fb7 100644  a/share/contrib/diag.mac +++ b/share/contrib/diag.mac @@ 311,6 +311,7 @@ diag_mat_function_jordan (jordan, expr, var) := means of the associated Taylor series. */ mat_function (f, A) :=  block ([jordan: jordan (A), var: gensym(), modemat],  modemat: ModeMatrix (A, jordan),  modemat . diag_mat_function_jordan (jordan, f(var), var) . (modemat)^^(1))$ + block ([jj: jordan (A), var: gensym(), modemat], + modemat: ModeMatrix (A, jj), + modemat . diag_mat_function_jordan (jj, apply(f, [var]), var) + . (modemat)^^(1))$ commit f57ffe7b0fe24794fe30ba15a096b5a2e58c45ce Author: Rupert Swarbrick <rswarbrick@...> Date: Sun Apr 14 13:56:02 2013 +0100 Refactor mat_function to calculate blocks in a separate function. This makes tracing to check a bug a LOT easier, since conjugating by the mode matrix isn't really something I can do in my head... diff git a/share/contrib/diag.mac b/share/contrib/diag.mac index 95a1218..41027fd 100644  a/share/contrib/diag.mac +++ b/share/contrib/diag.mac @@ 270,25 +270,47 @@ diag_taylor_expand_block (coeffs, var, eigenvalue, size) := ( k, 1, size)))$ /* + Calculate the value of an analytic function on the matrix + represented by the Jordan list JORDAN. The function is given by EXPR + in VAR. +*/ +diag_mat_function_jordan (jordan, expr, var) := + block ([coeffs, blocks: [], + max_degree: lmax (map (second, jordan))  1], + /* + Expand f(var) about some arbitrary point as a Taylor series. The + Jordan matrix is diagonal plus a nilpotent matrix order one less + than the largest block. We need coefficients the same order as + that maximum block. + */ + coeffs: diag_taylor_coefficients (expr, var, max_degree), + /* + We calculate the value of EXPR on each Jordan block using + DIAG_TAYLOR_EXPAND_BLOCK. The degrees in JORDAN_LST are known to + be decreasing, so we can be slightly clever about not computing + things repeatedly. + */ + for jordan_lst in jordan do + block ([cached_block: + diag_taylor_expand_block (coeffs, var, + first (jordan_lst), + second (jordan_lst)), + cached_size: second(jordan_lst)], + for size in rest (jordan_lst) do + (if is (size # cached_size) then + (cached_size: size, + cached_block: + apply (matrix, + makelist ( + makelist (bigmat[i,j], j, 1, n), i, 1, n))), + blocks: cons (cached_block, blocks))), + diag (reverse (blocks)))$ + +/* Take an analytic function, f, and a matrix, A, and calculate f(A) by means of the associated Taylor series. */ mat_function (f, A) :=  block ([jordan: jordan (A),  var: gensym(),  coeffs, blocks: [], modemat],  coeffs: diag_taylor_coefficients (f(var), var,  lmax (map (second, jordan))  1),  for jordan_lst in jordan do  block ([bigmat: diag_taylor_expand_block (coeffs, var,  first (jordan_lst),  second (jordan_lst))],  for size in rest (jordan_lst) do  blocks:  cons (if is (size = second (jordan_lst)) then bigmat else  apply (matrix,  makelist (makelist (bigmat[i,j], j, 1, n), i, 1, n)),  blocks)),  /* Glue the blocks together and conjugate by the mode matrix */ + block ([jordan: jordan (A), var: gensym(), modemat], modemat: ModeMatrix (A, jordan),  modemat . diag (reverse (blocks)) . (modemat)^^(1))$ + modemat . diag_mat_function_jordan (jordan, f(var), var) . (modemat)^^(1))$  Summary of changes: share/contrib/diag.mac  59 +++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 18 deletions() hooks/postreceive  Maxima CAS 
Sign up for the SourceForge newsletter:
No, thanks