Skip to main content

Crate p3_util

Crate p3_util 

Source
Expand description

Various simple utilities.

Modules§

array_serialization
linear_map
transpose
Matrix transpose operations.
zip_eq

Structs§

DisjointMutPtr
A raw mutable pointer wrapper that implements Send and Sync.

Functions§

apply_to_chunks
Split an iterator into small arrays and apply func to each.
as_base_slice
Reinterpret a slice of BaseArray elements as a slice of Base elements
as_base_slice_mut
Reinterpret a mutable slice of BaseArray elements as a slice of Base elements
assert_clone
Statically asserts that T implements Clone.
assert_send
Statically asserts that T implements Send.
assert_sync
Statically asserts that T implements Sync.
assume
Allow the compiler to assume that the given predicate p is always true.
branch_hint
Try to force Rust to emit a branch. Example:
checked_log_size_sum
Adds two log-sizes and computes the resulting power of two.
checked_pow2
Returns 2^log_degree if it can be represented by usize.
flatten_to_base
Convert a vector of BaseArray elements to a vector of Base elements without any reallocations.
gcd_inner
Inner loop of the deferred GCD algorithm.
gcd_inversion_prime_field_32
Inverts elements inside the prime field F_P with P < 2^FIELD_BITS.
indices_arr
Returns [0, ..., N - 1].
iter_array_chunks_padded
Returns an iterator over N elements of the iterator at a time.
log2_ceil_u64
log2_ceil_usize
Computes ceil(log_2(n)).
log2_floor_usize
Computes floor(log_2(n)).
log2_strict_usize
Computes log_2(n)
log3_strict_usize
Computes the strict base-3 logarithm of n.
pretty_name
Return a String containing the name of T but with all the crate and module prefixes removed.
reconstitute_from_base
Convert a vector of Base elements to a vector of BaseArray elements ideally without any reallocations.
relatively_prime_u64
reverse_bits
reverse_bits_len
reverse_slice_index_bits
Permutes arr such that each index is mapped to its reverse in binary.