org.apache.commons.math3.analysis.polynomials
Class TrigonometricPolynomialPrimitive

java.lang.Object
  extended by org.apache.commons.math3.analysis.polynomials.TrigonometricPolynomialPrimitive
All Implemented Interfaces:
Serializable, UnivariateDifferentiableFunction, UnivariateFunction

public final class TrigonometricPolynomialPrimitive
extends Object
implements UnivariateDifferentiableFunction, Serializable

This class represents a trigonometric polynomial primitive. Such a function is defined as being the sum of a {link TrigonometricPolynomialFunction} and a PolynomialFunction : P(x) = a0 + a1 x + sum( bk cos(kt) + ck sin(kt) )

Since:
1.1
Version:
$Id: TrigonometricPolynomialPrimitive.java 16755 2016-10-07 15:47:40Z bignon $
Author:
Rami Houdroge
See Also:
Serialized Form
Concurrency :
immutable

Constructor Summary
TrigonometricPolynomialPrimitive(PolynomialFunction linearPolynomial, TrigonometricPolynomialFunction trigonometricPolynomial)
          Constructor for the TrigonometricPolynomialPrimitive class
 
Method Summary
 TrigonometricPolynomialPrimitive add(PolynomialFunction poly)
          Add a PolynomialFunction
 TrigonometricPolynomialPrimitive add(TrigonometricPolynomialFunction poly)
          Add a TrigonometricPolynomialFunction
 TrigonometricPolynomialPrimitive add(TrigonometricPolynomialPrimitive poly)
          Add two TrigonometricPolynomialPrimitive
 UnivariateFunction derivative()
          Get first order derivative
 UnivariateFunction derivative(int n)
          Get nth order derivative
protected static double evaluate(TrigonometricPolynomialPrimitive polynomial, double x)
          Static evaluation method
 PolynomialFunction getLinearPolynomial()
          Get the Linear Polynomial Part
 TrigonometricPolynomialFunction getTrigonometricPolynomial()
          Get the Trigonometric Polynomial Part
 TrigonometricPolynomialPrimitive negate()
          Get opposite of current polynomial
 TrigonometricPolynomialPrimitive polynomialDerivative()
          Get first order derivative
 TrigonometricPolynomialPrimitive polynomialDerivative(int n)
          Get nth order derivative
protected static TrigonometricPolynomialPrimitive polynomialDerivative(TrigonometricPolynomialPrimitive poly)
          Get first order derivative
 TrigonometricPolynomialPrimitive scalarAdd(double scalar)
          Add a scalar to a TrigonometricPolynomialPrimitive
 TrigonometricPolynomialPrimitive scalarDivide(double scalar)
          Divide by a scalar
 TrigonometricPolynomialPrimitive scalarMultiply(double scalar)
          Multiply TrigonometricPolynomialPrimitive by a scalar
 TrigonometricPolynomialPrimitive scalarSubtract(double scalar)
          Subtract a scalar
 TrigonometricPolynomialPrimitive subtract(PolynomialFunction poly)
          Subtract a PolynomialFunction
 TrigonometricPolynomialPrimitive subtract(TrigonometricPolynomialFunction poly)
          Subtract a TrigonometricPolynomialFunction
 TrigonometricPolynomialPrimitive subtract(TrigonometricPolynomialPrimitive poly)
          Subtract two TrigonometricPolynomialPrimitive
 String toString()
          Get String representation of polynomial
 DerivativeStructure value(DerivativeStructure t)
          Simple mathematical function.
 double value(double x)
          Get value at given abscissa
 double value(int n, double x)
          Get value of derivative
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrigonometricPolynomialPrimitive

public TrigonometricPolynomialPrimitive(PolynomialFunction linearPolynomial,
                                        TrigonometricPolynomialFunction trigonometricPolynomial)
Constructor for the TrigonometricPolynomialPrimitive class

Parameters:
linearPolynomial - linear part
trigonometricPolynomial - trigonometric part
Method Detail

add

public TrigonometricPolynomialPrimitive add(TrigonometricPolynomialPrimitive poly)
Add two TrigonometricPolynomialPrimitive

Parameters:
poly - to add
Returns:
resulting TrigonometricPolynomialPrimitive

add

public TrigonometricPolynomialPrimitive add(PolynomialFunction poly)
Add a PolynomialFunction

Parameters:
poly - to add
Returns:
resulting TrigonometricPolynomialPrimitive

