N by N Matrix Determinant
|
|||
|
Rank: ? (1)
Member #: 28565 |
hi everyone....
im new to java programming,,, i hope u guys would help me out with this problem.... the user will input the dimension of an n by n square matrix as a command line argument followed by the content of the matrix per row... and then compute for its determinant... thank you guys... hope ill be able to get some ideas here... Cheers, AlmaCode:
|
||
|
|||
|
|||
|
Rank: ? (4821)
Member #: 3416 |
it's been a while and i don't remember how to find the determinant of anything bigger than 3x3, but here's the logic i'd use:
prompt for n of the nxn matrix prompt for the n items in row 1 prompt for the n items in row 2...throgh row n compute and display the determinant since you're dealing with an nxn matrix, after you know what n is you can declare a two-dimensional nxn array to store the results in. when you read in the numbers for row 1, that's going to be matrix[0][0] through matrix[0][n-1] (since arrays are 0-indexed). once you've read the entire matrix, you can use matrix[x][y] to access the numbers in the matrix for calculating the determinant.
my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
|
||
|
Please login or register to post a reply.