added inf termination criteria
changed to isinf
Merge pull request #525 from memimo/infstop

added inf termination criteria