Package org.robwork.sdurw
Class PolynomialNDEigenRowVector3dDouble
- java.lang.Object
-
- org.robwork.sdurw.PolynomialNDEigenRowVector3dDouble
-
public class PolynomialNDEigenRowVector3dDouble 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 PolynomialNDEigenRowVector3dDouble(long order)
Create polynomial with uninitialized coefficients.PolynomialNDEigenRowVector3dDouble(long cPtr, boolean cMemoryOwn)
PolynomialNDEigenRowVector3dDouble(PolynomialNDEigenRowVector3dDouble p)
Create polynomial from other polynomial.PolynomialNDEigenRowVector3dDouble(VectorEigenRowVector3d coefficients)
Create polynomial from vector.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PolynomialNDEigenRowVector3dDouble
add(PolynomialNDEigenRowVector3dDouble b)
Polynomial addition.PolynomialNDEigenRowVector3dDouble
deflate(double x)
Perform deflation of polynomial.void
delete()
PolynomialNDEigenRowVector3dDouble
derivative()
Get the derivative polynomial.
PolynomialNDEigenRowVector3dDouble
derivative(long n)
Get the derivative polynomial.PolynomialNDEigenRowVector3dDouble
devideAssign(double s)
PolynomialNDEigenRowVector3dDouble
divide(double s)
Scalar divisionboolean
equals(PolynomialNDEigenRowVector3dDouble b)
Check if polynomials are equal.EigenRowVector3d
evaluate(double x)
Evaluate the polynomial using Horner's Method.VectorEigenRowVector3d
evaluateDerivatives(double x)
Evaluate the first n derivatives of the polynomial using Horner's Method.VectorEigenRowVector3d
evaluateDerivatives(double x, long n)
Evaluate the first n derivatives of the polynomial using Horner's Method.EigenRowVector3d
get(long i)
static long
getCPtr(PolynomialNDEigenRowVector3dDouble obj)
void
increaseOrder()
Increase the order of this polynomial.
Note: see increaseOrder(std::size_t,const Coef&) for a version that initializes the new
coefficients to a certain value.void
increaseOrder(long increase)
Increase the order of this polynomial.void
increaseOrder(long increase, EigenRowVector3d value)
Increase the order of this polynomial.PolynomialNDEigenRowVector3dDouble
multiply(double s)
Scalar multiplicationPolynomialNDEigenRowVector3dDouble
multiplyAssign(double s)
PolynomialNDEigenRowVector3dDouble
negate()
Negate coefficients.long
order()
Get the order of the polynomial (the highest power).void
set(long i, EigenRowVector3d d)
PolynomialNDEigenRowVector3dDouble
subtract(PolynomialNDEigenRowVector3dDouble b)
Polynomial subtraction.java.lang.String
toString()
-
-
-
Constructor Detail
-
PolynomialNDEigenRowVector3dDouble
public PolynomialNDEigenRowVector3dDouble(long cPtr, boolean cMemoryOwn)
-
PolynomialNDEigenRowVector3dDouble
public PolynomialNDEigenRowVector3dDouble(long order)
Create polynomial with uninitialized coefficients.- Parameters:
order
- [in] the order of the polynomial.
-
PolynomialNDEigenRowVector3dDouble
public PolynomialNDEigenRowVector3dDouble(VectorEigenRowVector3d coefficients)
Create polynomial from vector.- Parameters:
coefficients
- [in] the coefficients ordered from lowest-order term to highest-order
term.
-
PolynomialNDEigenRowVector3dDouble
public PolynomialNDEigenRowVector3dDouble(PolynomialNDEigenRowVector3dDouble p)
Create polynomial from other polynomial.- Parameters:
p
- [in] the polynomial to copy.
-
-
Method Detail
-
getCPtr
public static long getCPtr(PolynomialNDEigenRowVector3dDouble 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)
Increase the order of this polynomial.- Parameters:
increase
- [in] how much to increase the order (default is 1).
Note: see increaseOrder(std::size_t,const Coef&) for a version that initializes the new
coefficients to a certain value.
-
increaseOrder
public void increaseOrder()
Increase the order of this polynomial.
Note: see increaseOrder(std::size_t,const Coef&) for a version that initializes the new
coefficients to a certain value.
-
increaseOrder
public void increaseOrder(long increase, EigenRowVector3d 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.
-
evaluate
public EigenRowVector3d evaluate(double x)
Evaluate the polynomial using Horner's Method.- Parameters:
x
- [in] the input parameter.- Returns:
- the value f(x) .
-
evaluateDerivatives
public VectorEigenRowVector3d evaluateDerivatives(double 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 VectorEigenRowVector3d evaluateDerivatives(double 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 PolynomialNDEigenRowVector3dDouble deflate(double 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 PolynomialNDEigenRowVector3dDouble 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 PolynomialNDEigenRowVector3dDouble 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.
-
multiply
public PolynomialNDEigenRowVector3dDouble multiply(double s)
Scalar multiplication- Parameters:
s
- [in] scalar to multiply with.- Returns:
- new polynomial after multiplication.
-
divide
public PolynomialNDEigenRowVector3dDouble divide(double s)
Scalar division- Parameters:
s
- [in] scalar to divide with.- Returns:
- new polynomial after division.
-
multiplyAssign
public PolynomialNDEigenRowVector3dDouble multiplyAssign(double s)
-
devideAssign
public PolynomialNDEigenRowVector3dDouble devideAssign(double s)
-
subtract
public PolynomialNDEigenRowVector3dDouble subtract(PolynomialNDEigenRowVector3dDouble b)
Polynomial subtraction.- Parameters:
b
- [in] polynomial of to subtract.- Returns:
- new polynomial after subtraction.
-
add
public PolynomialNDEigenRowVector3dDouble add(PolynomialNDEigenRowVector3dDouble b)
Polynomial addition.- Parameters:
b
- [in] polynomial to add.- Returns:
- new polynomial after addition.
-
negate
public PolynomialNDEigenRowVector3dDouble negate()
Negate coefficients.- Returns:
- new polynomial with coefficients negated.
-
equals
public boolean equals(PolynomialNDEigenRowVector3dDouble b)
Check if polynomials are equal.- Parameters:
b
- [in] the polynomial to compare with.- Returns:
- true if equal, false if not.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
get
public EigenRowVector3d get(long i)
-
set
public void set(long i, EigenRowVector3d d)
-
-