I'm not sure that this macro is a good idea, I suggest to replace in `Kernel::set` lines `CV_Assert(i >= 0);` by `if (i < 0) return i;`