Class MjPolynomial1f
java.lang.Object
gov.nih.mipav.view.renderer.J3D.surfaceview.brainflattenerview.MjPolynomial1f
Limited implementation of a floating-point polynomial of 1 variable.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected float[]DOCUMENT ME!protected intDOCUMENT ME!private static final floatDOCUMENT ME!private static final floatDOCUMENT ME!private static final floatDOCUMENT ME!private static final floatDOCUMENT ME!private static final floatDOCUMENT ME! -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new MjPolynomial1f object.MjPolynomial1f(int iDegree) Creates a new MjPolynomial1f object. -
Method Summary
Modifier and TypeMethodDescriptionbisection(float fXMin, float fXMax, int iDigitsAccuracy) Returns Float which is null if no root is found; otherwise contains the value of the root.floateval(float fT) evaluate this polynomial for the specified value.floatgetCoeff(int i) DOCUMENT ME!intDOCUMENT ME!return new instance which is the derivative of this instance.floatCalled by computeRadius, finds the root of the invalid input: '<'= 8 degree polynomial through bisection method:intgetRootsOnInterval(float fXMin, float fXMax, float[] afRoot, int iDigitsAccuracy) afRoot should have length 2; returns number roots found, which are returned in the afRoot array.voidmul(MjPolynomial1f kPoly1, MjPolynomial1f kPoly2) set this polynomial to the product of two polynomials.introotsDegree3(float[] afRoot) afRoot should have length 3 which is used to return the real roots found; returns 0 if no root can be found, otherwise returns the number of real roots found (1 or 3);voidscale(float fScalar) sets this instance to the scalar product with itself.voidset(MjPolynomial1f kPoly) set this polynomial to have the same coefficients as those in the specified polynomial.voidsetCoeff(int i, float fValue) DOCUMENT ME!voidsub(MjPolynomial1f kPoly1, MjPolynomial1f kPoly2) sets this instance to the difference of two polynomial instances.
-
Field Details
-
ms_fInvLog2
private static final float ms_fInvLog2DOCUMENT ME! -
ms_fLog10
private static final float ms_fLog10DOCUMENT ME! -
ms_fThird
private static final float ms_fThirdDOCUMENT ME!- See Also:
-
ms_fSqrt3
private static final float ms_fSqrt3DOCUMENT ME! -
ms_fTwentySeventh
private static final float ms_fTwentySeventhDOCUMENT ME!- See Also:
-
m_afCoeff
protected float[] m_afCoeffDOCUMENT ME! -
m_iDegree
protected int m_iDegreeDOCUMENT ME!
-
-
Constructor Details
-
MjPolynomial1f
public MjPolynomial1f()Creates a new MjPolynomial1f object. -
MjPolynomial1f
public MjPolynomial1f(int iDegree) Creates a new MjPolynomial1f object.- Parameters:
iDegree- DOCUMENT ME!
-
-
Method Details
-
bisection
Returns Float which is null if no root is found; otherwise contains the value of the root.- Parameters:
fXMin- DOCUMENT ME!fXMax- DOCUMENT ME!iDigitsAccuracy- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
eval
public float eval(float fT) evaluate this polynomial for the specified value.- Parameters:
fT- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getCoeff
public float getCoeff(int i) DOCUMENT ME!- Parameters:
i- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getDegree
public int getDegree()DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getDerivative
return new instance which is the derivative of this instance.- Returns:
- DOCUMENT ME!
-
getRootBisection
public float getRootBisection()Called by computeRadius, finds the root of the invalid input: '<'= 8 degree polynomial through bisection method:- Returns:
- DOCUMENT ME!
-
getRootsOnInterval
public int getRootsOnInterval(float fXMin, float fXMax, float[] afRoot, int iDigitsAccuracy) afRoot should have length 2; returns number roots found, which are returned in the afRoot array.- Parameters:
fXMin- DOCUMENT ME!fXMax- DOCUMENT ME!afRoot- DOCUMENT ME!iDigitsAccuracy- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
mul
set this polynomial to the product of two polynomials.- Parameters:
kPoly1- DOCUMENT ME!kPoly2- DOCUMENT ME!
-
rootsDegree3
public int rootsDegree3(float[] afRoot) afRoot should have length 3 which is used to return the real roots found; returns 0 if no root can be found, otherwise returns the number of real roots found (1 or 3);- Parameters:
afRoot- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
scale
public void scale(float fScalar) sets this instance to the scalar product with itself.- Parameters:
fScalar- DOCUMENT ME!
-
set
set this polynomial to have the same coefficients as those in the specified polynomial.- Parameters:
kPoly- DOCUMENT ME!
-
setCoeff
public void setCoeff(int i, float fValue) DOCUMENT ME!- Parameters:
i- DOCUMENT ME!fValue- DOCUMENT ME!
-
sub
sets this instance to the difference of two polynomial instances.- Parameters:
kPoly1- DOCUMENT ME!kPoly2- DOCUMENT ME!
-