예제 #1
0
파일: base.py 프로젝트: sjhernes/chaospy
def swapaxes(P, ax1, ax2):
    A = P.A.copy()
    if P.dtype==f.frac:
        for key in P.keys:
            A[key] = f.swapaxes(A[key], ax1, ax2)
    else:
        for key in P.keys:
            A[key] = np.swapaxes(A[key], ax1, ax2)
    return Poly(A, P.dim, None, P.dtype)
예제 #2
0
def swapaxes(P, ax1, ax2):
    A = P.A.copy()
    if P.dtype == f.frac:
        for key in P.keys:
            A[key] = f.swapaxes(A[key], ax1, ax2)
    else:
        for key in P.keys:
            A[key] = np.swapaxes(A[key], ax1, ax2)
    return Poly(A, P.dim, None, P.dtype)
예제 #3
0
def swapaxes(A, ax1, ax2):
    if isinstance(A, (int, long, float, np.ndarray)):
        return np.swapaxes(A, ax1, ax2)

    elif isinstance(A, f.frac):
        return f.swapaxes(A, ax1, ax2)

    elif isinstance(A, p.Poly):
        return p.swapaxes(A, ax1, ax2)

    raise NotImplementedError
예제 #4
0
파일: wrapper.py 프로젝트: apetcho/chaospy
def swapaxes(A, ax1, ax2):
    if isinstance(A, (int, long, float, np.ndarray)):
        return np.swapaxes(A, ax1, ax2)

    elif isinstance(A, f.frac):
        return f.swapaxes(A, ax1, ax2)

    elif isinstance(A, p.Poly):
        return p.swapaxes(A, ax1, ax2)

    raise NotImplementedError