Greetings. I am experiencing a bug that is very frustrating to track down.
My main way of tracking bugs is to put diagnostic output in the code. However,
in this case, even adding some cout statements causes the error to disappear.
I suspect that somewhere I am writing past array bounds or committing some other error that causes undefined behavior. To this end, I am trying to eliminate these causes. For example, instead of referencing vectors as, for example, Vec[i], I am using at, which checks array bounds: Vec.at(i).
Does anyone have any additional suggestions? As I said, I have been unable to track down this error. I would love to show you the code, but it's several thousand lines long.