canonical#
Implementations of the transformation classes from
CanonicalPolynomial
(polynomials in the
canonical basis)
to:
LagrangePolynomial
(polynomials in the Lagrange basis)NewtonPolynomial
(polynomials in the Newton basis)ChebyshevPolynomial
(polynomials in the Chebyshev basis of the first kind)
- class minterpy.transformations.canonical.CanonicalToLagrange(origin_poly)[source]#
Bases:
TransformationABC
Transformation from the canonical basis to the Lagrange basis.
Properties
The grid of the origin polynomial.
The multi index set of the origin polynomial (and also the target polynomial).
The polynomial basis transformation operator.
- Parameters:
origin_poly (MultivariatePolynomialSingleABC)
- origin_type#
alias of
CanonicalPolynomial
- target_type#
alias of
LagrangePolynomial
- _get_transformation_operator()#
Construct the Canonical-to-Lagrange transformation operator.
The transformation is the chain: Canonical-to-Newton then Newton-to-Lagrange.
- Parameters:
transformation (TransformationABC) – The transformer instance with information about the origin polynomial (an instance of CanonicalPolynomial) and the target type (LagrangePolynomial).
- Returns:
The Canonical-to-Lagrange transformation operator.
- Return type:
- __call__(origin_poly=None)#
Transformation of polynomial.
This function is called when an instance of transformation is called
T()
orT(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 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.canonical.CanonicalToNewton(origin_poly)[source]#
Bases:
TransformationABC
Transformation from the canonical basis to the Newton basis.
Properties
The grid of the origin polynomial.
The multi index set of the origin polynomial (and also the target polynomial).
The polynomial basis transformation operator.
- Parameters:
origin_poly (MultivariatePolynomialSingleABC)
- origin_type#
alias of
CanonicalPolynomial
- target_type#
alias of
NewtonPolynomial
- _get_transformation_operator()#
Construct the Canonical-to-Newton transformation operator.
- Parameters:
transformation (TransformationABC) – The transformer instance with information about the origin polynomial (an instance of CanonicalPolynomial) and the target type (NewtonPolynomial).
- Returns:
The Canonical-to-Newton transformation operator.
- Return type:
- __call__(origin_poly=None)#
Transformation of polynomial.
This function is called when an instance of transformation is called
T()
orT(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 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.canonical.CanonicalToChebyshev(origin_poly)[source]#
Bases:
TransformationABC
Transformation from the canonical basis to the Chebyshev basis.
Properties
The grid of the origin polynomial.
The multi index set of the origin polynomial (and also the target polynomial).
The polynomial basis transformation operator.
- Parameters:
origin_poly (MultivariatePolynomialSingleABC)
- origin_type#
alias of
CanonicalPolynomial
- target_type#
alias of
ChebyshevPolynomial
- _get_transformation_operator()#
Construct the Canonical-to-Chebyshev transformation operator.
The transformation is the chain: Canonical-to-Newton then Newton-to-Lagrange then Lagrange-to-Chebyshev.
The Canonical-to-Lagrange operator is implemented as a single operator.
- Parameters:
transformation (TransformationABC) – The transformer instance with information about the origin polynomial (an instance of CanonicalPolynomial) and the target type (ChebyshevPolynomial).
- Returns:
The canonical-to-Chebyshev transformation operator.
- Return type:
- __call__(origin_poly=None)#
Transformation of polynomial.
This function is called when an instance of transformation is called
T()
orT(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 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.