Rank: 59 based on 3412 downloads (last 30 days) and 16 files submitted
photo

Tim Davis

E-mail
Company/University
Univ of Florida
Lat/Long
29.648483, -82.34458

Personal Profile:

Professor, Univ of Florida. Member of the SIAM Council ( http://www.siam.org/about/board.php ). Author/co-author of many built-in sparse functions in MATLAB: UMFPACK (lu), CHOLMOD (chol), QR (SuiteSparseQR), COLAMD, SYMAMD, AMD, ETREE, DMPERM, SYMBFACT, and sparse matrix multiply. See also http://www.cise.ufl.edu/~davis . Much of this work is in my book "Direct Methods for Sparse Linear Systems", SIAM, Sept. 2006, which presents the theory and practice of sparse matrix algorithms, and discusses how MATLAB performs its sparse matrix computations. Additional features, latest versions, and better performance for sparse matrix operations in MATLAB can be obtained from my files posted at http://www.cise.ufl.edu/research/sparse .
Note that The MathWorks now requires files posted here to appear under a BSD License. I'm unable to change the licensing of some of my code (GNU GPL and LGPL). You can now find UMFPACK, CHOLMOD, SuiteSparse, etc. on my web page.

Professional Interests:
numerical linear algebra, sparse matrix algorithms, computational science, mathematical poetry

 

Watch this Author's files

 

Files Posted by Tim View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
10 Sep 2009 Gaussian Elimination Example (with partial pivoting): GEE, it's simple! A set of simple functions that illustrate Gaussian Elimination with partial pivoting Author: Tim Davis linear algebra, partial pivoting, tutorial, gaussian elimination, mathematics 545 2
  • 5.0
5.0 | 2 ratings
04 Jun 2009 Published M-Files Don't let that INV go past your eyes; to solve that system, FACTORIZE! A simple-to-use object-oriented method for solving linear systems and least-squares problems. Author: Tim Davis inverse, mrdivide, pinv, inv, backslash, linear algebra 251 7
  • 5.0
5.0 | 7 ratings
27 May 2009 LINFACTOR: uses LU or CHOL to factorize a matrix, or previously computed factors to solve Ax=b A simple M-file to solve Ax=b using LU or CHOL. Author: Tim Davis lu, inv, linfactor, linsolve, linear algebra, chol 228 2
  • 5.0
5.0 | 1 rating
19 Jan 2009 subsref2: often faster than subsref for C=A(i,j) when A is sparse subsref2 is a replacement for subsref, performing the computation C=A(i,j). Author: Tim Davis subsref, sparse 182 0
09 Sep 2008 Screenshot find_components finds the connected components of an image Author: Tim Davis connected components, image, dmperm, puzzler, morphology, segmentation 195 4
  • 4.2
4.2 | 5 ratings
Comments and Ratings by Tim View all
Updated File Comments Rating
25 Jun 2009 SmartInv Large sparse matrix inversion. Returns block diagonal, tridiagonal or pentadiagonal elements. Author: Rouzaud Denis

There's still something wrong with this submission. I computed the exact inverse of this matrix:

http://www.cise.ufl.edu/research/sparse/matrices/HB/bcsstk28.html

and then extracted the tridiagonal entries of the inversion (entries on the diagonal, subdiagonal, and +1 diagonal).

I then computed S = smartinv(A,1,'tri'), excepting to get the same thing.

But I don't I get a matrix with zeros on the +1 and -1 diagonals, every 15 entries or so. So this revised submission is still not computing what it says it computes.

24 Jun 2009 SmartInv Large sparse matrix inversion. Returns block diagonal, tridiagonal or pentadiagonal elements. Author: Rouzaud Denis

This function attempts to do the right thing when computing selected entries of the inverse, by solving a sequence of linear equations after doing an LU factorization. However, the implementation is flawed.

One suggestion: the statement [L,U,P]=lu(A) does not allow LU to permute A to improve sparsity. It would be better to use the 4-output LU, [L,U,P,Q]=lu(A), except in your case you'd need to use another name for Q since you have a Q variable already.

You would then need to use the column permutation Q in the forward/backsolve steps.

Including a "waitbar" in a function like this is not a good idea.

There seems to be a bug. The documentation says that s=smartinv(A) returns the diagonal of the inverse, but in fact I get the whole inverse back.

If I do s=smartinv(A,1), I get a diagonal matrix, but not the diagonal entries of the inverse, which is what the documentatioon said I would get. (I tried with this matrix, which is included in MATLAB):

load west0479
A=west0479;

With smartinv(A,1) or smartinv(A,1,'mono'), I should get the diagonal of inv(A) as the result, but I don't. SOmething else is returned.

Finally, the method is very slow. Computing the entire inverse takes 0.13 seconds using S=inv(A). Using S=smartinv(A) I get the same result, but it takes 15 seconds.

In the profiler, all the time is spent in this one line of code:

 Q(q0+1:q0+w,q0+1:q0+w) = insblock;

that's a very bad idea. You should never use sparse submatrix assignment, if at all possible. A better approach is to build the matrix all at once, from the blocks, using the "sparse" command.

So there appears to be at least three serious bugs in the code:
(1) does not perform according to the documentation (smartinv(A) returns inv(A), not diag(inv(A))).
(2) very slow as compared with just "inv"
(3) cannot compute the diagonal of the inverse, in spite of the fact that the documentation says it can do so. Instead it returns something else altogether.

And 2 serious drawbacks:
(1) Not really a bug, but a serious performance issue: doesn't allow for pivoting to maintain sparsity, and is thus unsuitable for large matrices.
(2) Remove the waitbar. If your function is used within other codes, the end user isn't interested in the "Inverting matrix..." message.

11 Dec 2008 fpermute Derives a matrix of all possible permutations of natural numbers 1, 2, ... , N for a given N Author: Michal

A few suggestions. First and foremost, this code needs commenting. You have to look at the output matrix to figure out what matrix it's computing. This code has no comments at all. That's really the main reason I give it a rating of 3.

The second reason is that it needs to be redesigned. Wouldn't it make more sense to provide a function that returns each of the n! permutations one at a time? The matrix itself is huge. fpermute(10) returns a (10!)-by-10 matrix, about 3.6 million by 10. Surely an application doesn't need all 3.6 million permutations at the same time.

Something like:

k = 1
[p,k] = next_permutation(n,k)

which increments k. k=1 gives the first one (p=1:n), k=2 the next one, etc.

That would be a useful function. This one is limited by memory requirement to small values of n.

10 Dec 2008 Vandermonde matrix Creating matrix with terms of geometric progression in each row Author: Siqing Wu

You should clarify in your help information that the matrix produced has its columns listed in the opposite order of the vander.m function in MATLAB.

Also, providing the determinant is nice, but it would be better to return the log or log10 of the determinant. That way, you can deal with determinants that are very large and very small (it's quite easy for det(A) to underflow or overflow).

Otherwise, nice work, and nicely commented. (You should have a "see also vander" line, though).

Nice use of cumprod. I'm surpised that this function is slower than vander, though.

10 Dec 2008 compare text It comapares two diferent words, and the resilts is 1 or 0. That's it Author: iokinberistain Beristain

Sometimes a duplicate of an existing MATLAB function is useful, if it illustrates an algorithm for educational use, for example. This is particularly true for built-in functions like strcmp.

However, this function is so simple (and poorly commented even if you can read the language it's in), that it really serves no purpose at all. It doesn't illustrate anything useful, has fewer features than strcmp, and is slower as well. So why bother? I suggest that the author remove the file. It's really not any help, since it might mean that a MATLAB user would miss the real function (strcmp) and use this one instead.

Comments and Ratings on Tim's Files View all
Updated File Comment by Comments Rating
07 Nov 2009 find_components finds the connected components of an image Author: Tim Davis Clark, Thomas

Thanks Tim!

This is very popular in the current ML contest (flooding a matrix with colour, Fall 2009).

15 Oct 2009 A pretty seashell GUI A GUI that draws a pretty seashell Author: Tim Davis Diego

27 Sep 2009 Don't let that INV go past your eyes; to solve that system, FACTORIZE! A simple-to-use object-oriented method for solving linear systems and least-squares problems. Author: Tim Davis Luong, Bruno

What mathworks are waiting to incorporate this package into Matlab?

05 Aug 2009 Don't let that INV go past your eyes; to solve that system, FACTORIZE! A simple-to-use object-oriented method for solving linear systems and least-squares problems. Author: Tim Davis Ben

All in all this package is a great idea and it looks like a first class implementation. As such, I'd like to help improve it by pointing out an issue. I am trying to solve Ax=-b, so I type in x=-inverse(A)*b, but I get the following error:

??? Undefined function or method 'uminus' for input arguments of type 'factorization_dense_lu'.

The work around is simple: x=inverse(A)*(-b). However, these are mathematically equivalent, so both should work.

19 Jun 2009 Don't let that INV go past your eyes; to solve that system, FACTORIZE! A simple-to-use object-oriented method for solving linear systems and least-squares problems. Author: Tim Davis LI, Miao

Top Tags Applied by Tim
linear algebra, sparse, gallery, mathematics, utilities
Files Tagged by Tim View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
10 Sep 2009 Gaussian Elimination Example (with partial pivoting): GEE, it's simple! A set of simple functions that illustrate Gaussian Elimination with partial pivoting Author: Tim Davis linear algebra, partial pivoting, tutorial, gaussian elimination, mathematics 545 2
  • 5.0
5.0 | 2 ratings
04 Jun 2009 Published M-Files Don't let that INV go past your eyes; to solve that system, FACTORIZE! A simple-to-use object-oriented method for solving linear systems and least-squares problems. Author: Tim Davis inverse, mrdivide, pinv, inv, backslash, linear algebra 251 7
  • 5.0
5.0 | 7 ratings
27 May 2009 LINFACTOR: uses LU or CHOL to factorize a matrix, or previously computed factors to solve Ax=b A simple M-file to solve Ax=b using LU or CHOL. Author: Tim Davis lu, inv, linfactor, linsolve, linear algebra, chol 228 2
  • 5.0
5.0 | 1 rating
19 Jan 2009 subsref2: often faster than subsref for C=A(i,j) when A is sparse subsref2 is a replacement for subsref, performing the computation C=A(i,j). Author: Tim Davis subsref, sparse 182 0
09 Sep 2008 Screenshot find_components finds the connected components of an image Author: Tim Davis connected components, image, dmperm, puzzler, morphology, segmentation 195 4
  • 4.2
4.2 | 5 ratings
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com