Package com.polytechnik.utils
Class TestOrthogonalPolynomialsBasisFunctionsCalculatable
java.lang.Object
com.polytechnik.utils.TestOrthogonalPolynomialsBasisFunctionsCalculatable
- Direct Known Subclasses:
OrthogonalPolynomialsChebyshevBasis.TestChebyshevInMonomials
,OrthogonalPolynomialsHermiteEBasis.TestHermiteEInMonomials
Test OrthogonalPolynomialsBasisFunctionsCalculatable in monomials.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final double
(package private) double[]
(package private) double[]
(package private) final String
(package private) final OrthogonalPolynomialsBasisFunctionsCalculatable
<? extends BasisFunctionsCalculatable> (package private) final Random
(package private) final double
(package private) final double
-
Constructor Summary
ConstructorsConstructorDescriptionTestOrthogonalPolynomialsBasisFunctionsCalculatable
(String name, OrthogonalPolynomialsBasisFunctionsCalculatable<? extends BasisFunctionsCalculatable> O, double eps, Random r, double x_min, double x_max) -
Method Summary
Modifier and TypeMethodDescription(package private) double[]
convertToMonomials
(double[] p) (package private) static RecurrenceAB
getAB
(double[][] p) (package private) double[]
getBasisMomentsConvertedFromMonomials
(double[] monomial_moments) (package private) double[]
getBasisRandomMoments
(int n, double x_min, double x_max, int size, Random r) (package private) double[][]
getD2QuadratureFromMoments_EV
(int n, double[] Lmoments, double[] Rmoments) x nodes on left argument, xnodes on right argument.(package private) int
getMaxNeqCut
(int neq) (package private) static double[]
getMomentsFromPolynomials
(double[][] p) Out of 0 ..(package private) static double[][]
getOrthogonalPolynomialsFirstKind
(int n, double[] mom) (package private) static double[][]
(package private) static double[][]
getOrthogonalPolynomialsFromAB
(int kind, RecurrenceAB ab) (package private) static double[][]
(package private) static double[]
getPolynomial
(int n, double[] imom) (package private) static double[]
getPolynomialRandomMoments
(int n, double x_min, double x_max, int size, Random r) (package private) double[]
getRadauMomentsFromMoments
(double[] mom) (package private) double[]
getRadauMultiplied
(double[] nodes) Multiply (in monomials basis) nodes by (x-x0) or (x0-x).(package private) Quadrature.GaussQuadratureWithNodesPolynomialData
getRadauQuadratureFromPolynomials
(int n, double[][] p) (package private) RecurrenceAB
getRecurrenceABFromBasisRandomMoments
(int n, int tsize) This method: creates random sample, calculates it's moments (in basis), finds orthogonal polynomials, and finally calculates theRecurrenceAB
from them.(package private) static double[]
getSecondKindOrthogonalPolynomialFromFirstKindAndMoments
(double[] p, double[] mom) Like Polynomials.getSecondKindOrthogonalPolynomialFromFirstKind, but scaled to orthonormal basis.(package private) static double[][]
getSecondKindOrthogonalPolynomialsFromFirstKind
(double[][] p) (package private) static double[][]
getSecondKindOrthogonalPolynomialsFromFirstKindAndMoments
(double[][] p, double[] mom) (package private) static double[]
getWeightsByIntegration
(double[] nodes, double[] x, double[] moms) (package private) static double[]
getWeightsChristoffel
(double[] x, double[][] p) (package private) static double[]
getWeigthsSDiv
(double[] nodes, double[] x, double[][] p) (package private) double
getX0()
(package private) static PolynomialRootsFinder.PRoots
getXNodes
(double[] nodes) (package private) Quadrature
getXWDiscrete
(int n) (package private) void
runTests
(int neq_max) (package private) void
setData
(int tsize, int n_moments) (package private) static void
sortNodes
(double[] x, double[] w) (package private) void
test_AB
(int neq) (package private) void
test_AB_as_Basis
(int neq) (package private) void
test_AB_conversion_PBASIS
(int neq) This method test a construction of orthogonal polynomials identified by the recurrence coefficients in any basis defined byRecurrenceAB
.(package private) void
test_Borges
(int neq) Print the results of Carlos F.(package private) void
test_Calculations
(int tsize, int neq) (package private) void
test_ChristoffelFunction
(int n) (package private) void
test_Discrete
(int n) (package private) void
(package private) void
test_ECOND
(int n) (package private) void
(package private) void
test_getABRadauModified
(int neq) (package private) void
test_getQxFromAB
(int neq) (package private) void
test_Kronrod
(int n, double[] moms, boolean flag_print) (package private) void
test_Kronrod_random
(int n) (package private) void
test_LebesgueQuadrature
(int n) (package private) void
test_MultipleOrthogonality
(int neq) Test multiple orthogonality on the same interval.(package private) void
test_MultipleOrthogonality_Disjoin
(int neq) Test multiple orthogonality on the disjoin intervals.(package private) double[][]
test_NodesPolynomial
(double[] nodes, double[] mom, int maxdegree) (package private) void
test_ONEECOND
(int n, double[] momv, double[] momt, String txt) (package private) void
test_Polynomials
(int neq) (package private) void
test_PolynomialsGramSchmidt
(int neq) (package private) void
(package private) void
test_QuadratureBasis
(double[] x, double[] w, double[] moments_b, int maxdegree, double eps) (package private) void
test_RadauMoments
(int neq) (package private) void
test_RadauMoments_directly_Bbasis
(double[] bnodes, double[] rbnodes) (package private) void
test_RadauNodes
(int neq) (package private) void
test_RegularNodes
(int neq) (package private) void
(package private) void
test_Type2
(int neq) (package private) void
test_TypeK
(int neq) (package private) void
test_WeightsAndNodes
(int neq) (package private) void
test_WExtremal
(int n)
-
Field Details
-
O
-
name
-
eps
final double eps -
r
-
x_min
final double x_min -
x_max
final double x_max -
mom_p
double[] mom_p -
mom_b
double[] mom_b
-
-
Constructor Details
-
TestOrthogonalPolynomialsBasisFunctionsCalculatable
TestOrthogonalPolynomialsBasisFunctionsCalculatable(String name, OrthogonalPolynomialsBasisFunctionsCalculatable<? extends BasisFunctionsCalculatable> O, double eps, Random r, double x_min, double x_max)
-
-
Method Details
-
convertToMonomials
double[] convertToMonomials(double[] p) -
getRadauMultiplied
double[] getRadauMultiplied(double[] nodes) Multiply (in monomials basis) nodes by (x-x0) or (x0-x). Similar methodOrthogonalPolynomialsBasisFunctionsCalculatable.getRadauMultiplied(double[])
does this in some basis, and this method does this in monomials basis. -
getPolynomialRandomMoments
-
getBasisRandomMoments
-
getRecurrenceABFromBasisRandomMoments
This method: creates random sample, calculates it's moments (in basis), finds orthogonal polynomials, and finally calculates theRecurrenceAB
from them.- Parameters:
n
- The number or polynomials to construct.tsize
- Sample size.- Returns:
- RecurrenceAB for the measure corresponding to the sample.
-
setData
void setData(int tsize, int n_moments) -
getXWDiscrete
-
getD2QuadratureFromMoments_EV
double[][] getD2QuadratureFromMoments_EV(int n, double[] Lmoments, double[] Rmoments) x nodes on left argument, xnodes on right argument. Uses generalized eigenvalues expansion. The method is used to test discrete measures. -
getBasisMomentsConvertedFromMonomials
double[] getBasisMomentsConvertedFromMonomials(double[] monomial_moments) -
sortNodes
static void sortNodes(double[] x, double[] w) -
test_NodesPolynomial
double[][] test_NodesPolynomial(double[] nodes, double[] mom, int maxdegree) -
test_QuadratureBasis
void test_QuadratureBasis(double[] x, double[] w, double[] moments_b, int maxdegree, double eps) -
getMomentsFromPolynomials
static double[] getMomentsFromPolynomials(double[][] p) Out of 0 .. 2*n moments (n=p.length-1) used to construct p only 0 .. 2*n-1 match. The last one is used for normalization of p[n] and cannot be recovered. -
getPolynomial
static double[] getPolynomial(int n, double[] imom) -
getOrthogonalPolynomialsFirstKind
static double[][] getOrthogonalPolynomialsFirstKind(int n, double[] mom) -
getSecondKindOrthogonalPolynomialFromFirstKindAndMoments
static double[] getSecondKindOrthogonalPolynomialFromFirstKindAndMoments(double[] p, double[] mom) Like Polynomials.getSecondKindOrthogonalPolynomialFromFirstKind, but scaled to orthonormal basis. -
getSecondKindOrthogonalPolynomialsFromFirstKindAndMoments
static double[][] getSecondKindOrthogonalPolynomialsFromFirstKindAndMoments(double[][] p, double[] mom) -
getXNodes
-
getWeightsChristoffel
static double[] getWeightsChristoffel(double[] x, double[][] p) -
getWeigthsSDiv
static double[] getWeigthsSDiv(double[] nodes, double[] x, double[][] p) -
getWeightsByIntegration
static double[] getWeightsByIntegration(double[] nodes, double[] x, double[] moms) -
getRadauMomentsFromMoments
double[] getRadauMomentsFromMoments(double[] mom) -
getX0
double getX0() -
getRadauQuadratureFromPolynomials
Quadrature.GaussQuadratureWithNodesPolynomialData getRadauQuadratureFromPolynomials(int n, double[][] p) -
getAB
-
getOrthogonalPolynomialsFromAB
-
getSecondKindOrthogonalPolynomialsFromFirstKind
static double[][] getSecondKindOrthogonalPolynomialsFromFirstKind(double[][] p) -
getOrthogonalPolynomialsSecondKindFromAB
-
getOrthogonalPolynomialsFirstKindFromAB
-
test_RegularNodes
void test_RegularNodes(int neq) -
test_WExtremal
void test_WExtremal(int n) -
test_RadauNodes
void test_RadauNodes(int neq) -
test_Type2
void test_Type2(int neq) -
test_TypeK
void test_TypeK(int neq) -
test_Polynomials
void test_Polynomials(int neq) -
test_PolynomialsGramSchmidt
void test_PolynomialsGramSchmidt(int neq) -
test_AB
void test_AB(int neq) -
test_AB_as_Basis
void test_AB_as_Basis(int neq) -
test_AB_conversion_PBASIS
void test_AB_conversion_PBASIS(int neq) This method test a construction of orthogonal polynomials identified by the recurrence coefficients in any basis defined byRecurrenceAB
. -
test_getQxFromAB
void test_getQxFromAB(int neq) -
test_getABRadauModified
void test_getABRadauModified(int neq) -
test_RadauMoments_directly_Bbasis
void test_RadauMoments_directly_Bbasis(double[] bnodes, double[] rbnodes) -
test_RadauMoments
void test_RadauMoments(int neq) -
test_WeightsAndNodes
void test_WeightsAndNodes(int neq) -
test_LebesgueQuadrature
void test_LebesgueQuadrature(int n) -
test_PsiAver_and_LebesgueQuadrature
void test_PsiAver_and_LebesgueQuadrature(int n) -
test_GenerateMeasureProducingPolynomial
void test_GenerateMeasureProducingPolynomial(int n) -
test_TwoQuadraticFormsProduct
void test_TwoQuadraticFormsProduct(int n) -
test_ChristoffelFunction
void test_ChristoffelFunction(int n) -
test_DistributionSkewness
void test_DistributionSkewness() -
test_Discrete
void test_Discrete(int n) -
test_ECOND
void test_ECOND(int n) -
test_Borges
void test_Borges(int neq) Print the results of Carlos F. Borges,Numer. Math. 67: 271-288 (1994), On a class of Gauss-like quadrature rules. x1 = 0.791263; x2 = 0.237959; x3 = 0.427455; x4 = 0.887481 Q1f = PI*(0.079050 f(x1) + 0.204235 f(x2) + 0.176469 f(x3) + 0.040245 f(x4)). Q2f = 0.082275 f(x1) + 0.507998 f(x2) + 0.866157 f(x3) + 0.543569 f(x4). The results match exactly. -
test_MultipleOrthogonality
void test_MultipleOrthogonality(int neq) Test multiple orthogonality on the same interval. Because the measures not always form Chebyshev system the unit test often fails. -
test_MultipleOrthogonality_Disjoin
void test_MultipleOrthogonality_Disjoin(int neq) Test multiple orthogonality on the disjoin intervals. -
test_Kronrod
void test_Kronrod(int n, double[] moms, boolean flag_print) -
test_Kronrod_random
void test_Kronrod_random(int n) -
test_ONEECOND
-
getMaxNeqCut
int getMaxNeqCut(int neq) -
test_Calculations
void test_Calculations(int tsize, int neq) -
runTests
void runTests(int neq_max)
-