I'm working on a project for an engineering course with extreme number crunching (this will take hours to run, at a minimum, and that's just one iteration).
I am having trouble writing the code, and I keep writing infinite loops. PHP gives up and throws an error (I've tried a couple servers and the error varies but the behavior is the same-- it gives up).
But now I'm not so sure I'm writing an infinite loop. It's a huge amount of number crunching (something like 17,000^2) and it's giving up. I'd assume I'm writing an infinite loop somewhere but I can't find it. (This code is incredibly frustrating in the first place, so I might be missing it.)
So my questions...
1. How does PHP know when there is an infinite loop without trying it out? How does it know when to give up? It's not a delayed response-- it instantaneously gives up as soon as it gets the request. (And it's not a parse error. I can comment out the recursion and it goes on just fine.)
2. Is this something I can configure? I hesitate to turn it off, but I have a feeling I might have hit the limits of PHP's calculating capabilities.
(And I know PHP is not the ideal language for this; it's just the one I'm most familiar with and this project is a pain, perhaps excessive. Homework! Yay!)
(If anyone is wondering what I'm working on, it's using a Hidden Markov Model to calculate distributional frequencies/probabilities of sounds [=letters] in an input string of language and attempting to uncover "hidden structure". A bit of statistical magic, basically, and I don't fully understand it.)