Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to accelerate the SVD algorithm?

  1. Jul 12, 2008 #1
    I've written a program in c language in terms of the GR SVD algorithm. To my dispointment,its performance is worse than the svd of matlab. I wish to get to know which algorithm the matlab used. Who may tell me? Thanks.
     
  2. jcsd
  3. Jul 12, 2008 #2
    Sigh.

    Matlab will.

    Code (Text):
    doc svd
     
  4. Jul 12, 2008 #3
    Oh, you said nothing.
     
  5. Jul 13, 2008 #4
    No, I told you that if you had had the startlingly obvious idea to check the documentation for svd in Matlab, you'd find which algorithms it uses to compute singular value decompositions.

    If you want to be snippy towards someone who's given you the answer to your question, that's your business.
     
  6. Jul 13, 2008 #5
    You are not friendly,Shoehorn. I have read the matlab document. I know it use DGESVD. But I cannot find the details of the algorithm. So I asked the question.
    Do take any thing for granted. Ok? GUY
     
  7. Jul 13, 2008 #6
    As a matter of fact ,I have found the source code of the algorithm. But I wonder the cause of its fast speed.So I hope to find the primitive document about the algorithm.
    Who may tell me?
     
  8. Jul 13, 2008 #7
    Actually, shoehorn said everything. It was enough for you to figure out that, for real-valued matrices, MATLAB uses the DGESVD routine from LAPACK. That should have been enough of a clue for you to find the LAPACK Users' Guide, and specifically the section entitled Singular Value Decomposition, which is probably what you were looking for.
     
  9. Jul 14, 2008 #8
    So you know which algorithm Matlab uses for singular value decompositions, and yet you still decided to waste everyone's time by asking which algorithm Matlab uses for singular value decompositions?

    Matlab has the best documentation of any software I've ever seen. Ever. Learn how to use it. 90% of the questions about Matlab on this forum are from people who are too lazy to read the documentation and instead want to waste other people's time by getting them to do work that they are too lazy/stupid to perform.
     
    Last edited: Jul 14, 2008
  10. Jul 14, 2008 #9
    So you know which algorithm Matlab uses for singular value decompositions, and yet you still decided to waste everyone's time by asking which algorithm Matlab uses for singular value decompositions?

    Matlab has the best documentation of any software I've ever seen. Ever. Learn how to use it. 90% of the questions about Matlab on this forum are from people who are too lazy to read the documentation and instead want to waste other people's time by getting them to do work that they are too lazy/stupid to perform.

    Don't insult me,ok? I only implement sth not by matlab.
    If I used matlab, I not ask the question.

    Matlab is a good software, but it is too large , I cannot put it into a hardware. So I have to implement svd by myself.
     
  11. Jul 14, 2008 #10
    I have to research linpack source code. It is more complicated than read the primitive document.

    Sigh.
     
  12. Jul 14, 2008 #11
    I dislike those who take themselves as industrious men.
    Is it a a great thing to develop sth on matlab?
     
  13. Mar 14, 2009 #12
    I dislike them also.

    By taking advantage of the specific processor-memory architecture you can accelerate
    computations in way not directly related to the mathematical algorithm:

    using processor specific vectorization (SSE2,3,...)
    blocking,
    loop unrolling, ...

    You would want to

    optimize main memory to L2-cache traffic,
    avoid TLB misses

    and possibly many other things.

    When you go up against MATLAB you are going up against Intel hand tuned BLAS
    (10 times faster than naive code depending on the operation).

    Large systems that try to optimize on different architectures are
    ATLAS BLAS, GOTO BLAS.

    Look for paper by Jack Donguerra for the issues involved.

    Naive C-code is hopeless.

    For a reasonably small system that accomlishes quite a lot using C++ template metaprogramming see Eigen2:
    http://eigen.tuxfamily.org/index.php?title=Main_Page

    This is your best chance to do something yourself and is also very elegant code.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: How to accelerate the SVD algorithm?
Loading...