I noticed that, but after you divide by 1000, it still displays the time in seconds. It took almost 5 seconds on my system, this time it took 4s |
Code::Blocks can only measure the time the entire program takes. It's considering the one thousand runs of get() as a single unit.
See that my program prints four numbers? The last number is the average time taken by get() in milliseconds (only on Windows).
If get() took 5 seconds you should have waited an hour and 23 minutes.
And I was just stating that I think end should just equal result.y since that's all you're doing, correct? |
Sorry, that doesn't make sense.
This is what I'm doing:
http://i45.tinypic.com/2uhn8qq.png
When you find a candidate solution, what you do is construct the boundary you see above, generated by the function f(x)=k/x, such that the candidate lies directly on the boundary. Once you have that, you can be sure that the product of any vector in the white region is strictly smaller than your candidate ({(x,y) | y<f(x)}={(x,y) | x*y<candidate}), so you can avoid even considering those possibilities.
There are other curves that also work, but this one is simply the best one.
What is your profession? You talk a lot like a friend who is an electrical engineer. Possibly a mathematician? |
I'm a computer science student, but the first quadmester of the program at my university consists of just Algebra (a bit of discrete mathematics, a bit of number theory, a bit of abstract algebra) and Calculus II (multivariate calculus and some topology), and both subjects are shared with the mathematics people. That's 16 hours a week (not counting the time I spend studying by myself) of nothing but math for four months.
You'll have to excuse me if I'm speaking too much mathematese.