Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. matrix svd decomposition problem

matrix svd decomposition problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    includeh10
    wrote on last edited by
    #1

    I downloaded several SVD c++ code, but they all have same error. by SVD theory, a matrix A(mxn) (m: rows, n: columns) can be decomposed as A(mxn) = U(mxm) * S(mxn) * V'(nxn) (U, S and V are matrices) U and V must be orthogonal matrices: U x U' = U' x U = E, V x V' = V' x V = E (E is identity matrix) Problem: if m > n, those codes generate U' x U = E (correct), but U' x U != E (error). they are all correct for V. Because all of codes have the same error, I think U should be this way even it is not satisfy SVD theory. Or all codes are wrong (sounds not reasonable.) How do you think about? maybe I have to download more C++ source codes to test? .

    L CPalliniC 2 Replies Last reply
    0
    • I includeh10

      I downloaded several SVD c++ code, but they all have same error. by SVD theory, a matrix A(mxn) (m: rows, n: columns) can be decomposed as A(mxn) = U(mxm) * S(mxn) * V'(nxn) (U, S and V are matrices) U and V must be orthogonal matrices: U x U' = U' x U = E, V x V' = V' x V = E (E is identity matrix) Problem: if m > n, those codes generate U' x U = E (correct), but U' x U != E (error). they are all correct for V. Because all of codes have the same error, I think U should be this way even it is not satisfy SVD theory. Or all codes are wrong (sounds not reasonable.) How do you think about? maybe I have to download more C++ source codes to test? .

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      Quote:

      if m > n, those codes generate U' x U = E (correct), but U' x U != E (error).

      Probably you meant

      if m > n, those codes generate U' x U = E (correct), but U x U' != E (error).

      Anyway, if U' x U = E then U' = U-1, therefore U x U' = E.

      THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

      In testa che avete, signor di Ceprano?

      I 1 Reply Last reply
      0
      • I includeh10

        I downloaded several SVD c++ code, but they all have same error. by SVD theory, a matrix A(mxn) (m: rows, n: columns) can be decomposed as A(mxn) = U(mxm) * S(mxn) * V'(nxn) (U, S and V are matrices) U and V must be orthogonal matrices: U x U' = U' x U = E, V x V' = V' x V = E (E is identity matrix) Problem: if m > n, those codes generate U' x U = E (correct), but U' x U != E (error). they are all correct for V. Because all of codes have the same error, I think U should be this way even it is not satisfy SVD theory. Or all codes are wrong (sounds not reasonable.) How do you think about? maybe I have to download more C++ source codes to test? .

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        This is mathematics not C++, so you need to go through the code to find out where the calculation is wrong.

        1 Reply Last reply
        0
        • CPalliniC CPallini

          Quote:

          if m > n, those codes generate U' x U = E (correct), but U' x U != E (error).

          Probably you meant

          if m > n, those codes generate U' x U = E (correct), but U x U' != E (error).

          Anyway, if U' x U = E then U' = U-1, therefore U x U' = E.

          THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

          I Offline
          I Offline
          includeh10
          wrote on last edited by
          #4

          You are right, I should go back to school now. thanks.

          CPalliniC 1 Reply Last reply
          0
          • I includeh10

            You are right, I should go back to school now. thanks.

            CPalliniC Offline
            CPalliniC Offline
            CPallini
            wrote on last edited by
            #5

            You are welcome. Don't become discouraged, maybe rounding made things more complex in your case.

            THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

            In testa che avete, signor di Ceprano?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups