|
PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
|
Root-finders for polynomial of arbitrary degree. More...
#include "pbat/warning/Push.h"#include "pbat/warning/OldStyleCast.h"#include "pbat/warning/SignConversion.h"#include <cassert>#include <cmath>#include <cstdint>#include <cstdlib>#include <cstring>#include <limits>#include <type_traits>#include <immintrin.h>#include "pbat/warning/Pop.h"#include "pbat/Aliases.h"#include <array>#include <utility>Go to the source code of this file.
Namespaces | |
| namespace | pbat |
| The main namespace of the library. | |
| namespace | pbat::math |
| Math related functionality. | |
| namespace | pbat::math::polynomial |
| The namespace for the Polynomial module. | |
Macros | |
| #define | _CY_CORE_H_INCLUDED_ |
| #define | _CY_CORE_MEMCPY_LIMIT 256 |
| #define | _CY_COMPILER_UNKNOWN |
| #define | _CY_COMPILER_VER_MEETS(msc, gcc, clang, intel) |
| #define | _CY_COMPILER_VER_BELOW(msc, gcc, clang, intel) |
| #define | constexpr |
| #define | _CY_TEMPLATE_ALIAS_UNPACK(...) |
| #define | _CY_TEMPLATE_ALIAS(template_name, template_equivalent) |
| #define | restrict |
| #define | CY_NODISCARD |
| #define | CY_CLASS_FUNCTION_DEFAULT |
| #define | CY_CLASS_FUNCTION_DELETE |
| #define | nodefault default: |
| #define | _CY_IVDEP |
| #define | _CY_IVDEP_FOR _CY_IVDEP for |
| #define | _CY_CRT_SECURE_NO_WARNINGS |
| #define | _CY_CRT_SECURE_RESUME_WARNINGS |
| #define | _CY_POLYNOMIAL_H_INCLUDED_ |
| #define | _CY_POLY_TEMPLATE_B |
| #define | _CY_POLY_TEMPLATE_BC template <bool boundError = false, typename RootCallback> |
Polynomial Root Finding Functions | |
These functions find polynomial roots. They can be limited to a finite bounds between The given If | |
| #define | _CY_POLY_TEMPLATE_N |
| #define | _CY_POLY_TEMPLATE_R |
| #define | _CY_POLY_TEMPLATE_A |
| #define | _CY_POLY_TEMPLATE_D |
| #define | _CY_POLY_TEMPLATE_NC |
| #define | _CY_POLY_TEMPLATE_RC |
| #define | _CY_POLY_TEMPLATE_AC |
Typedefs | |
| template<class T, auto N> | |
| using | pbat::math::polynomial::detail::CArray = T[N] |
| C-style array alias. | |
Functions | |
| template<auto N, class TScalar = Scalar> | |
| bool | pbat::math::polynomial::HasRoot (std::array< TScalar, N+1 > const &coeffs, TScalar min=std::numeric_limits< TScalar >::lowest(), TScalar max=std::numeric_limits< TScalar >::max()) |
| Check if a polynomial has a root in the range [min,max]. | |
| template<auto N, class TScalar = Scalar> | |
| std::array< TScalar, N > | pbat::math::polynomial::Roots (std::array< TScalar, N+1 > const &coeffs, TScalar min=std::numeric_limits< TScalar >::lowest(), TScalar max=std::numeric_limits< TScalar >::max()) |
| Computes all real roots of a degree N polynomial in the range [min,max]. | |
| template<auto N, class FOnRoot, class TScalar = Scalar> | |
| bool | pbat::math::polynomial::ForEachRoot (FOnRoot &&fOnRoot, std::array< TScalar, N+1 > const &coeffs, TScalar min=std::numeric_limits< TScalar >::lowest(), TScalar max=std::numeric_limits< TScalar >::max()) |
| Computes the each real root of a degree N polynomial in the range [min,max] in increasing order. | |
Root-finders for polynomial of arbitrary degree.
We lightly wrap Cem Yuksel's cyCodeBase polynomial root-finding functions to work in our codebase.
See [16]
| #define _CY_COMPILER_VER_BELOW | ( | msc, | |
| gcc, | |||
| clang, | |||
| intel ) |
| #define _CY_COMPILER_VER_MEETS | ( | msc, | |
| gcc, | |||
| clang, | |||
| intel ) |
| #define _CY_POLY_TEMPLATE_A |
| #define _CY_POLY_TEMPLATE_AC |
| #define _CY_POLY_TEMPLATE_B |
| #define _CY_POLY_TEMPLATE_D |
| #define _CY_POLY_TEMPLATE_N |
| #define _CY_POLY_TEMPLATE_NC |
| #define _CY_POLY_TEMPLATE_R |
| #define _CY_POLY_TEMPLATE_RC |
| #define _CY_TEMPLATE_ALIAS | ( | template_name, | |
| template_equivalent ) |
| #define _CY_TEMPLATE_ALIAS_UNPACK | ( | ... | ) |
| #define CY_CLASS_FUNCTION_DEFAULT |
| #define CY_CLASS_FUNCTION_DELETE |