sachin Posted January 15, 2012 Posted January 15, 2012 How to calculate the determinant of a given matrix of any order n
timo Posted January 15, 2012 Posted January 15, 2012 I haven't tried it myself, but you could try to use the very first hit that Google returns: http://wiki.answers.com/Q/Determinant_of_matrix_in_java 1
sachin Posted January 16, 2012 Author Posted January 16, 2012 (edited) thanks ,i got some hint about how to devise the logic Edited January 16, 2012 by sachin
Schrödinger's hat Posted January 16, 2012 Posted January 16, 2012 Bear in mind this isn't the best way of calculating a determinant for a very large matrix.<br> If you're doing it for non-performance critical stuff, or an exercise, it's fine, but there are better methods for large matrices (available in many maths/linear algebra libs). 1
Schrödinger's hat Posted January 19, 2012 Posted January 19, 2012 Now I have to go digging in the memory banks. :/ I think PLU decomposition, then reading off your determinant by multiplying along the diagonal is faster in most of the cases that you'd care about speed (unless you're calculating determinants for very large numbers of small matrices). But then again I could be entirely talking out my posterior. There are even tricksier methods, but I can't recall off hand what they are. If you're just after determinants and don't care about how it's done, I'd highly recommend looking up some kind of linear algebra library or class, as this is the kind of work done in any given language by people much smarter than I am. If you're interested in the implementation, maybe tell me a little more about what you're doing and I'll see if I can find some relevant resources.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now