UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Math::TPolynomialRootSolver< RealType, PolynomialDegree > Struct Template Reference

#include <PolynomialRootSolver.h>

Public Member Functions

 TPolynomialRootSolver ()=default
 
 TPolynomialRootSolver (TArrayView< const RealType > PolyCoeffs, RealType RangeStart, RealType RangeEnd, RealType Tolerance=(RealType) UE_SMALL_NUMBER, int32 MaxNewtonIterations=20, RealType NearRootTolerance=(RealType) UE_SMALL_NUMBER)
 
int32 FindRootsInRange (TArrayView< const RealType > PolyCoeffs, RealType RangeStart, RealType RangeEnd, RealType Tolerance=(RealType) UE_SMALL_NUMBER, int32 MaxNewtonIterations=20, RealType NearRootTolerance=(RealType) UE_SMALL_NUMBER)
 

Public Attributes

TArray< RealType, TInlineAllocator< PolynomialDegree > > Roots
 

Detailed Description

template<typename RealType, int32 PolynomialDegree>
struct UE::Math::TPolynomialRootSolver< RealType, PolynomialDegree >

Find roots of a polynomial of a specified degree

Constructor & Destructor Documentation

◆ TPolynomialRootSolver() [1/2]

template<typename RealType , int32 PolynomialDegree>
UE::Math::TPolynomialRootSolver< RealType, PolynomialDegree >::TPolynomialRootSolver ( )
default

◆ TPolynomialRootSolver() [2/2]

template<typename RealType , int32 PolynomialDegree>
UE::Math::TPolynomialRootSolver< RealType, PolynomialDegree >::TPolynomialRootSolver ( TArrayView< const RealType >  PolyCoeffs,
RealType  RangeStart,
RealType  RangeEnd,
RealType  Tolerance = (RealType)UE_SMALL_NUMBER,
int32  MaxNewtonIterations = 20,
RealType  NearRootTolerance = (RealType)UE_SMALL_NUMBER 
)
inline

Find roots within the specified open interval (RangeStart, RangeEnd) (i.e. roots at either extreme are not returned)

Parameters
PolyCoeffsThe coefficients of the polynomial such that PolyCoeffs[i] is the coefficient of the x^i term. Must have at least PolynomialDegree + 1 elements.
RangeStartStart of the open range to search for roots
RangeEndEnd of the open range to search for roots
ToleranceAbsolute tolerance for the returned root
MaxNewtonIterationsMaximum number of newton/bisection iterations to perform internally when finding a root
NearRootToleranceTolerance for finding almost-roots, i.e. cases where the polynomial just grazes 0 without crossing

Member Function Documentation

◆ FindRootsInRange()

template<typename RealType , int32 PolynomialDegree>
int32 UE::Math::TPolynomialRootSolver< RealType, PolynomialDegree >::FindRootsInRange ( TArrayView< const RealType >  PolyCoeffs,
RealType  RangeStart,
RealType  RangeEnd,
RealType  Tolerance = (RealType)UE_SMALL_NUMBER,
int32  MaxNewtonIterations = 20,
RealType  NearRootTolerance = (RealType)UE_SMALL_NUMBER 
)
inline

Find roots within the specified open interval (RangeStart, RangeEnd) (i.e. roots at either extreme are not returned)

Parameters
PolyCoeffsThe coefficients of the polynomial such that PolyCoeffs[i] is the coefficient of the x^i term. Must have at least PolynomialDegree + 1 elements.
RangeStartStart of the open range to search for roots
RangeEndEnd of the open range to search for roots
ToleranceAbsolute tolerance for the returned roots
MaxNewtonIterationsMaximum number of newton/bisection iterations to perform internally when finding a root
NearRootToleranceTolerance for finding almost-roots, i.e. cases where the polynomial just grazes 0 without crossing
Returns
Number of roots found

Member Data Documentation

◆ Roots

template<typename RealType , int32 PolynomialDegree>
TArray<RealType, TInlineAllocator<PolynomialDegree> > UE::Math::TPolynomialRootSolver< RealType, PolynomialDegree >::Roots

The documentation for this struct was generated from the following file: