Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Off-Topic > is there a very easy to code way of calculating the determinant using the inverse?
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
20.Sep: FOURTH CHAPTER IN `HISTORY OF...` PUBLISHED
13.Sep: NEWS ON THE FLY
06.Sep: APOLYTON DONATES TO HURRICANE RELIEF

bottom of page
   - CIVILIZATION 3 $9.99 - CIVILIZATION 2 from $6.95 - CIVILIZATION 2 from $4.25 - ALPHA CENTAURI + ALIEN CROSSFIRE (laptop collection) from $19.99 - ALPHA CENTAURI PC $9.99 -->
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Kuciwalker is offline Kuciwalker
Emperor
of Schmooism
Feb 2001
time: 00:36
  Old Post 07-03-2005 07:58
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
is there a very easy to code way of calculating the determinant using the inverse? Increase the size of your Attachments

I've painstakingly debugged my code that brings a matrix into reduced echelon form, to calculate the inverse. The prospect of writing the recursive function for the determinant is not inviting. Isn't there some way of using the inverse to find the determinant?

KrazyHorse is offline KrazyHorse
King
Macedonia
May 2001
time: 00:36
  Old Post 07-03-2005 08:07 Visit KrazyHorse's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

a) the determinant of the inverse is the inverse of the determinant

b) instead of using a recursive function to calculate the determinant by minors, use the the even/odd permutation definition of determinant

c) write down the eigenvalue equation for the matrix, solve for the roots and multiply them together to get the determinant

KrazyHorse is offline KrazyHorse
King
Macedonia
May 2001
time: 00:36
  Old Post 07-03-2005 08:13 Visit KrazyHorse's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

The determinant is properly defined as:

the sum over all permutations sigma of (-1)^(sign of sigma) a1sigma(1)a2sigma(2)...ansigma(n)

Ramo is offline Ramo
King
Austin, Texas, USA
Oct 1999
time: 23:36
  Old Post 07-03-2005 08:14 Visit Ramo's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

quote:
I've painstakingly debugged my code that brings a matrix into reduced echelon form, to calculate the inverse. The prospect of writing the recursive function for the determinant is not inviting. Isn't there some way of using the inverse to find the determinant?


Not unless its inverse is easy to calculate.

Easiest way would be this:

detA = eq1...qnA1q1...Anqn

Edit: In case it's not clear, the summation over each qm is implied through repeated indices. And eq1...qn gives 1 if q1..qn is an even permutation of 1...n, -1 if it's an odd permutation.

Last edited by Ramo on 07-03-2005 at 08:22

Sava is offline Sava
King
GO GO GO!
Mar 2001
time: 23:36
  Old Post 07-03-2005 08:15
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Inflate your Upload Space

MATH DORK THREAD!@@!~!!@!!!!@111one!!11!!!

KrazyHorse is offline KrazyHorse
King
Macedonia
May 2001
time: 00:36
  Old Post 07-03-2005 08:23 Visit KrazyHorse's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Got spare money?

If you've written down the row-reduced echelon form of the matrix and this has non zero determinant (i.e. it's the unit matrix) then if you've kept track of the operations performed to get ther then the determinant is trivial to calculate...

Kuciwalker is offline Kuciwalker
Emperor
of Schmooism
Feb 2001
time: 00:36
  Old Post 07-03-2005 08:24
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Suffering from ads?

quote:
Originally posted by KrazyHorse
If you've written down the row-reduced echelon form of the matrix and this has non zero determinant (i.e. it's the unit matrix) then if you've kept track of the operations performed to get ther then the determinant is trivial to calculate...


*looks at wikipedia*

Thanks! That's really, really easy to implement.

KrazyHorse is offline KrazyHorse
King
Macedonia
May 2001
time: 00:36
  Old Post 07-03-2005 08:26 Visit KrazyHorse's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Increase Your PM Length

How big is this matrix?

Asher is offline Asher
King
Calgary, Alberta
Nov 1999
time: 22:36
  Old Post 07-03-2005 08:39 Visit Asher's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Enter the AD-FREE zone

Are you writing this in Fortran?

Kuciwalker is offline Kuciwalker
Emperor
of Schmooism
Feb 2001
time: 00:36
  Old Post 07-03-2005 08:42
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, buy Call to Power 2

quote:
Originally posted by KrazyHorse
How big is this matrix?


Arbitrarily sized (= I hardcoded allocation of 100x100 ints assuming my instructor won't wan't to type 10,000 numbers in to check my program ).

And it's in C.

KrazyHorse is offline KrazyHorse
King
Macedonia
May 2001
time: 00:36
  Old Post 07-03-2005 08:51 Visit KrazyHorse's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Full PM-box? Change here!

Won't it take forever to run anything larger than 20X20 or so?

Kuciwalker is offline Kuciwalker
Emperor
of Schmooism
Feb 2001
time: 00:36
  Old Post 07-03-2005 08:51
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton buy from Amazon

Probably.

(The assignment is a linear algebra assignment, it's more my computer architecture class. It's more a "can you write in C, and can you do all this stuff while handling all sorts of crap user input and make it bug-free" sort of assignment.)

KrazyHorse is offline KrazyHorse
King
Macedonia
May 2001
time: 00:36
  Old Post 07-03-2005 08:52 Visit KrazyHorse's homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton, buy Call to Power 2

I think exact inversion runs in N^3 time. Can't remember.

Kuciwalker is offline Kuciwalker
Emperor
of Schmooism
Feb 2001
time: 00:36
  Old Post 07-03-2005 08:53
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Help yourself to an AD-FREE life

My algorithm is N^3, I think.

KrazyHorse is offline KrazyHorse
King
Macedonia
May 2001
time: 00:36
  Old Post 07-03-2005 08:54 Visit KrazyHorse's homepage!
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Avatar Enlargement: We've got the solution

approximate numerical inversion is much faster.

Lul Thyme is offline Lul Thyme
Warlord
Quebec, Canada
Aug 2000
time: 05:36
  Old Post 08-03-2005 06:57
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

n being number of entries of number of lines?

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:36.
Apolyton Time is 00:36.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0369 seconds (88.39% PHP - 11.61% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net