Jump to content

Java Programming

Featured Replies

How to calculate the determinant of a given matrix of any order n

  • Author

thanks ,i got some hint about how to devise the logic

Edited by sachin

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).

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.

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.