chebyshev#
Implementations of the transformation classes from
ChebyshevPolynomial
(polynomials in the
Chebyshev basis
of the first kind) to:
LagrangePolynomial
(polynomials in the Lagrange basis)NewtonPolynomial
(polynomials in the Newton basis)CanonicalPolynomial
(polynomials in the canonical basis)
- class minterpy.transformations.chebyshev.ChebyshevToLagrange(origin_poly)[source]#
Bases:
TransformationABC
Transformation from the Chebyshev 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
ChebyshevPolynomial
- target_type#
alias of
LagrangePolynomial
- _get_transformation_operator()#
Construct the Chebyshev to Lagrange transformation operator.
- Parameters:
transformation (TransformationABC) – The transformer instance with information about the origin polynomial (an instance of ChebyshevPolynomial) and the target type (LagrangePolynomial).
- Returns:
The Chebyshev-to-Lagrange transformation operator.
- Return type:
Notes
The transformation is carried out by evaluation at the unisolvent nodes; this is not a sparse transformation operator.
- __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.chebyshev.ChebyshevToNewton(origin_poly)[source]#
Bases:
TransformationABC
Transformation from the Chebyshev 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
ChebyshevPolynomial
- target_type#
alias of
NewtonPolynomial
- _get_transformation_operator()#
Construct the Chebyshev-to-Newton transformation operator.
The transformation is the chain: Chebyshev-to-Lagrange then Lagrange-to-Newton.
- Parameters:
transformation (TransformationABC) – The transformer instance with information about the origin polynomial (an instance of ChebyshevPolynomial) and the target type (NewtonPolynomial).
- Returns:
The Chebyshev-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.chebyshev.ChebyshevToCanonical(origin_poly)[source]#
Bases:
TransformationABC
Transformation from the Chebyshev basis to the Canonical 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
ChebyshevPolynomial
- target_type#
alias of
CanonicalPolynomial
- _get_transformation_operator()#
Construct the Chebyshev-to-Canonical transformation operator.
The transformation is the chain: Chebyshev-to-Lagrange then Lagrange-to-Newton then Newton-to-Canonical.
The Lagrange-to-Canonical is implemented as a single operator.
- Parameters:
transformation (TransformationABC) – The transformer instance with information about the origin polynomial (an instance of ChebyshevPolynomial) and the target type (NewtonPolynomial).
- Returns:
The Chebyshev-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.