![]() |
Vulpes
0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
|
Classes | |
| struct | is_gnump |
| Type trait to check if a type is one of the GNU Multiple Precision (GMP) classes (mpf_class, mpq_class, or mpz_class). More... | |
| struct | is_pseudoaritmetic |
| Type trait to check if a type is either a GMP class or a built-in arithmetic type. More... | |
| struct | is_pseudofloating |
| Type trait to check if a type is either the GMP floating-point class (mpf_class) or a built-in floating-point type. More... | |
Functions | |
| template<typename U, typename V, typename = std::enable_if_t<std::is_unsigned_v<V> && std::is_integral_v<V>>> | |
| constexpr U | upow (U base, V exp, U result=U(1)) |
| Computes the unsigned power of a number. | |
| template<typename U, typename V, typename = std::enable_if_t<std::is_signed_v<V> && std::is_integral_v<V>>> | |
| constexpr U | ipow (U base, V exp, U result=U(1)) |
| Computes the signed power of a number. | |
| template<typename U, typename V, typename = std::enable_if_t<std::is_integral_v<V>>> | |
| constexpr U | pow (U base, V exp, U result=U(1)) |
| Computes the power of a number. | |
| template<typename T, typename = std::enable_if_t<is_pseudoaritmetic<T>::value>> | |
| T | abs (const T &value) |
| Computes the absolute value of a number. | |
| template<typename T, typename = std::enable_if_t<is_pseudoaritmetic<T>::value>> | |
| T | sqrt (const T &value) |
| template<typename T, typename = std::enable_if_t<is_pseudofloating<T>::value>> | |
| constexpr T | pi () |
| Returns the value of pi. | |
| template<typename T, typename = std::enable_if_t<is_pseudofloating<T>::value>> | |
| constexpr T | epsilon (const T &instance=T(0)) |
| Returns the machine epsilon for floating-point types or a rough approximation for GMP types. | |
| template<typename T, typename = std::enable_if_t<is_pseudofloating<T>::value>> | |
| std::size_t | precision (const T &instance) |
| Returns the precision of the input value in bits. | |
| template<typename V, typename U, typename = std::enable_if_t< is_pseudoaritmetic<U>::value && is_pseudoaritmetic<V>::value>> | |
| V | to (const U &src) |
| Converts a value of one pseudo-arithmetic type to another. | |
| template<typename T, typename = std::enable_if_t<is_pseudoaritmetic<T>::value>> | |
| constexpr T | factorial (T n) |
| Computes the factorial of a pseudo-arithmetic number iteratively. | |
| template<typename T, typename = std::enable_if_t<is_pseudoaritmetic<T>::value>> | |
| T | gamma (const T &value) |
| template<typename T, typename = std::enable_if_t<std::is_integral_v<T>>> | |
| constexpr int64_t | pow1 (T exp) |
| Computes (-1)^exp. | |
| template<typename T, typename = std::enable_if_t<std::is_integral_v<T>>> | |
| constexpr T | binomial (T n, T k) |
| template<typename T, int Options> | |
| T | sarrus_det (const Eigen::Matrix< T, 3, 3, Options > &mat) |
| Computes the determinant of a 3x3 matrix using Sarrus' rule. | |
| template<typename T, int Dim, int Options> | |
| T | determinant (const Eigen::Matrix< T, Dim, Dim, Options > &mat) |
| Computes the determinant of a 2x2 or 3x3 matrix. | |
| template<typename T, int Dim, int Options> | |
| T | area (const Eigen::Matrix< T, Dim, Dim - 1, Options > &mat) |
| template<typename FloatType, typename IndexType> | |
| void | newellNormal (const FloatType *vertices_data, const IndexType *face_indices_data, IndexType num_face_vertices, FloatType *out_normal) |
| Accumulates the unnormalized normal of a polygon using Newell's method. | |
|
inline |
Computes the absolute value of a number.
| T | The type of the input value. |
| Dummy | A dummy template parameter used for SFINAE. |
| value | The input value whose absolute value is to be computed. |
This function computes the absolute value of value. If T is a built-in arithmetic type, it uses std::abs. If T is a GMP class, it uses the GMP library's abs function.
|
inline |
|
inlineconstexpr |
|
inline |
Computes the determinant of a 2x2 or 3x3 matrix.
| T | The scalar type of the matrix elements (e.g., float, double). |
| Dim | Dimension of the matrix: 2 or 3. |
| Options | The storage options for the Eigen matrix (e.g., RowMajor or ColMajor). |
| mat | An Eigen matrix whose determinant is to be calculated. |
|
constexpr |
Returns the machine epsilon for floating-point types or a rough approximation for GMP types.
| T | The type of the input value (must be a floating-point or GMP floating-point type). |
| Dummy | A dummy template parameter used for SFINAE. |
| instance | An optional instance of T used to determine precision (default is 0). |
This function returns the machine epsilon for floating-point types, which is the difference between 1 and the smallest value greater than 1 that is representable by the floating-point type. For GMP types, it returns a rough approximation of the precision.
|
inlineconstexpr |
Computes the factorial of a pseudo-arithmetic number iteratively.
| T | The type of the input value. |
| Dummy | A dummy template parameter used for SFINAE. |
| n | The input value . |
|
inline |
|
inlineconstexpr |
Computes the signed power of a number.
| U | The type of the base and result. |
| V | The type of the exponent (must be a signed integral type). |
| Dummy | A dummy template parameter used for SFINAE. |
| base | The base value to be raised to the power. |
| exp | The exponent value. |
| result | Value from which start accumulate the result |
This function computes base^exp using exponentiation by squaring, and handles negative exponents by inverting the base. The type U must support multiplication, division, and assignment operations. The type V must be a signed integral type.
|
inline |
Accumulates the unnormalized normal of a polygon using Newell's method.
This function calculates the geometric normal of an ordered, nearly-planar polygon and adds it to the provided output buffer out_normal. It is robust for non-convex polygons and operates on raw pointer data for high performance.
| FloatType | The floating-point type for coordinates (e.g., float, double). |
| IndexType | The integer type for vertex indices (e.g., int, uint32_t, size_t). |
| [in] | vertices_data | Pointer to a contiguous array of vertex coordinates, laid out as [x0, y0, z0, x1, y1, z1, ...]. |
| [in] | face_indices_data | Pointer to an array of vertex indices that define the polygon in counter-clockwise order. |
| [in] | num_face_vertices | The number of vertices in the polygon face. |
| [in,out] | out_normal | Pointer to a buffer of 3 FloatTypes. The calculated normal components are added to the existing values in this buffer. |
|
constexpr |
Returns the value of pi.
| T | The type of the return value (must be a floating-point or GMP floating-point type). |
| Dummy | A dummy template parameter used for SFINAE. |
This function returns the value of pi. If T is a built-in floating-point type, it uses the value from <numbers> (if available) or M_PI. If T is mpf_class, it returns a 1024-digit approximation of pi.
|
inlineconstexpr |
Computes the power of a number.
| U | The type of the base and result. |
| V | The type of the exponent (must be a signed integral type). |
| Dummy | A dummy template parameter used for SFINAE. |
| base | The base value to be raised to the power. |
| exp | The exponent value. |
| result | Value from which start accumulate the result |
This function computes base^exp using exponentiation by squaring, and handles negative exponents by inverting the base. The type U must support multiplication, division, and assignment operations. The type V must be a signed integral type.
|
inlineconstexpr |
Computes (-1)^exp.
| T | The type of the input value. |
| Dummy | A dummy template parameter used for SFINAE. |
| exp | The input value . |
Computes efficiently (-1)^exp in a branchless way by explointing the relation (-1)^exp == (1 - 2 * (exp % 2))
|
inline |
Returns the precision of the input value in bits.
| T | The type of the input value (must be a floating-point or GMP floating-point type). |
| Dummy | A dummy template parameter used for SFINAE. |
| instance | The input value whose precision is to be determined. |
This function returns the precision of the input value. For floating-point types, it returns the size of the type in bits. For GMP types, it returns the precision as set in the GMP instance.
|
inline |
Computes the determinant of a 3x3 matrix using Sarrus' rule.
| T | The scalar type of the matrix elements (e.g., float, double). |
| Options | The storage options for the Eigen matrix (e.g., RowMajor or ColMajor). |
| mat | A 3x3 Eigen matrix whose determinant is to be calculated. |
|
inline |
|
inline |
Converts a value of one pseudo-arithmetic type to another.
| U | The type of the input value. |
| V | The type to which the value is to be converted. |
| Dummy | A dummy template parameter used for SFINAE. |
| src | The input value to be converted. |
This function converts a value of type U to type V. If both U and V are the same type, it returns the input value directly. If both are arithmetic types, it uses static_cast<V>(src). For conversions involving GMP types, it uses the appropriate GMP constructors or methods.
|
inlineconstexpr |
Computes the unsigned power of a number.
| U | The type of the base and result. |
| V | The type of the exponent (must be an unsigned integral type). |
| Dummy | A dummy template parameter used for SFINAE. |
| base | The base value to be raised to the power. |
| exp | The exponent value. |
| result | The initial value of the result (default is 1). |
This function computes base^exp using exponentiation by squaring, which is efficient for large exponents. The type U must support multiplication and assignment operations. The type V must be an unsigned integral type.