def rollaxis(P, axis, start=0): A = P.A.copy() B = {} if P.dtype==f.frac: for key in P.keys: B[key] = f.rollaxis(A[key], axis, start) else: for key in P.keys: B[key] = np.rollaxis(A[key], axis, start) return Poly(B, P.dim, None, P.dtype)
def rollaxis(P, axis, start=0): A = P.A.copy() B = {} if P.dtype == f.frac: for key in P.keys: B[key] = f.rollaxis(A[key], axis, start) else: for key in P.keys: B[key] = np.rollaxis(A[key], axis, start) return Poly(B, P.dim, None, P.dtype)
def rollaxis(A, ax, start=0): if isinstance(A, (int, long, float, np.ndarray)): return np.rollaxis(A, ax, start) elif isinstance(A, f.frac): return f.rollaxis(A, ax, start) elif isinstance(A, p.Poly): return p.rollaxis(A, ax, start) raise NotImplementedError