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

Determinate Matrix

  1. Sep 23, 2009 #1
    Hello...
    I am trying to build a program that calculates the calculates the determinant of a matrix. IN C++
    I could do that to 3x3 matrix, but I was thinking of generalizing it.
    I am unable to find a way to do that, the only hint I can get from mathematics is that I can use recursion to break my matrix into smaller matrices. Still i am stumped, can anybody help me out????please
     
  2. jcsd
  3. Sep 23, 2009 #2

    CompuChip

    User Avatar
    Science Advisor
    Homework Helper

    Well, the determinant of a one by one matrix A is simply A[1, 1].
    For an n by n matrix, you can expand along rows or columns, and proceed just as you would do by "hand". So summing over i = 1 to n, take out the first row, nth column (or nth row, first column) and calculate the determinant of the remaining matrix (which is then (n - 1) x (n - 1), of course).
     
  4. Sep 23, 2009 #3
    Still didn't get it
     
  5. Sep 23, 2009 #4

    CompuChip

    User Avatar
    Science Advisor
    Homework Helper

    What don't you get?
    How to calculate a determinant?
    How to program it?
    What recursion is?
     
  6. Sep 24, 2009 #5
    Firstly how do i declare a determinant. Since its variable, i have to allocate memory at runtime. Plus, how do i arrange for recursion as i have to specify dimension of determinant at each step??
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Determinate Matrix
  1. Binary matrix (Replies: 1)

  2. Random Matrix (Replies: 7)

Loading...