Class TestOrthogonalPolynomialsBasisFunctionsCalculatable

java.lang.Object
com.polytechnik.utils.TestOrthogonalPolynomialsBasisFunctionsCalculatable
Direct Known Subclasses:
OrthogonalPolynomialsChebyshevBasis.TestChebyshevInMonomials, OrthogonalPolynomialsHermiteEBasis.TestHermiteEInMonomials

class TestOrthogonalPolynomialsBasisFunctionsCalculatable extends Object
Test OrthogonalPolynomialsBasisFunctionsCalculatable in monomials.
  • Field Details

  • Constructor Details

  • Method Details

    • convertToMonomials

      double[] convertToMonomials(double[] p)
    • getRadauMultiplied

      double[] getRadauMultiplied(double[] nodes)
      Multiply (in monomials basis) nodes by (x-x0) or (x0-x). Similar method OrthogonalPolynomialsBasisFunctionsCalculatable.getRadauMultiplied(double[]) does this in some basis, and this method does this in monomials basis.
    • getPolynomialRandomMoments

      static double[] getPolynomialRandomMoments(int n, double x_min, double x_max, int size, Random r)
    • getBasisRandomMoments

      double[] getBasisRandomMoments(int n, double x_min, double x_max, int size, Random r)
    • getRecurrenceABFromBasisRandomMoments

      RecurrenceAB getRecurrenceABFromBasisRandomMoments(int n, int tsize)
      This method: creates random sample, calculates it's moments (in basis), finds orthogonal polynomials, and finally calculates the RecurrenceAB 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

      Quadrature getXWDiscrete(int n)
    • 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

      static PolynomialRootsFinder.PRoots getXNodes(double[] nodes)
    • 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

      static RecurrenceAB getAB(double[][] p)
    • getOrthogonalPolynomialsFromAB

      static double[][] getOrthogonalPolynomialsFromAB(int kind, RecurrenceAB ab)
    • getSecondKindOrthogonalPolynomialsFromFirstKind

      static double[][] getSecondKindOrthogonalPolynomialsFromFirstKind(double[][] p)
    • getOrthogonalPolynomialsSecondKindFromAB

      static double[][] getOrthogonalPolynomialsSecondKindFromAB(RecurrenceAB ab)
    • getOrthogonalPolynomialsFirstKindFromAB

      static double[][] getOrthogonalPolynomialsFirstKindFromAB(RecurrenceAB ab)
    • 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 by RecurrenceAB.
    • 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

      void test_ONEECOND(int n, double[] momv, double[] momt, String txt)
    • getMaxNeqCut

      int getMaxNeqCut(int neq)
    • test_Calculations

      void test_Calculations(int tsize, int neq)
    • runTests

      void runTests(int neq_max)