|
C(++)ECCO
C++ Error Control COding: a header-only library for ECC simulations and experiments, modeling complete coding systems across arbitrary finite fields and complex inter-field relationships - Christian Senger <senger@inue.uni-stuttgart.de>
|
Utility functions and mathematical helpers. More...
#include <algorithm>#include <atomic>#include <cmath>#include <cstdint>#include <functional>#include <limits>#include <mutex>#include <new>#include <optional>#include <random>#include <stdexcept>#include <string>#include <thread>#include <tuple>#include <type_traits>#include <utility>#include <vector>#include "InfInt.hpp"

Go to the source code of this file.
Classes | |
| class | CECCO::RNG |
| Thread-local random number generator with shared seeding policy. More... | |
| struct | CECCO::details::CacheEntry< ID, T > |
| Cache entry specification. More... | |
| class | CECCO::details::Cache< ENTRIES > |
| Heterogeneous cache indexed by entry ID. More... | |
| class | CECCO::details::OnceCache< T > |
| Thread-safe single-value cache. More... | |
Namespaces | |
| namespace | CECCO |
| Provides a framework for error correcting codes. | |
| namespace | CECCO::details |
| Contains implementation details not to be exposed to the user. Functions and classes here may change without notice. | |
Functions | |
| std::mt19937 & | CECCO::gen () |
| Current thread's random number generator. | |
| template<class T> | |
| std::vector< size_t > | CECCO::find_maxima (const std::vector< T > &v) |
| Indices of all maximum elements. | |
| template<class T> | |
| constexpr bool | CECCO::is_prime (T a) noexcept |
| Primality test by trial division. | |
| template<class T> | |
| constexpr T | CECCO::GCD (T a, T b, T *s=nullptr, T *t=nullptr) noexcept |
| Greatest common divisor and optional Bézout coefficients. | |
| template<uint16_t p, class T> | |
| constexpr T | CECCO::modinv (T a) noexcept |
| Multiplicative inverse modulo a prime. | |
| template<class T> | |
| T | CECCO::fac (T a) noexcept |
| Factorial a! | |
| template<class T> | |
| T | CECCO::bin (const T &n, T k) noexcept |
| Binomial coefficient C(n,k). | |
| template<> | |
| InfInt | CECCO::bin (const InfInt &n, InfInt k) noexcept |
| Binomial coefficient specialization for InfInt. | |
| template<class T> | |
| constexpr T | CECCO::sqm (T b, int e) |
| Exponentiation by square-and-multiply. | |
| template<class T> | |
| constexpr T | CECCO::daa (T b, int m) |
| Scalar multiplication by double-and-add. | |
| constexpr double | CECCO::details::floor_constexpr (double x) |
| Constexpr floor function. | |
| std::string | CECCO::details::basename (const char *path) |
Variables | |
| static const uint8_t | CECCO::details::colormap [64][3] |
Utility functions and mathematical helpers.
Licensed for noncommercial use only, including academic teaching, research, and personal non-profit purposes. Commercial use is prohibited without a separate commercial license. See the LICENSE file in the repository root for full terms and how to request a commercial license.
This header collects small utilities used by the algebraic types: random number generation, integer arithmetic, square-and-multiply exponentiation, double-and-add multiplication, caching, maxima, constexpr floor, and divisibility tests.
Definition in file helpers.hpp.