From 6c8c727709ab6e342f9b2dfa440a88e6ae35fcf5 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 18 Sep 2015 21:49:26 -0400 Subject: [PATCH] Remove matrix_subs_expr() now that subs() absorbed its features. --- mjo/symbolic.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/mjo/symbolic.py b/mjo/symbolic.py index 0afd5a5..3760596 100644 --- a/mjo/symbolic.py +++ b/mjo/symbolic.py @@ -46,48 +46,6 @@ def safe_simplify(expr): return expr -def matrix_subs_expr(m, *equations): - """ - Symbolic matrices have a `subs()` method, but no `subs_expr()`. - This makes it diffucult to substitute in a list of solutions obtained - with `solve()`. - - INPUT: - - - ``m`` -- A symbolic matrix. - - - ``equations`` - One or more symbolic equations, presumably for - the entries of `m`. - - OUTPUT: - - The result of substituting each equation into `m`, one after another. - - EXAMPLES:: - - sage: w,x,y,z = SR.var('w,x,y,z') - sage: A = matrix(SR, [[w,x],[y,z]]) - sage: matrix_subs_expr(A, w == 1, x == 2, y == 3, z == 4) - [1 2] - [3 4] - - """ - from sage.symbolic.expression import is_SymbolicEquation - - if not m.base_ring() == SR: - raise TypeError, 'the matrix "m" must be symbolic' - - if isinstance(equations[0], dict): - eq_dict = equations[0] - equations = [ x == eq_dict[x] for x in eq_dict.keys() ] - - if not all([is_SymbolicEquation(eq) for eq in equations]): - raise TypeError, "each expression must be an equation" - - d = dict([(eq.lhs(), eq.rhs()) for eq in equations]) - return m.subs(d) - - def matrix_simplify_full(A): """ Simplify each entry of a symbolic matrix using the -- 2.44.2