I want to traverse through the values of a vector in opposite direction. As you know the size of a vector is of size_t. When I use the following code:
for(size_t r=m.size()-1; r >= 0; r--)
{
x[r] = f[r];
for(size_t c = r+1; c < m.size(); c++)
{
x[r] -= m[r][c] * x[c];
}
}
I will go out of the range of the vector because the r will become 4294967295 after decrementing r = 0.
I am not changing the r's type because in my project, I am treating warnings as errors, so it should be size_t or I should cast it which is not interesting.