Ejemplo n.º 1
0
def var(P, ax=None):

    A = P.A.copy()
    if P.dtype==f.frac:
        for key in P.keys:
            A[key] = f.var(A[key], ax)
    else:
        for key in P.keys:
            A[key] = np.var(A[key], ax)
    return Poly(A, P.dim, A[key].shape, P.dtype)
Ejemplo n.º 2
0
def var(P, ax=None):

    A = P.A.copy()
    if P.dtype == f.frac:
        for key in P.keys:
            A[key] = f.var(A[key], ax)
    else:
        for key in P.keys:
            A[key] = np.var(A[key], ax)
    return Poly(A, P.dim, A[key].shape, P.dtype)
Ejemplo n.º 3
0
def var(A, ax=None):

    if isinstance(A, (int, long, float, np.ndarray)):
        return np.var(A, ax)

    elif isinstance(A, f.frac):
        return f.var(A)

    elif isinstance(A, p.Poly):
        return p.var(A)

    raise NotImplementedError
Ejemplo n.º 4
0
def var(A, ax=None):

    if isinstance(A, (int, long, float, np.ndarray)):
        return np.var(A, ax)

    elif isinstance(A, f.frac):
        return f.var(A)

    elif isinstance(A, p.Poly):
        return p.var(A)

    raise NotImplementedError