'c and x may be modified by the user. The Cython code expects
that they are C contiguous.'

def _ensure_c_contiguous(self):

    if (not self.x.flags.c_contiguous):
        self.x = self.x.copy()
    if (not self.c.flags.c_contiguous):
        self.c = self.c.copy()
