Xmipp  v3.23.11-Nereus
Functions
Collaboration diagram for Polynomial:

Functions

int PolynomialDifferentiation (double a[], long Degree, double b[])
 
int PolynomialEvaluation (double x, double a[], long Degree, double *Result)
 
int PolynomialMultiplication (double a1[], long Degree1, double a2[], long Degree2, double b[])
 
int PolynomialPrimitive (double a[], long Degree, double b[])
 
int PolynomialRealRoots (double a[], long Degree, double RealRoot[], long *RealRootNumber, double Tolerance, int *Status)
 
double Sign (double x)
 
double xPlus (double x, double p)
 

Detailed Description

Function Documentation

◆ PolynomialDifferentiation()

int PolynomialDifferentiation ( double  a[],
long  Degree,
double  b[] 
)

Differentiation of the polynomial p(x) = (a[0] + Sum a[k] x^k). The degree of the input polynomial is Degree. There are (Degree+1) input coefficients. The degree of the output polynomial is (Degree-1). There are Degree output coefficients.

success: return(!ERROR); failure: return(ERROR)

◆ PolynomialEvaluation()

int PolynomialEvaluation ( double  x,
double  a[],
long  Degree,
double *  Result 
)

Evaluates a polynomial: result = a[0] + Sum a[k] x^k. The degree of the polynomial is Degree. There are (Degree+1) coefficients.

success: return(!ERROR); failure: return(ERROR)

◆ PolynomialMultiplication()

int PolynomialMultiplication ( double  a1[],
long  Degree1,
double  a2[],
long  Degree2,
double  b[] 
)

Polynomial multuplication. Multiplication resulting in b[0] + Sum b[k] x^k = (a1[0] + Sum a1[k] x^k) (a2[0] + Sum a2[k] x^k).

The degree of the 1st input polynomial is Degree1. The degree of the 2nd input polynomial is Degree2. There are (Degree1+1) input coefficients for the first multiplicand. There are (Degree2+1) input coefficients for the second multiplicand. The degree of the output polynomial is (Degree1+Degree2). There are (Degree1+Degree2+1) output coefficients.

success: return(!ERROR); failure: return(ERROR)

◆ PolynomialPrimitive()

int PolynomialPrimitive ( double  a[],
long  Degree,
double  b[] 
)

Primitive of the polynomial p(t) = (a[0] + Sum a[k] t^k). The degree of the input polynomial is Degree. There are (Degree+1) input coefficients. The degree of the output polynomial is (Degree+1). There are (Degree+2) output coefficients.

success: return(!ERROR); failure: return(ERROR)

◆ PolynomialRealRoots()

int PolynomialRealRoots ( double  a[],
long  Degree,
double  RealRoot[],
long *  RealRootNumber,
double  Tolerance,
int *  Status 
)

Find the real roots of the polynomial p(x) = (a[0] + Sum a[k] x^k). The degree of the polynomial is Degree. There are (Degree+1) input coefficients (a[]). The output array (RealRoot[]) must have size (Degree). Only the first (RealRootNumber) roots returned in RealRoot[] are valid. (RealRootNumber) -> -1 when the equation is indeterminate. The returned roots are sorted in ascendent order.

success: return(!ERROR); failure: return(ERROR)

◆ Sign()

double Sign ( double  x)

Returns the sign of x with Sign(0) = 0.

◆ xPlus()

double xPlus ( double  x,
double  p 
)

Computes the one-sided power function. xPlus(0, 0) = 1/2