'Add additional breakpoints and coefficients to the polynomial.
Parameters
c : ndarray, size (k, m, ...)
Additional coefficients for polynomials in intervals. Note that
the first additional interval will be formed using one of the
`self.x` end points.
x : ndarray, size (m,)
Additional breakpoints. Must be sorted in the same order as
`self.x` and either to the right or to the left of the current
breakpoints.
right
Deprecated argument. Has no effect.
.. deprecated:: 0.19'

def extend(self, c, x, right=None):

    if (right is not None):
        warnings.warn('`right`    is    deprecated    and    will    be    removed.')
    c = np.asarray(c)
    x = np.asarray(x)
    if (c.ndim < 2):
        raise ValueError('invalid    dimensions    for    c')
    if (x.ndim != 1):
        raise ValueError('invalid    dimensions    for    x')
    if (x.shape[0] != c.shape[1]):
        raise ValueError('x    and    c    have    incompatible    sizes')
    if ((c.shape[2:] != self.c.shape[2:]) or (c.ndim != self.c.ndim)):
        raise ValueError('c    and    self.c    have    incompatible    shapes')
    if (c.size == 0):
        return
    dx = np.diff(x)
    if (not (np.all((dx >= 0)) or np.all((dx <= 0)))):
        raise ValueError('`x`    is    not    sorted.')
    if (self.x[(-1)] >= self.x[0]):
        if (not (x[(-1)] >= x[0])):
            raise ValueError('`x`    is    in    the    different    order    than    `self.x`.')
        if (x[0] >= self.x[(-1)]):
            action = 'append'
        elif (x[(-1)] <= self.x[0]):
            action = 'prepend'
        else:
            raise ValueError('`x`    is    neither    on    the    left    or    on    the    right    from    `self.x`.')
    else:
        if (not (x[(-1)] <= x[0])):
            raise ValueError('`x`    is    in    the    different    order    than    `self.x`.')
        if (x[0] <= self.x[(-1)]):
            action = 'append'
        elif (x[(-1)] >= self.x[0]):
            action = 'prepend'
        else:
            raise ValueError('`x`    is    neither    on    the    left    or    on    the    right    from    `self.x`.')
    dtype = self._get_dtype(c.dtype)
    k2 = max(c.shape[0], self.c.shape[0])
    c2 = np.zeros(((k2, (self.c.shape[1] + c.shape[1])) + self.c.shape[2:]), dtype=dtype)
    if (action == 'append'):
        c2[(k2 - self.c.shape[0]):, :self.c.shape[1]] = self.c
        c2[(k2 - c.shape[0]):, self.c.shape[1]:] = c
        self.x = np.r_[(self.x, x)]
    elif (action == 'prepend'):
        c2[(k2 - self.c.shape[0]):, :c.shape[1]] = c
        c2[(k2 - c.shape[0]):, c.shape[1]:] = self.c
        self.x = np.r_[(x, self.x)]
    self.c = c2