add

public TrigonometricPolynomialPrimitive add(TrigonometricPolynomialFunction poly)
Add a TrigonometricPolynomialFunction

Parameters:
poly - to add
Returns:
resulting TrigonometricPolynomialPrimitive

derivative

public UnivariateFunction derivative()
Get first order derivative

Returns:
derivative as a UnivariateFunction

derivative

public UnivariateFunction derivative(int n)
Get nth order derivative

Parameters:
n - order of derivative
Returns:
derivative as a UnivariateFunction

evaluate

protected static double evaluate(TrigonometricPolynomialPrimitive polynomial,
                                 double x)
Static evaluation method

Parameters:
polynomial - to evaluate
x - abscissa
Returns:
value of polynomial at abscissa

getLinearPolynomial

public PolynomialFunction getLinearPolynomial()
Get the Linear Polynomial Part

Returns:
the polynomial as a PolynomialFunction

getTrigonometricPolynomial

public TrigonometricPolynomialFunction getTrigonometricPolynomial()
Get the Trigonometric Polynomial Part

Returns:
the polynomial as a TrigonometricPolynomialFunction

negate

public TrigonometricPolynomialPrimitive negate()
Get opposite of current polynomial

Returns:
opposite

polynomialDerivative

public TrigonometricPolynomialPrimitive polynomialDerivative()
Get first order derivative

Returns:
derivative as an TrigonometricPolynomialPrimitive

polynomialDerivative

protected static TrigonometricPolynomialPrimitive polynomialDerivative(TrigonometricPolynomialPrimitive poly)
Get first order derivative

Parameters:
poly - polynomial to differentiate
Returns:
first order polynomial derivative as a TrigonometricPolynomialFunction

polynomialDerivative

public TrigonometricPolynomialPrimitive polynomialDerivative(int n)
Get nth order derivative

Parameters:
n - order of derivative (n > 0)
Returns:
nth order polynomial derivative as a TrigonometricPolynomialFunction

scalarAdd

public TrigonometricPolynomialPrimitive scalarAdd(double scalar)
Add a scalar to a TrigonometricPolynomialPrimitive

Parameters:
scalar - for addition
Returns:
resulting TrigonometricPolynomialPrimitive

scalarDivide

public TrigonometricPolynomialPrimitive scalarDivide(double scalar)
Divide by a scalar

Parameters:
scalar - to divide polynomial by
Returns:
polynomial divide by scalar

scalarMultiply

public TrigonometricPolynomialPrimitive scalarMultiply(double scalar)
Multiply TrigonometricPolynomialPrimitive by a scalar

Parameters:
scalar - for multiplication
Returns:
resulting TrigonometricPolynomialPrimitive

scalarSubtract

public TrigonometricPolynomialPrimitive scalarSubtract(double scalar)
Subtract a scalar

Parameters:
scalar - to subtract
Returns:
new TrigonometricPolynomialFunction

subtract

public TrigonometricPolynomialPrimitive subtract(TrigonometricPolynomialPrimitive poly)
Subtract two TrigonometricPolynomialPrimitive

Parameters:
poly - to Subtract
Returns:
resulting TrigonometricPolynomialPrimitive

subtract

public TrigonometricPolynomialPrimitive subtract(PolynomialFunction poly)
Subtract a PolynomialFunction

Parameters:
poly - to Subtract
Returns:
resulting TrigonometricPolynomialPrimitive

subtract

public TrigonometricPolynomialPrimitive subtract(TrigonometricPolynomialFunction poly)
Subtract a TrigonometricPolynomialFunction

Parameters:
poly - to Subtract
Returns:
resulting TrigonometricPolynomialPrimitive

toString

public String toString()
Get String representation of polynomial

Overrides:
toString in class Object
Returns:
string

value

public double value(double x)
Get value at given abscissa

Specified by:
value in interface UnivariateFunction
Parameters:
x - abscissa
Returns:
value a given abscissa

value

public double value(int n,
                    double x)
Get value of derivative

Parameters:
n - order of derivative
x - abscissa
Returns:
value of derivative at abscissa

value

public DerivativeStructure value(DerivativeStructure t)
Simple mathematical function.

UnivariateDifferentiableFunction classes compute both the value and the first derivative of the function.

Specified by:
value in interface UnivariateDifferentiableFunction
Parameters:
t - function input value
Returns:
function result


Copyright © 2016 CNES. All Rights Reserved.