added the in-place c++ clip but does not seem to have speedup