xgboost
Public Member Functions | Static Public Member Functions | List of all members
xgboost::common::CompressedBufferWriter Class Reference

Writes bit compressed symbols to a memory buffer. Use CompressedIterator to read symbols back from buffer. Currently limited to a maximum symbol size of 28 bits. More...

#include <compressed_iterator.h>

Collaboration diagram for xgboost::common::CompressedBufferWriter:
Collaboration graph

Public Member Functions

 CompressedBufferWriter (size_t num_symbols)
 
template<typename T >
void WriteSymbol (CompressedByteT *buffer, T symbol, size_t offset)
 
template<typename IterT >
void Write (CompressedByteT *buffer, IterT input_begin, IterT input_end)
 

Static Public Member Functions

static size_t CalculateBufferSize (size_t num_elements, size_t num_symbols)
 Calculates number of bytes requiredm for a given number of elements and a symbol range. More...
 

Detailed Description

Writes bit compressed symbols to a memory buffer. Use CompressedIterator to read symbols back from buffer. Currently limited to a maximum symbol size of 28 bits.

Author
Rory
Date
7/9/2017

Constructor & Destructor Documentation

◆ CompressedBufferWriter()

xgboost::common::CompressedBufferWriter::CompressedBufferWriter ( size_t  num_symbols)
inlineexplicit

Member Function Documentation

◆ CalculateBufferSize()

static size_t xgboost::common::CompressedBufferWriter::CalculateBufferSize ( size_t  num_elements,
size_t  num_symbols 
)
inlinestatic

Calculates number of bytes requiredm for a given number of elements and a symbol range.

Author
Rory
Date
7/9/2017
Parameters
num_elementsNumber of elements.
num_symbolsMax number of symbols (alphabet size)
Returns
The calculated buffer size.

◆ Write()

template<typename IterT >
void xgboost::common::CompressedBufferWriter::Write ( CompressedByteT buffer,
IterT  input_begin,
IterT  input_end 
)
inline

◆ WriteSymbol()

template<typename T >
void xgboost::common::CompressedBufferWriter::WriteSymbol ( CompressedByteT buffer,
symbol,
size_t  offset 
)
inline

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