Package org.robwork.sdurw_math
Class PolynomialNDEigenMatrix3ifComplexDouble
- java.lang.Object
-
- org.robwork.sdurw_math.PolynomialNDEigenMatrix3ifComplexDouble
-
public class PolynomialNDEigenMatrix3ifComplexDouble extends java.lang.Object
Representation of a polynomial that can have non-scalar coefficients (polynomial
matrix).
Representation of a polynomial of the following form:
f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0
The polynomial is represented as a list of coefficients ordered from lowest-order term to
highest-order term, {c_0,c_1,...,c_n}.
-
-
Constructor Summary
Constructors Constructor Description PolynomialNDEigenMatrix3ifComplexDouble(long order)
Create polynomial with uninitialized coefficients.PolynomialNDEigenMatrix3ifComplexDouble(long cPtr, boolean cMemoryOwn)
PolynomialNDEigenMatrix3ifComplexDouble(PolynomialNDEigenMatrix3ifComplexDouble p)
Create polynomial from other polynomial.PolynomialNDEigenMatrix3ifComplexDouble(SWIGTYPE_p_std__vectorT_Eigen__MatrixT_std__complexT_float_t_3_3_t_t coefficients)
Create polynomial from vector.
-
Method Summary
-
-
-
Constructor Detail
-
PolynomialNDEigenMatrix3ifComplexDouble
public PolynomialNDEigenMatrix3ifComplexDouble(long cPtr, boolean cMemoryOwn)
-
PolynomialNDEigenMatrix3ifComplexDouble
public PolynomialNDEigenMatrix3ifComplexDouble(long order)
Create polynomial with uninitialized coefficients.- Parameters:
order
- [in] the order of the polynomial.
-
PolynomialNDEigenMatrix3ifComplexDouble
public PolynomialNDEigenMatrix3ifComplexDouble(SWIGTYPE_p_std__vectorT_Eigen__MatrixT_std__complexT_float_t_3_3_t_t coefficients)
Create polynomial from vector.- Parameters:
coefficients
- [in] the coefficients ordered from lowest-order term to highest-order
term.
-
PolynomialNDEigenMatrix3ifComplexDouble
public PolynomialNDEigenMatrix3ifComplexDouble(PolynomialNDEigenMatrix3ifComplexDouble p)
Create polynomial from other polynomial.- Parameters:
p
- [in] the polynomial to copy.
-
-
Method Detail
-
getCPtr
public static long getCPtr(PolynomialNDEigenMatrix3ifComplexDouble obj)
-
delete
public void delete()
-
order
public long order()
Get the order of the polynomial (the highest power).- Returns:
- the order.
-
increaseOrder
public void increaseOrder(long increase, SWIGTYPE_p_Eigen__MatrixT_std__complexT_float_t_3_3_t value)
Increase the order of this polynomial.- Parameters:
increase
- [in] how much to increase the order (default is 1).value
- [in] initialize new coefficients to this value.
-
increaseOrder
public void increaseOrder(long increase)
-
increaseOrder
public void increaseOrder()
-
evaluate
public SWIGTYPE_p_Eigen__MatrixT_std__complexT_float_t_3_3_t evaluate(complexf x)
Evaluate the polynomial using Horner's Method.- Parameters:
x
- [in] the input parameter.- Returns:
- the value f(x).
-
evaluateDerivatives
public SWIGTYPE_p_std__vectorT_Eigen__MatrixT_std__complexT_float_t_3_3_t_t evaluateDerivatives(complexf x, long n)
Evaluate the first n derivatives of the polynomial using Horner's Method.- Parameters:
x
- [in] the input parameter.n
- [in] the number of derivatives to find (default is the first derivative only)- Returns:
- a vector of values {f(x),\dot{f}(x),\ddot{f}(x),\cdots}.
-
evaluateDerivatives
public SWIGTYPE_p_std__vectorT_Eigen__MatrixT_std__complexT_float_t_3_3_t_t evaluateDerivatives(complexf x)
Evaluate the first n derivatives of the polynomial using Horner's Method.- Parameters:
x
- [in] the input parameter.
- Returns:
- a vector of values {f(x),\dot{f}(x),\ddot{f}(x),\cdots}.
-
deflate
public PolynomialNDEigenMatrix3ifComplexDouble deflate(complexf x)
Perform deflation of polynomial.- Parameters:
x
- [in] a root of the polynomial.- Returns:
- a new polynomial of same order minus one.
Note: There is no check that the given root is in fact a root of the polynomial.
-
derivative
public PolynomialNDEigenMatrix3ifComplexDouble derivative(long n)
Get the derivative polynomial.- Parameters:
n
- [in] gives the n'th derivative (default is n=1).- Returns:
- a new polynomial of same order minus one.
Note: To evaluate derivatives use the evaluate derivative method which is more precise.
-
derivative
public PolynomialNDEigenMatrix3ifComplexDouble derivative()
Get the derivative polynomial.
- Returns:
- a new polynomial of same order minus one.
Note: To evaluate derivatives use the evaluate derivative method which is more precise.
-
get
public SWIGTYPE_p_Eigen__MatrixT_std__complexT_float_t_3_3_t get(long i)
-
set
public void set(long i, SWIGTYPE_p_Eigen__MatrixT_std__complexT_float_t_3_3_t d)
-
multiply
public PolynomialNDEigenMatrix3ifComplexDouble multiply(complexf s)
Scalar multiplication- Parameters:
s
- [in] scalar to multiply with.- Returns:
- new polynomial after multiplication.
-
divide
public PolynomialNDEigenMatrix3ifComplexDouble divide(complexf s)
Scalar division- Parameters:
s
- [in] scalar to divide with.- Returns:
- new polynomial after division.
-
multiplyAssign
public PolynomialNDEigenMatrix3ifComplexDouble multiplyAssign(complexf s)
Scalar multiplication- Parameters:
s
- [in] the scalar to multiply with.- Returns:
- reference to same polynomial with changed coefficients.
-
devideAssign
public PolynomialNDEigenMatrix3ifComplexDouble devideAssign(complexf s)
Scalar division- Parameters:
s
- [in] the scalar to divide with.- Returns:
- reference to same polynomial with changed coefficients.
-
subtract
public PolynomialNDEigenMatrix3ifComplexDouble subtract(PolynomialNDEigenMatrix3ifComplexDouble b)
Polynomial subtraction.- Parameters:
b
- [in] polynomial of to subtract.- Returns:
- new polynomial after subtraction.
-
subtractAssign
public PolynomialNDEigenMatrix3ifComplexDouble subtractAssign(PolynomialNDEigenMatrix3ifComplexDouble b)
Polynomial subtraction.- Parameters:
b
- [in] polynomial to subtract.- Returns:
- same polynomial with different coefficients after subtraction.
-
add
public PolynomialNDEigenMatrix3ifComplexDouble add(PolynomialNDEigenMatrix3ifComplexDouble b)
Polynomial addition.- Parameters:
b
- [in] polynomial to add.- Returns:
- new polynomial after addition.
-
addAssign
public PolynomialNDEigenMatrix3ifComplexDouble addAssign(PolynomialNDEigenMatrix3ifComplexDouble b)
Polynomial addition.- Parameters:
b
- [in] polynomial to add.- Returns:
- same polynomial with different coefficients after addition.
-
assign
public void assign(PolynomialNDEigenMatrix3ifComplexDouble b)
Assignment.- Parameters:
b
- [in] the polynomial to take coefficients from.
-
negate
public PolynomialNDEigenMatrix3ifComplexDouble negate()
Negate coefficients.- Returns:
- new polynomial with coefficients negated.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(PolynomialNDEigenMatrix3ifComplexDouble b)
Check if polynomials are equal.- Parameters:
b
- [in] the polynomial to compare with.- Returns:
- true if equal, false if not.
-
-