SDSL 3.0.3
Succinct Data Structure Library
Loading...
Searching...
No Matches
sdsl::binomial_coefficients_trait< log_n > Struct Template Reference

Trait struct for the binomial coefficient struct to handle different type of integers. More...

#include <rrr_helper.hpp>

Public Types

typedef uint64_t number_type
 

Static Public Member Functions

static uint16_t hi (number_type x)
 
template<class bit_vector_type >
static number_type get_int (bit_vector_type const &bv, typename bit_vector_type::size_type pos, uint16_t len)
 Read a $len$-bit integer of type number_type from a bitvector.
 
template<class bit_vector_type >
static void set_int (bit_vector_type &bv, typename bit_vector_type::size_type pos, number_type x, uint16_t len)
 Write a $len$-bit integer x of type number_type to a bitvector.
 
static uint16_t popcount (number_type x)
 Count the number of set bits in x.
 

Detailed Description

template<uint16_t log_n>
struct sdsl::binomial_coefficients_trait< log_n >

Trait struct for the binomial coefficient struct to handle different type of integers.

This generic implementation works for 64-bit integers.

Definition at line 31 of file rrr_helper.hpp.

Member Typedef Documentation

◆ number_type

template<uint16_t log_n>
typedef uint64_t sdsl::binomial_coefficients_trait< log_n >::number_type

Definition at line 33 of file rrr_helper.hpp.

Member Function Documentation

◆ get_int()

template<uint16_t log_n>
template<class bit_vector_type >
static number_type sdsl::binomial_coefficients_trait< log_n >::get_int ( bit_vector_type const & bv,
typename bit_vector_type::size_type pos,
uint16_t len )
inlinestatic

Read a $len$-bit integer of type number_type from a bitvector.

Parameters
bvA bit_vector of int_vector from which we extract the integer.
posPosition of the least significant bit of the integer which should be read.
lenbit-width of the integer which should be read.
Returns
The len-bit integer.

Definition at line 47 of file rrr_helper.hpp.

◆ hi()

template<uint16_t log_n>
static uint16_t sdsl::binomial_coefficients_trait< log_n >::hi ( number_type x)
inlinestatic

Definition at line 34 of file rrr_helper.hpp.

◆ popcount()

template<uint16_t log_n>
static uint16_t sdsl::binomial_coefficients_trait< log_n >::popcount ( number_type x)
inlinestatic

Count the number of set bits in x.

Parameters
xThe integer x.

Definition at line 69 of file rrr_helper.hpp.

◆ set_int()

template<uint16_t log_n>
template<class bit_vector_type >
static void sdsl::binomial_coefficients_trait< log_n >::set_int ( bit_vector_type & bv,
typename bit_vector_type::size_type pos,
number_type x,
uint16_t len )
inlinestatic

Write a $len$-bit integer x of type number_type to a bitvector.

Parameters
bvA bit_vecor or int_vector in which we write the integer.
posPosition of the least significant bit of the integer which should be written.
xThe integer x which should be written.
lenBit-width of x.

Definition at line 60 of file rrr_helper.hpp.


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