|
BSpline Finite Element Exterior Calculus
|
Sort an array of integers using the quicksort algorithm. More...
Public Member Functions | |
| sort_int | |
| sort_real | |
Sort an array of integers using the quicksort algorithm.
| [in,out] | array | The array of integers to be sorted |
| [in] | inverse | _(optional)_ If true, sort in descending order; otherwise, ascending order (default: false) |
Sort an array of real numbers using the quicksort algorithm
| [in,out] | array | The array of real numbers to be sorted |
| [in] | inverse | _(optional)_ If true, sort in descending order; otherwise, ascending order (default: false) |
| [in] | sort_fun | _(optional)_ A function to determine the sorting order |
Compute the union of two sets of integers
| [out] | union | The resulting union of the two sets |
| [in] | set1 | The first set of integers |
| [in] | set2 | The second set of integers |
Compute the prime factorization of an integer
| [in] | n | The integer to factorize |
| [out] | factors | Array containing the prime factors (with repetition) |
Split an integer into two factors that are as close as possible
Given an integer N, find n1 and n2 such that N = n1 * n2 and |n1 - n2| is minimized. The result satisfies n1 <= n2.
| [in] | n | The integer to split |
| [out] | n1 | The smaller factor |
| [out] | n2 | The larger factor |
Split an integer into three factors that are as close as possible
Given an integer N, find n1, n2, and n3 such that N = n1 * n2 * n3 and the factors are as balanced as possible. The result satisfies n1 <= n2 <= n3.
| [in] | n | The integer to split |
| [out] | n1 | The smallest factor |
| [out] | n2 | The middle factor |
| [out] | n3 | The largest factor |
Find a root of a function using Brent's method
| [in] | fun | The function for which to find a root |
| [in] | xa_in | The lower bound of the interval |
| [in] | xb_in | The upper bound of the interval |
| [in] | x_tol | The tolerance for convergence |
| [in] | max_iter | The maximum number of iterations to perform |
| [in] | fa_in | _(optional)_ The value of the function at xa_in (if not provided, it will be computed) |
| [in] | fb_in | _(optional)_ The value of the function at xb_in (if not provided, it will be computed) |
| [out] | success | _(optional)_ A logical flag indicating whether the method converged successfully |
Generic interface for sorting arrays