Package com.polytechnik.utils
Interface SimpleBasisPolynomials
- All Superinterfaces:
BasisFunctionsCalculatable
,BasisFunctionsMultipliable
,ConfederateMatrixCalculatable
- All Known Subinterfaces:
BasisPolynomials
- All Known Implementing Classes:
Chebyshev
,HermiteE
,Laguerre
,Legendre
,LegendreShifted
,Monomials
,RecurrenceAB
,RecurrenceABWithMultiplicationCached
A basis (possibly non--normalized) with three term recurrence.
This interface is typically a part of
BasisPolynomials
functionality,
however when we have a basis with only recurrence coefficients
available this interface can be used directly to convert to/from it using
convertFunctionTo_PBASIS_from_Basis
and
convertFunctionTo_Basis_from_PBASIS
.-
Method Summary
Modifier and TypeMethodDescriptiondefault double[][]
convertBasisToPBASIS
(int num, BasisFunctionsCalculatable PBASIS) A helper method to convert this basis to PBASIS.default double[]
convertFunctionTo_PBASIS_from_Basis
(double[] Qcoefs, BasisFunctionsCalculatable PBASIS) Convert from basis to PBASIS basis.default double[][]
getBasisFunctionsMultipliedByPolynomial
(int numQl, double[] pol, BasisFunctionsCalculatable PBASIS) A helper method to calculate a product of this basis functions by a polynomial in given basis.default double[][]
getBasisFunctionsOnPolynomialArgument
(int numQl, double[] pol) The same asgetBasisFunctionsOnPolynomialArgument
with bothpol
and result in this basis.double[][]
getBasisFunctionsOnPolynomialArgument
(int numQl, double[] pol, BasisFunctionsCalculatable PBASIS) This method calculates \( Q_l(pol(x))\), where pol(x) is a given polynomial and \( Q_l \) is basis finction of this (notPBASIS
!) basis.double[]
getNext
(int n, double[] Qnm1, double[] Qnm2, BasisFunctionsCalculatable PBASIS) Calculates n-th basis polynomial of this basis in PBASIS basis.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
-
Method Details
-
getNext
Calculates n-th basis polynomial of this basis in PBASIS basis.- 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.
-
getBasisFunctionsOnPolynomialArgument
double[][] getBasisFunctionsOnPolynomialArgument(int numQl, double[] pol, BasisFunctionsCalculatable PBASIS) This method calculates \( Q_l(pol(x))\), where pol(x) is a given polynomial and \( Q_l \) is basis finction of this (notPBASIS
!) basis. This method may not be stable for a large dimensions ofpol.length
. Equivalent to numQl applications ofgetNext(int, double[], double[], com.polytechnik.utils.BasisFunctionsCalculatable)
topol
array. The method can be used to calculate e.g. \( T_n(P_k(x)) \) or \( T_n(P_k(L_m(x^j))) \). For example
meansnew Legendre().getBasisFunctionsOnPolynomialArgument(4,new double []{0,0,0,0,1},new Chebyshev()) ={ { 1.0 }, { 0.0, 0.0, 0.0, 0.0, 1.0 }, { 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75 }, { 0.0, 0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.625 } }
\( P_0(T_4(x))=T_0 \)
\( P_1(T_4(x))=T_4(x) \)
\( P_2(T_4(x))=0.25*T_0+0.75*T_8(x) \)
\( P_3(T_4(x))=0.375*T_4(x)+0.625*T_{12}(x) \).- Parameters:
numQl
- The number of basis functions to calculate.pol
- The polynomial to use in \( Q_l(pol(x))\), it is given in thePBASIS
basis.PBASIS
- the basis in whichpol
is given and the result is returned.- Returns:
- An array of numQl dimension, elements: \( Q_0(pol(x)) \),
\( Q_1(pol(x)) \), ... \( Q_{numQl-1}(pol(x)) \) in the basis
PBASIS
.
-
getBasisFunctionsOnPolynomialArgument
default double[][] getBasisFunctionsOnPolynomialArgument(int numQl, double[] pol) The same asgetBasisFunctionsOnPolynomialArgument
with bothpol
and result in this basis. -
getBasisFunctionsMultipliedByPolynomial
default double[][] getBasisFunctionsMultipliedByPolynomial(int numQl, double[] pol, BasisFunctionsCalculatable PBASIS) A helper method to calculate a product of this basis functions by a polynomial in given basis. The method can be used to calculate e.g. \( P_k(x) T_j(x) \) or \( P_k(x) T_j(x) L_i(x) \). For example
meansnew Legendre().getBasisFunctionsMultipliedByPolynomial(4,new double []{0,0,0,0,1},new Chebyshev()) ={ { 0.0, 0.0, 0.0, 0.0, 1.0 }, { 0.0, 0.0, 0.0, 0.5, 0.0, 0.5 }, { 0.0, 0.0, 0.375, 0.0, 0.25, 0.0, 0.375 }, { 0.0, 0.3125, 0.0, 0.1875, 0.0, 0.1875, 0.0, 0.3125 } }
\( P_0(x)*T_4(x)=T_4(x) \)
\( P_1(x)*T_4(x)=0.5*T_3(x)+0.5*T_5(x) \)
\( P_2(x)*T_4(x)=0.375*T_2(x)+0.25*T_4(x)+0.375*T_6(x) \)
\( P_3(x)*T_4(x)=0.3125*T_1(x)+0.1875*T_{3}(x)+0.1875*T_5(x)+0.3125*T_7(x) \). -
convertBasisToPBASIS
A helper method to convert this basis to PBASIS. A typical usage is e.g. to convertChebyshev
toLegendre
or to a generalRecurrenceAB
basis. To convert to monomials usePBASIS=new Monomials()
. The method appliesgetNext()
in a serie. For example
meansnew Legendre().convertBasisToPBASIS(4,new Chebyshev()) ={ { 1.0 }, { 0.0, 1.0 }, { 0.25, 0.0, 0.75 }, { 0.0, 0.375, 0.0, 0.625 } }
\( P_0(x)=T_0(x) \)
\( P_1(x)=T_1(x) \)
\( P_2(x)=0.25*T_0(x)+0.75*T_2(x) \)
\( P_3(x)=0.375*T_1(x)+0.625*T_3(x) \).- Specified by:
convertBasisToPBASIS
in interfaceBasisFunctionsCalculatable
- Parameters:
num
- The number of elements in serie.PBASIS
- The basis in which we obtain this basis polynomials.- Returns:
getNext(int, double[], double[], com.polytechnik.utils.BasisFunctionsCalculatable)
applied ton=0,1,2,...num-1
basis functions; output array elements are this basis polynomials in the basis PBASIS.
-
convertFunctionTo_PBASIS_from_Basis
default double[] convertFunctionTo_PBASIS_from_Basis(double[] Qcoefs, BasisFunctionsCalculatable PBASIS) Convert from basis to PBASIS basis.- Specified by:
convertFunctionTo_PBASIS_from_Basis
in interfaceBasisFunctionsCalculatable
- Parameters:
Qcoefs
- Coefficients.PBASIS
- The basis to convert to.- Returns:
- Polynomial in PBASIS.
-