(lvl, lower_bound=1.0/30.0, upper_bound=1.1, degree=3,
                    iterations=DEFAULT_NITER)
return smoother
Set up Chebyshev.
Set up Chebyshev.
Set up Chebyshev .
def setup_chebyshev(lvl, lower_bound=1.0/30.0, upper_bound=1.1, degree=3,
                    iterations=DEFAULT_NITER):
    """Set up Chebyshev."""
    rho = approximate_spectral_radius(lvl.A)
    a = rho * lower_bound
    b = rho * upper_bound
    # drop the constant coefficient
    coefficients = -chebyshev_polynomial_coefficients(a, b, degree)[:-1]

    def smoother(A, x, b):
        relaxation.polynomial(A, x, b, coefficients=coefficients,
                              iterations=iterations)
    return smoother
def setup_chebyshev ( lvl , lower_bound = 1.0 / 30.0 , upper_bound = 1.1 , degree = 3 , iterations = DEFAULT_NITER ) : rho = approximate_spectral_radius ( lvl . A ) a = rho * lower_bound b = rho * upper_bound # drop the constant coefficient coefficients = - chebyshev_polynomial_coefficients ( a , b , degree ) [ : - 1 ] def smoother ( A , x , b ) : relaxation . polynomial ( A , x , b , coefficients = coefficients , iterations = iterations ) return smoother