Click or drag to resize

Polynomial Class

A single-variable polynomial with real-valued coefficients and non-negative exponents.
Inheritance Hierarchy
SystemObject
  Altaxo.CalcPolynomial

Namespace: Altaxo.Calc
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3572.0 (4.8.3572.0)
Syntax
C#
[SerializableAttribute]
public class Polynomial : IFormattable, IEquatable<Polynomial>, 
	ICloneable

The Polynomial type exposes the following members.

Constructors
 NameDescription
Public methodPolynomial Create a zero-polynomial
Public methodPolynomial(Double) Create a constant polynomial. Example: 3.0 -> "p : x -> 3.0"
Public methodPolynomial(Double) Create a polynomial with the provided coefficients (in ascending order, where the index matches the exponent). Example: {5, 0, 2} -> "p : x -> 5 + 0 x^1 + 2 x^2".
Public methodPolynomial(IEnumerableDouble) Create a polynomial with the provided coefficients (in ascending order, where the index matches the exponent). Example: {5, 0, 2} -> "p : x -> 5 + 0 x^1 + 2 x^2".
Public methodPolynomial(Int32) Create a zero-polynomial with a coefficient array of the given length. An array of length N can support polynomials of a degree of at most N-1.
Top
Properties
 NameDescription
Public propertyCoefficients The coefficients of the polynomial in a
Public propertyDegree Degree of the polynomial, i.e. the largest monomial exponent. For example, the degree of y=x^2+x^5 is 5, for y=3 it is 0. The null-polynomial returns degree -1 because the correct degree, negative infinity, cannot be represented by integers.
Public propertyStatic memberZero Gets the zero polynomial.
Top
Methods
 NameDescription
Public methodStatic memberAdd(Polynomial, Polynomial) Addition of two Polynomials (point-wise).
Public methodStatic memberAdd(Polynomial, Double) Addition of a polynomial and a scalar.
Public methodClone Creates a copy of the polynomial.
Public methodDifferentiate Differentiates the polynomial.
Public methodStatic memberDivide Scales a polynomial by division by a scalar
Public methodDivideRemainder(Polynomial) Division of two polynomials returning the quotient-with-remainder of the two polynomials given
Public methodStatic memberDivideRemainder(Polynomial, Polynomial) Euclidean long division of two polynomials, returning the quotient q and remainder r of the two polynomials a and b such that a = q*b + r
Public methodEigenvalueMatrix Gets the eigenvalue matrix A of this polynomial such that eig(A) = roots of this polynomial.
Public methodEquals(Object) Determines whether the specified object is equal to the current instance.
(Overrides ObjectEquals(Object))
Public methodEquals(Polynomial) Determines whether the specified polynomial is equal to the current instance.
Public methodEvaluate(Complex) Evaluate a polynomial at point x.
Public methodEvaluate(Double) Evaluate a polynomial at point x.
Public methodEvaluate(IEnumerableDouble) Evaluate a polynomial at points z.
Public methodEvaluate(IEnumerableComplex) Evaluate a polynomial at points z.
Public methodStatic memberEvaluate(Complex, Double) Evaluate a polynomial at point x. Coefficients are ordered ascending by power with power k at index k. Example: coefficients [3,-1,2] represent y=2x^2-x+3.
Public methodStatic memberEvaluate(Complex, Complex) Evaluate a polynomial at point x. Coefficients are ordered ascending by power with power k at index k. Example: coefficients [3,-1,2] represent y=2x^2-x+3.
Public methodStatic memberEvaluate(Double, Double) Evaluate a polynomial at point x. Coefficients are ordered ascending by power with power k at index k. Example: coefficients [3,-1,2] represent y=2x^2-x+3.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodStatic memberFit Least-Squares fitting the points (x,y) to a k-order polynomial y : x -> p0 + p1*x + p2*x^2 + ... + pk*x^k
Public methodGetHashCode Serves as the default hash function.
(Overrides ObjectGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIntegrate Integrates the polynomial with a zero constant term.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodStatic memberMultiply(Polynomial, Polynomial) Multiplies a polynomial by a polynomial (convolution)
Public methodStatic memberMultiply(Polynomial, Double) Scales a polynomial by a scalar
Public methodStatic memberNegate Negation of a polynomial.
Public methodStatic memberPointwiseDivide Point-wise division of two Polynomials
Public methodStatic memberPointwiseMultiply Point-wise multiplication of two Polynomials
Public methodRoots Calculates the complex roots of the polynomial by eigenvalue decomposition.
Public methodStatic memberSubtract(Double, Polynomial) Addition of a polynomial from a scalar.
Public methodStatic memberSubtract(Polynomial, Polynomial) Subtraction of two Polynomials (point-wise).
Public methodStatic memberSubtract(Polynomial, Double) Addition of a scalar from a polynomial.
Public methodToString Format the polynomial in ascending order, e.g. "4.3 + 2.0x^2 - x^3".
(Overrides ObjectToString)
Public methodToString(IFormatProvider) Format the polynomial in ascending order, e.g. "4.3 + 2.0x^2 - x^3".
Public methodToString(String) Format the polynomial in ascending order, e.g. "4.3 + 2.0x^2 - x^3".
Public methodToString(String, IFormatProvider) Format the polynomial in ascending order, e.g. "4.3 + 2.0x^2 - x^3".
Public methodToStringDescending Format the polynomial in descending order, e.g. "x^3 + 2.0x^2 - 4.3".
Public methodToStringDescending(IFormatProvider) Format the polynomial in descending order, e.g. "x^3 + 2.0x^2 - 4.3".
Public methodToStringDescending(String) Format the polynomial in descending order, e.g. "x^3 + 2.0x^2 - 4.3".
Public methodToStringDescending(String, IFormatProvider) Format the polynomial in descending order, e.g. "x^3 + 2.0x^2 - 4.3".
Top
Operators
 NameDescription
Public operatorStatic memberAddition(Double, Polynomial) adds a scalar to a polynomial.
Public operatorStatic memberAddition(Polynomial, Polynomial) Addition of two Polynomials (piecewise)
Public operatorStatic memberAddition(Polynomial, Double) adds a scalar to a polynomial.
Public operatorStatic memberDivision(Polynomial, Double) Divides a polynomial by scalar value.
Public operatorStatic memberMultiply(Double, Polynomial) Multiplies a polynomial by a scalar.
Public operatorStatic memberMultiply(Polynomial, Polynomial) Multiplies a polynomial by a polynomial (convolution).
Public operatorStatic memberMultiply(Polynomial, Double) Multiplies a polynomial by a scalar.
Public operatorStatic memberSubtraction(Double, Polynomial) Subtracts a polynomial from a scalar.
Public operatorStatic memberSubtraction(Polynomial, Polynomial) Subtraction of two polynomial.
Public operatorStatic memberSubtraction(Polynomial, Double) Subtracts a scalar from a polynomial.
Public operatorStatic memberUnaryNegation(Polynomial) Negates a polynomial.
Top
Fields
 NameDescription
Public fieldVariableName Only needed for the ToString method
Top
See Also