how about we use same method for invert(A) as for A^^-1 ?
Subject: how about we use same method for invert(A) as for A^^-1 ?
From: Barton Willis
Date: Mon, 10 Dec 2012 17:39:31 +0000
Algorithmically, I don't feel the love for the adjoint method for matrix inversion. Is there a difference between
invert and ^^-1 when modulus # false? For blocked matrices, the two methods do something different. For
blocked matrices is one more correct than the other?
(%i1) m2() := genmatrix(lambda([i,j], random(42)),2,2);
(%o1) m2():=genmatrix(lambda([i,j],random(42)),2,2)
(%i2) m : matrix([m2(),m2()],[m2(), m2()]);
(%o2) matrix([matrix([8,0],[8,29]),matrix([16,13],[23,5])],[matrix([0,25],[13,17]),matrix([18,0],[41,0])])
(%i3) (matrix_element_mult : ".", matrix_element_transpose : 'transpose)$
(%i4) m . invert(m);
(%o4) matrix([matrix([-186817/31700,-621/1268],[-1691869/31700,-165/317]),matrix([-4966/34155,-55159/136620],[10711/11385,1651/9108])],[matrix([-41,-225/634],[-931/25,-1025/1268]),matrix([1051/1485,125/621],[15971/34155,254/621])])
(%i5) m . m^^-1;
(%o5) matrix([matrix([-140/29,249/65],[1153/29,36/13]),matrix([104/29,-1749/425],[-11083/522,8/25])],[matrix([1025/29,18/13],[5953/232,41/13]),matrix([-546/29,25/17],[-2201/174,38/25])])
This works the way I expect:
(%i6) m . invert_by_lu(m, noncommutingring);
(%o6) matrix([matrix([1,0],[0,1]),matrix([0,0],[0,0])],[matrix([0,0],[0,0]),matrix([1,0],[0,1])])
--Barton
________________________________________
From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.edu] on behalf of Robert Dodier [robert.dodier at gmail.com]
Sent: Monday, December 10, 2012 10:36
To: maxima at math.utexas.edu
Subject: how about we use same method for invert(A) as for A^^-1 ?
Hello, invert(A) computes the matrix inverse via the adjoint method,
while A^^-1 uses Gaussian elimination. Both of them can handle symbolic
expressions and CRE in addition to numbers. Is there any reason to
prefer the adjoint method? The adjoint method is much slower.
In any event, it seems messy to have invert(A) and A^^-1 use different
methods ....
There are other methods to compute a matrix inverse -- there are, at
least, tminverse (undocumented core function), invert_by_lu (share), and
probably one in LAPACK.
best,
Robert Dodier
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima