Package com.polytechnik.utils
Interface BasisPolynomials
- All Superinterfaces:
BasisFunctionsCalculatable
,BasisFunctionsMultipliable
,ConfederateMatrixCalculatable
,SimpleBasisPolynomials
- All Known Implementing Classes:
Chebyshev
,HermiteE
,Laguerre
,Legendre
,LegendreShifted
,Monomials
,RecurrenceAB
,RecurrenceABWithMultiplicationCached
Basis of orthogonal polynomials.
Contains a few extra methods not available in
SimpleBasisPolynomials
.
Typical implementation is a classic basis such as
Chebyshev
,
Legendre
,
Laguerre
,
HermiteE
,
LegendreShifted
, and
Monomials
;
arbitrary three-term recurrence RecurrenceAB
is also available.-
Method Summary
Modifier and TypeMethodDescriptiondouble[]
getNext
(int n, double[] Qnm1, double[] Qnm2, boolean flag_type2, BasisFunctionsCalculatable PBASIS) Calculates n-th basis polynomial of this basis in PBASIS basis.default double[]
getNext
(int n, double[] Qnm1, double[] Qnm2, BasisFunctionsCalculatable PBASIS) Calculates n-th basis polynomial of this basis in PBASIS basis.default void
setNewtonBinomialLikeCoefs
(int n, double[] b, double[] q, double a, double x0) Calculates \( Q_n(a*(x+x_0)) \) using 3 term recurrence.Methods inherited from interface com.polytechnik.utils.BasisFunctionsCalculatable
calculate, convertFunctionTo_Basis_from_Monomials, convertFunctionTo_Basis_from_PBASIS, convertFunctionTo_Monomials_from_Basis, getaxbP, getD0, getD1, getD2, getDifferentiated, getIntegrated, getMomentsFromSample, getMomentsFromSample, getMomentsFromSample, getONE, getX0Moments, getXQkMomentsFromQkMoments, sdiv1
Methods inherited from interface com.polytechnik.utils.BasisFunctionsMultipliable
getBasisFunctionsMultipliedByPolynomial, getKK, getMomentsOfMeasureProducingPolynomialInKK, getMomentsOfMeasureProducingPolynomialInKK_MQQM, getPQkMomentsFromQkMoments, getQQMatr, getTwoQuadraticFormsProductAsQuadraticForm, mult2Pol, sdiv, setQlQmExpansionCoefs
Methods inherited from interface com.polytechnik.utils.ConfederateMatrixCalculatable
getConfederateMatrix
Methods inherited from interface com.polytechnik.utils.SimpleBasisPolynomials
convertBasisToPBASIS, convertFunctionTo_PBASIS_from_Basis, getBasisFunctionsMultipliedByPolynomial, getBasisFunctionsOnPolynomialArgument, getBasisFunctionsOnPolynomialArgument
-
Method Details
-
getNext
Description copied from interface:SimpleBasisPolynomials
Calculates n-th basis polynomial of this basis in PBASIS basis.- Specified by:
getNext
in interfaceSimpleBasisPolynomials
- Parameters:
n
- Q index.Qnm1
- Input \( Q_{n-1} \).Qnm2
- Input \( Q_{n-2} \).PBASIS
- The basis in which to calculte.- Returns:
- \( Q_{n} \) polynomial of this basis in PBASIS basis, array dimension n+1.
-
getNext
double[] getNext(int n, double[] Qnm1, double[] Qnm2, boolean flag_type2, BasisFunctionsCalculatable PBASIS) Calculates n-th basis polynomial of this basis in PBASIS basis.- Parameters:
n
- T index.Qnm1
- Input \( Q_{n-1} \).Qnm2
- Input \( Q_{n-2} \).flag_type2
- Whether to use type 2 polynomials. If type 2 polynomials are not available --- throw an exception. If not implemented -- an exception will be thrown. This method is typically not the proper way to obtain type 2 polynomials, use thegetOrthogonalPolynomialsSecondKindFromAB
instead.PBASIS
- The basis in which to calculte, form this basis we only need P*(a*x+b) operation, that is performed relatively this bais recurrence.- Returns:
- \( Q_{n} \) polynomial of this basis in PBASIS basis, array dimension n+1.
-
setNewtonBinomialLikeCoefs
default void setNewtonBinomialLikeCoefs(int n, double[] b, double[] q, double a, double x0) Calculates \( Q_n(a*(x+x_0)) \) using 3 term recurrence. Calculations in basis. The \( b_k^{n} \) are defined as: \( Q_n(a*(x+x_0))=\sum_{k=0}^{k=n}b_k^{n} Q_k(x) \) The method should be applied consequently to get \( b_k^{n} \) for n=0,1,2,3,... (in-place calculation). This is a generalization of Newton Binomial (monomials
case): \( (a*(x+x_0))^n=a^n\sum x^k x_0^{n-k} C_{n}^{k} \); \( b_k^n= a^n x_0^{n-k} C_{n}^{k} \). This method calculates "Newton Binomial" in arbitrary basis: \( Q_n(a*(x+x_0))=\sum_{k=0}^{k=n}b_k^{n} Q_k(x) \). Actual implementation is special, highly optimized version ofgetBasisFunctionsOnPolynomialArgument
with \( pol(x)=a*(x+x_0) \). The default implementation is very crude and slow (callsgetBasisFunctionsOnPolynomialArgument
), it is overloaded in actual implementations for speed.
Typical usage: realtime data moments calculation speed-up by recurrent calculation according to time--shift, seeQVMDataP
,QVMDataL
, andQVMData
.- Parameters:
n
- The max dimension of b.b
- On input: \( b_k^{n-1} \), on output \( b_k^{n} \).q
- On input: \( b_k^{n-2} \), on output: \( b_k^{n-1} \).
-