Medial Code Documentation
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends
xgboost::BitFieldContainer< VT, Direction, IsConst > Struct Template Reference

A non-owning type with auxiliary methods defined for manipulating bits. More...

#include <bitfield.h>

Inheritance diagram for xgboost::BitFieldContainer< VT, Direction, IsConst >:
xgboost::LBitsPolicy< VT, IsConst >

Data Structures

struct  Pos
 

Public Types

using value_type = std::conditional_t< IsConst, VT const, VT >
 
using size_type = size_t
 
using index_type = size_t
 
using pointer = value_type *
 

Public Member Functions

XGBOOST_DEVICE BitFieldContainer (common::Span< value_type > bits)
 
 BitFieldContainer (BitFieldContainer const &other)=default
 
 BitFieldContainer (BitFieldContainer &&other)=default
 
BitFieldContaineroperator= (BitFieldContainer const &that)=default
 
BitFieldContaineroperator= (BitFieldContainer &&that)=default
 
XGBOOST_DEVICE auto Bits ()
 
XGBOOST_DEVICE auto Bits () const
 
BitFieldContaineroperator|= (BitFieldContainer const &rhs)
 
BitFieldContaineroperator&= (BitFieldContainer const &rhs)
 
void Set (index_type pos) noexcept(true)
 
void Clear (index_type pos) noexcept(true)
 
XGBOOST_DEVICE bool Check (Pos pos_v) const noexcept(true)
 
XGBOOST_DEVICE bool Check (index_type pos) const noexcept(true)
 
XGBOOST_DEVICE size_type Capacity () const noexcept(true)
 Returns the total number of bits that can be viewed.
 
XGBOOST_DEVICE size_type NumValues () const noexcept(true)
 Number of storage unit used in this bit field.
 
XGBOOST_DEVICE pointer Data () const noexcept(true)
 

Static Public Member Functions

static XGBOOST_DEVICE Pos ToBitPos (index_type pos)
 
static XGBOOST_DEVICE size_t ComputeStorageSize (index_type size)
 

Static Public Attributes

static index_type constexpr kValueSize = sizeof(value_type) * 8
 
static index_type constexpr kOne = 1
 

Friends

std::ostream & operator<< (std::ostream &os, BitFieldContainer< VT, Direction, IsConst > field)
 

Detailed Description

template<typename VT, typename Direction, bool IsConst = false>
struct xgboost::BitFieldContainer< VT, Direction, IsConst >

A non-owning type with auxiliary methods defined for manipulating bits.

Template Parameters
VTUnderlying value type, must be an unsigned integer.
DirectionWhether the bits start from left or from right.
IsConstWhether the view is const.

Member Function Documentation

◆ Capacity()

template<typename VT , typename Direction , bool IsConst = false>
XGBOOST_DEVICE size_type xgboost::BitFieldContainer< VT, Direction, IsConst >::Capacity ( ) const
inlinenoexcept

Returns the total number of bits that can be viewed.

This is equal to or larger than the acutal number of valid bits.


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