Exemplo n.º 1
0
def eval_s(itp: object, exo_grid: EmptyGrid, endo_grid: CartesianGrid,
           interp_type: Cubic, s: object):
    from interpolation.splines import eval_cubic
    assert (s.ndim == 2)
    coeffs = itp.coefficients
    gg = endo_grid.__numba_repr__()
    return eval_cubic(gg, coeffs, s)
Exemplo n.º 2
0
def get_coefficients(itp: object, exo_grid: UnstructuredGrid,
                     endo_grid: CartesianGrid, interp_type: Cubic, x: object):
    from interpolation.splines.prefilter_cubic import prefilter_cubic
    gg = endo_grid.__numba_repr__()
    return [
        prefilter_cubic(gg, x[i].reshape(tuple(endo_grid.n) + (-1, )))
        for i in range(x.shape[0])
    ]
Exemplo n.º 3
0
def eval_is(itp: object, exo_grid: UnstructuredGrid, endo_grid: CartesianGrid, interp_type: Linear, i: object, s: object):

    from interpolation.splines import eval_linear
    assert(s.ndim==2)
    coeffs = itp.coefficients[i]
    gg = endo_grid.__numba_repr__()

    return eval_linear(gg, coeffs, s)
Exemplo n.º 4
0
def get_coefficients(
    itp: object,
    exo_grid: EmptyGrid,
    endo_grid: CartesianGrid,
    interp_type: Cubic,
    x: object,
):
    from interpolation.splines.prefilter_cubic import prefilter_cubic

    grid = endo_grid  # one single CartesianGrid
    gg = endo_grid.__numba_repr__()
    return prefilter_cubic(gg, x[0].reshape(tuple(grid.n) + (-1, )))
Exemplo n.º 5
0
def eval_s(
    itp: object,
    exo_grid: EmptyGrid,
    endo_grid: CartesianGrid,
    interp_type: Linear,
    s: object,
):
    from interpolation.splines import eval_linear

    assert s.ndim == 2
    coeffs = itp.coefficients
    gg = endo_grid.__numba_repr__()
    return eval_linear(gg, coeffs, s)