* @param padl Length to pad to
     * @return Padded vector
     */
    public static PyMultiarray XC_pad_vector(final PyMultiarray V, final int padl) {
        final char type = V.typecode();
        final PyMultiarray V_pad = PyMultiarray.zeros(new int[] { padl }, type);
        final int V_dim = V.dimensions[0];
        final int Lv2 = V_dim / 2;
        // final boolean debug_this = false;

        if (V_dim % 2 == 0) {
            V_pad.setslice(0, Lv2, 1, V.getslice(Lv2, V_dim, 1));
            V_pad.setslice(padl - Lv2, padl, 1, V.getslice(0, Lv2, 1));
        }
        else {
            V_pad.setslice(0, Lv2 + 1, 1, V.getslice(Lv2, V_dim, 1));
            V_pad.setslice(padl - Lv2, padl, 1, V.getslice(0, Lv2, 1));
        }
        return V_pad;
    }