Revision: 5095
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5095&view=rev
Author:   mmetz_bn
Date:     2008-04-29 06:21:48 -0700 (Tue, 29 Apr 2008)

Log Message:
-----------
fixed bug in mlab.sqrtm; numpy.linalg.eig behaves different than Numeric did

Modified Paths:
--------------
    branches/v0_91_maint/CHANGELOG
    branches/v0_91_maint/lib/matplotlib/mlab.py

Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG      2008-04-28 19:17:31 UTC (rev 5094)
+++ branches/v0_91_maint/CHANGELOG      2008-04-29 13:21:48 UTC (rev 5095)
@@ -1,3 +1,5 @@
+2008-04-29 Fix bug in mlab.sqrtm - MM
+
 2008-04-28 Fix bug in SVG text with Mozilla-based viewers (the symbol
            tag is not supported) - MGD
 

Modified: branches/v0_91_maint/lib/matplotlib/mlab.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/mlab.py 2008-04-28 19:17:31 UTC (rev 
5094)
+++ branches/v0_91_maint/lib/matplotlib/mlab.py 2008-04-29 13:21:48 UTC (rev 
5095)
@@ -1901,7 +1901,7 @@
 def sqrtm(x):
     """
     Returns the square root of a square matrix.
-    This means that s=sqrtm(x) implies s*s = x.
+    This means that s=sqrtm(x) implies dot(s,s) = x.
     Note that s and x are matrices.
     """
     return mfuncC(npy.sqrt, x)
@@ -1914,9 +1914,10 @@
     """
 
     x      = npy.asarray(x)
-    (v, u) = npy.linalg.eig(x)
-    uT     = u.transpose()
+    (v,uT) = npy.linalg.eig(x)
     V      = npy.diag(f(v+0j))
+    # todo: warning: this is not exactly what matlab does
+    #       MATLAB "B/A is roughly the same as B*inv(A)"
     y      = npy.dot(uT, npy.dot(V, npy.linalg.inv(uT)))
     return approx_real(y)
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to