Sven
1324
1324
Rank4
4
Badges1788
1788
Score
Sven submitted Solution 131528 to Problem 411. Back to basics 21 - Matrix replicating on 27 Aug 2012 |
Sven submitted Solution 131527 to Problem 410. Back to basics 20 - singleton dimensions on 27 Aug 2012 |
Sven submitted Solution 131526 to Problem 350. Back to basics 7 - Equal NaNs on 27 Aug 2012 |
Sven submitted Solution 131525 to Problem 250. Project Euler: Problem 10, Sum of Primes on 27 Aug 2012 |
Sven submitted Solution 131524 to Problem 354. Back to basics 10 - Max Float on 27 Aug 2012 |
Sven submitted Solution 131520 to Problem 412. Back to basics 22 - Rotate a matrix on 27 Aug 2012 |
Sven submitted Solution 131517 to Problem 351. Back to basics 8 - Matrix Diagonals on 27 Aug 2012 |
Sven submitted Solution 131515 to Problem 355. Back to basics 11 - Max Integer on 27 Aug 2012 |
Sven submitted Solution 131510 to Problem 353. Back to basics 9 - Indexed References on 27 Aug 2012 |
Sven submitted Solution 131509 to Problem 349. Back to basics 6 - Column Vector on 27 Aug 2012 |
Sven submitted Solution 131508 to Problem 123. Tell me the slope on 27 Aug 2012 |
Sven submitted Solution 131507 to Problem 349. Back to basics 6 - Column Vector on 27 Aug 2012 |
Sven submitted Solution 131506 to Problem 349. Back to basics 6 - Column Vector on 27 Aug 2012 |
Sven submitted Solution 131494 to Problem 121. surface of a spherical planet on 27 Aug 2012 |
Sven submitted Solution 131493 to Problem 132. given 3 sides, find area of this triangle on 27 Aug 2012 |
Sven submitted Solution 131491 to Problem 132. given 3 sides, find area of this triangle on 27 Aug 2012 |
Sven submitted Solution 111673 to Problem 820. Eliminate unnecessary polygon vertices on 13 Jul 2012 |
Sven submitted Solution 111672 to Problem 820. Eliminate unnecessary polygon vertices on 13 Jul 2012 |
Sven submitted a Comment to Solution 111016 Hehe... yep I'm sure that would send us scrambling to add a tolerance to whatever-the-current-best-solution-was. But if this were intended for a bwboundaries(BW,'noholes','minimal') type option to bwboundaries, then all coordinates could be assumed integers and even the normalisation would be an unnecessary step since bwboundaries never skips a pixel.
on 13 Jul 2012 |
Sven submitted a Comment to Solution 110965 Well then, I bet that the following would run faster and work on any dimensioned data (such as a [10,2,50] sized matrix representing 50 sets of 10 XY vectors):
normr = @(v)bsxfun(@rdivide, v, sqrt(sum(v.^2, 2)));
on 13 Jul 2012 |
Sven submitted Solution 111660 to Problem 820. Eliminate unnecessary polygon vertices on 13 Jul 2012 |
Sven submitted Solution 111659 to Problem 820. Eliminate unnecessary polygon vertices on 13 Jul 2012 |
Sven submitted Solution 111658 to Problem 820. Eliminate unnecessary polygon vertices on 13 Jul 2012 |
Sven submitted Solution 111657 to Problem 820. Eliminate unnecessary polygon vertices on 13 Jul 2012 |
Sven submitted Solution 111656 to Problem 820. Eliminate unnecessary polygon vertices on 13 Jul 2012 |
Sven submitted a Comment to Solution 111016 It's alright Richard... when I get home I'll just add normr=@(x)normaliseVector3d(x) to the top of my script and we'll be back in business... we might be near an optimised business but business nonetheless. As long as we don't resort to hacking the test suite via some huge regexp string then I'm still in the game.
on 12 Jul 2012 |
Sven submitted a Comment to Solution 110965 Hah, "Undefined function or variable 'normr'." A while back I had a version with normalizeVector3d(), part of the geom3d() package I use all the time...
I'd be interested to see under the hood of normr... I hope it's vectorized via bsxfun()
on 12 Jul 2012 |
Sven submitted a Comment to Solution 110421 Hi Anton, here's a hint: You're chopping down P then taking the difference between itself and its circshift. This is very close to just a simple diff() command. Circshift is a useful function, but not quite where you've got it ;)
Think of it this way:
A diff() will get vectors from one point to the next. If any neighbouring vectors point in the exact same direction, they are fair game to remove. More specifically, whenever the direction of the line *changes*, you've found a vertex you want to keep. How can you detect that?
on 12 Jul 2012 |
Sven submitted a Comment to Solution 110965 I thought that maybe we could get rid of the extra arguments to sum(,2) and any(,2) by converting to a row matrix, but doing so would add arguments circshift(), so that way may not have any improvements left.
I do know that *every single line* of our function generates an M-Lint warning :) Oh, except the function name now.
on 12 Jul 2012 |
Sven submitted a Comment to Solution 110965 Cheers, obviously I shamelessly adopted your favourite function.
I honestly thought we'd converged to an optimum (although a slightly distorted use of that word) back at around 64, then 55, then 48... so I only tentatively think we've reached the end. I'd certainly be relieved to call it a draw :)
on 12 Jul 2012 |
Sven submitted Solution 110972 to Problem 820. Eliminate unnecessary polygon vertices on 12 Jul 2012 |
Sven submitted Solution 110965 to Problem 820. Eliminate unnecessary polygon vertices on 12 Jul 2012 |
Sven submitted Solution 110963 to Problem 820. Eliminate unnecessary polygon vertices on 12 Jul 2012 |
Sven submitted Solution 110952 to Problem 820. Eliminate unnecessary polygon vertices on 12 Jul 2012 |
Sven submitted Solution 110950 to Problem 820. Eliminate unnecessary polygon vertices on 12 Jul 2012 |
Sven submitted Solution 110947 to Problem 820. Eliminate unnecessary polygon vertices on 12 Jul 2012 |
Sven submitted Solution 110940 to Problem 820. Eliminate unnecessary polygon vertices on 12 Jul 2012 |
Sven submitted Solution 110936 to Problem 820. Eliminate unnecessary polygon vertices on 12 Jul 2012 |
Sven submitted a Comment to Solution 110870 Ha! I just knew I'd come back from soccer and see you drop the score a bit. Nice one. Best tool in MATLAB? I like bsxfun, but that's already there... maybe it's an anonymous function... we'll see...
on 12 Jul 2012 |
Sven submitted Solution 110358 to Problem 820. Eliminate unnecessary polygon vertices on 11 Jul 2012 |
Sven submitted a Comment to Solution 110339 Richard, this one's a team effort indeed!
on 11 Jul 2012 |
Sven submitted Solution 110339 to Problem 820. Eliminate unnecessary polygon vertices on 11 Jul 2012 |
Sven submitted Solution 110330 to Problem 820. Eliminate unnecessary polygon vertices on 11 Jul 2012 |
Sven submitted Solution 110323 to Problem 820. Eliminate unnecessary polygon vertices on 11 Jul 2012 |
Sven submitted Solution 110314 to Problem 820. Eliminate unnecessary polygon vertices on 11 Jul 2012 |
Sven submitted a Comment to Solution 109911 Yeah, there's one more you'll find that should get you to 51... unless it's already there :)
on 11 Jul 2012 |
Sven submitted Solution 109927 to Problem 820. Eliminate unnecessary polygon vertices on 11 Jul 2012 |
Sven submitted Solution 109926 to Problem 820. Eliminate unnecessary polygon vertices on 11 Jul 2012 |
Sven submitted Solution 109925 to Problem 820. Eliminate unnecessary polygon vertices on 11 Jul 2012 |
Sven submitted Solution 109924 to Problem 820. Eliminate unnecessary polygon vertices on 11 Jul 2012 |