newton#

Implementations of the transformation classes from NewtonPolynomial (polynomials in the Newton basis) to:

class minterpy.transformations.newton.NewtonToCanonical(origin_poly)[source]#

Bases: TransformationABC

Transformation from the Newton basis to the canonical basis.

Properties

grid

The grid of the origin polynomial.

multi_index

The multi index set of the origin polynomial (and also the target polynomial).

transformation_operator

The polynomial basis transformation operator.

Parameters:

origin_poly (MultivariatePolynomialSingleABC)

origin_type#

alias of NewtonPolynomial

target_type#

alias of CanonicalPolynomial

_get_transformation_operator()#

Construct the Newton-to-Canonical transformation operator.

Parameters:

transformation (TransformationABC) – The transformer instance with information about the origin polynomial (an instance of NewtonPolynomial) and the target type (CanonicalPolynomial).

Returns:

The Newton-to-Canonical transformation operator.

Return type:

OperatorABC

__call__(origin_poly=None)#

Transformation of polynomial.

This function is called when an instance of transformation is called T() or T(x). If called without any arguments, the transformation is applied on the origin_poly used to construct the transformation. If an argument is passed, the transformation is applied on the instance passed.

Parameters:

origin_poly (MultivariatePolynomialSingleABC | None) – (optional) an instance of the polynomial to be transformed.

Returns:

an instance of the polynomial in the target basis.

__init__(origin_poly)#
Parameters:

origin_poly (MultivariatePolynomialSingleABC)

classmethod __init_subclass__(**kwargs)#

Add a concrete implementation to the registry of available transformations

__weakref__#

list of weak references to the object (if defined)

_apply_transformation(origin_poly)#

Transforms the polynomial to the target type of the transformation.

Parameters:

origin_poly – instance of the polynomial to be transformed

Returns:

an instance of the transformed polynomial in the target basis

property _target_indices: MultiIndexSet#

The MultiIndexSet of the target_poly.

Returns:

the indices the target polynomial will have

property grid: Grid#

The grid of the origin polynomial.

property multi_index: MultiIndexSet#

The multi index set of the origin polynomial (and also the target polynomial).

property transformation_operator: OperatorABC#

The polynomial basis transformation operator.

Returns:

instance of the transformation operator

Notes

The transformation operator once constructed can be reused for transforming other polynomial instance of the origin_poly type, which have the same basis (and grid) as the origin_poly, to the target_poly type.

class minterpy.transformations.newton.NewtonToLagrange(origin_poly)[source]#

Bases: TransformationABC

Transformation from the Newton basis to the Lagrange basis.

Properties

grid

The grid of the origin polynomial.

multi_index

The multi index set of the origin polynomial (and also the target polynomial).

transformation_operator

The polynomial basis transformation operator.

Parameters:

origin_poly (MultivariatePolynomialSingleABC)

origin_type#

alias of NewtonPolynomial

target_type#

alias of LagrangePolynomial

_get_transformation_operator()#

Construct the Newton-to-Lagrange transformation operator.

Parameters:

transformation (TransformationABC) – The transformer instance with information about the origin polynomial (an instance of NewtonPolynomial) and the target type (LagrangePolynomial).

Returns:

The Newton-to-Lagrange transformation operator.

Return type:

OperatorABC

Notes

  • The barycentric transformation operator is employed if the multi-indices are downward-closed.

__call__(origin_poly=None)#

Transformation of polynomial.

This function is called when an instance of transformation is called T() or T(x). If called without any arguments, the transformation is applied on the origin_poly used to construct the transformation. If an argument is passed, the transformation is applied on the instance passed.

Parameters:

origin_poly (MultivariatePolynomialSingleABC | None) – (optional) an instance of the polynomial to be transformed.

Returns:

an instance of the polynomial in the target basis.

__init__(origin_poly)#
Parameters:

origin_poly (MultivariatePolynomialSingleABC)

classmethod __init_subclass__(**kwargs)#

Add a concrete implementation to the registry of available transformations

__weakref__#

list of weak references to the object (if defined)

_apply_transformation(origin_poly)#

Transforms the polynomial to the target type of the transformation.

Parameters:

origin_poly – instance of the polynomial to be transformed

Returns:

an instance of the transformed polynomial in the target basis

property _target_indices: MultiIndexSet#

The MultiIndexSet of the target_poly.

Returns:

the indices the target polynomial will have

property grid: Grid#

The grid of the origin polynomial.

property multi_index: MultiIndexSet#

The multi index set of the origin polynomial (and also the target polynomial).

property transformation_operator: OperatorABC#

The polynomial basis transformation operator.

Returns:

instance of the transformation operator

Notes

The transformation operator once constructed can be reused for transforming other polynomial instance of the origin_poly type, which have the same basis (and grid) as the origin_poly, to the target_poly type.

class minterpy.transformations.newton.NewtonToChebyshev(origin_poly)[source]#

Bases: TransformationABC

Transformation from the Newton basis to the Chebyshev basis.

Properties

grid

The grid of the origin polynomial.

multi_index

The multi index set of the origin polynomial (and also the target polynomial).

transformation_operator

The polynomial basis transformation operator.

Parameters:

origin_poly (MultivariatePolynomialSingleABC)

origin_type#

alias of NewtonPolynomial

target_type#

alias of ChebyshevPolynomial

_get_transformation_operator()#

Construct the Newton-to-Chebyshev transformation operator.

The transformation is the chain: Newton-to-Lagrange then Lagrange-to-Chebyshev.

Parameters:

transformation (TransformationABC) – The transformer instance with information about the origin polynomial (an instance of NewtonPolynomial) and the target type (ChebyshevPolynomial).

Returns:

The Newton-to-Chebyshev transformation operator.

Return type:

OperatorABC

__call__(origin_poly=None)#

Transformation of polynomial.

This function is called when an instance of transformation is called T() or T(x). If called without any arguments, the transformation is applied on the origin_poly used to construct the transformation. If an argument is passed, the transformation is applied on the instance passed.

Parameters:

origin_poly (MultivariatePolynomialSingleABC | None) – (optional) an instance of the polynomial to be transformed.

Returns:

an instance of the polynomial in the target basis.

__init__(origin_poly)#
Parameters:

origin_poly (MultivariatePolynomialSingleABC)

classmethod __init_subclass__(**kwargs)#

Add a concrete implementation to the registry of available transformations

__weakref__#

list of weak references to the object (if defined)

_apply_transformation(origin_poly)#

Transforms the polynomial to the target type of the transformation.

Parameters:

origin_poly – instance of the polynomial to be transformed

Returns:

an instance of the transformed polynomial in the target basis

property _target_indices: MultiIndexSet#

The MultiIndexSet of the target_poly.

Returns:

the indices the target polynomial will have

property grid: Grid#

The grid of the origin polynomial.

property multi_index: MultiIndexSet#

The multi index set of the origin polynomial (and also the target polynomial).

property transformation_operator: OperatorABC#

The polynomial basis transformation operator.

Returns:

instance of the transformation operator

Notes

The transformation operator once constructed can be reused for transforming other polynomial instance of the origin_poly type, which have the same basis (and grid) as the origin_poly, to the target_poly type.