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>
Loading...
Searching...
No Matches
CECCO::SierpinskiTriangle Class Reference

Sierpinski triangle (Pascal's triangle modulo p). More...

#include <helpers.hpp>

Public Member Functions

 SierpinskiTriangle (size_t n_max, size_t k_max, size_t p)
 Precompute C(n,k) mod p for all n <= n_max and k <= k_max.
size_t operator() (size_t n, size_t k) const
 C(n,k) mod p, zero whenever k > n (even beyond the precomputed range)

Detailed Description

Sierpinski triangle (Pascal's triangle modulo p).

Provides binomial coefficients C(n,k) mod p without overflow or multi-precision arithmetic.

Definition at line 330 of file helpers.hpp.

Constructor & Destructor Documentation

◆ SierpinskiTriangle()

CECCO::SierpinskiTriangle::SierpinskiTriangle ( size_t n_max,
size_t k_max,
size_t p )
inline

Precompute C(n,k) mod p for all n <= n_max and k <= k_max.

Exceptions
std::invalid_argumentif p is zero

Definition at line 336 of file helpers.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ operator()()

size_t CECCO::SierpinskiTriangle::operator() ( size_t n,
size_t k ) const
inline

C(n,k) mod p, zero whenever k > n (even beyond the precomputed range)

Exceptions
std::invalid_argumentif k <= n and n > n_max or k > k_max

Definition at line 349 of file helpers.hpp.


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