[VA] SRC#003- New Year 2019 Special
|
01-17-2019, 06:04 PM
Post: #7
|
|||
|
|||
RE: [VA] SRC#003- New Year 2019 Special
Not being well-versed in the mathematics behind this, my attempt was simply a naïve/brute force loop to compare successive results until the first duplicate was encountered (50g/RPL):
Code:
Execution time: about 12s on a real 50g. Size: 146.5 bytes, of which 84 bytes is spent building the initial matrix. If I take that part out and require the initial matrix being left on the stack as an argument, the size drops to 62.5 bytes. A similar approach using Thomas' first optimization: Code:
Execution time: about 8.5s on a real 50g Size: 149 bytes (with embedded matrix build), 65 bytes (initial matrix as argument) All of which pales in comparison, of course, to Thomas' ultimate eigenvalue solution. If I assume the initial matrix is on the stack as an argument, the following code gives the result in the same format as the other routines (I optimized the retrieval of the needed matrix element as well as adding "RE" to standardize the result): Code: \<< Execution time: about 3.8s on a real 50g Size: 28 bytes Great job Thomas! (as usual). And thanks to Valentin for an interesting problem -- I hope to see more about the underlying concepts. I think this is the first time I've actually encountered eigenvalues being used outside of a Linear Algebra course many moons ago. I've forgotten most everything I was supposed to have learned in that class, I'm afraid. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)