Since the overloaded [] operator in the Matrix class isn't a const function, the compiler was spitting errors when we're trying to use it in the const function hasSelfLoop. Instead of using [], I switched it to the get function, which does the same thing, but is a const function. Alternatively, a const version of the [] operator could be created, but get function was already implemented so I chose to use that.
Since the overloaded [] operator in the Matrix class isn't a const function, the compiler was spitting errors when we're trying to use it in the const function
hasSelfLoop
. Instead of using [], I switched it to theget
function, which does the same thing, but is a const function. Alternatively, a const version of the [] operator could be created, butget
function was already implemented so I chose to use that.