xgboost
Public Types | Public Member Functions | Public Attributes | List of all members
xgboost::SparsePage Class Reference

In-memory storage unit of sparse batch, stored in CSR format. More...

#include <data.h>

Inheritance diagram for xgboost::SparsePage:
Inheritance graph
Collaboration diagram for xgboost::SparsePage:
Collaboration graph

Public Types

using Inst = common::Span< Entry const >
 an instance of sparse vector in the batch More...
 

Public Member Functions

HostSparsePageView GetView () const
 
 SparsePage ()
 constructor More...
 
 SparsePage (SparsePage const &that)=delete
 
 SparsePage (SparsePage &&that)=default
 
SparsePageoperator= (SparsePage const &that)=delete
 
SparsePageoperator= (SparsePage &&that)=default
 
virtual ~SparsePage ()=default
 
size_t Size () const
 
size_t MemCostBytes () const
 
void Clear ()
 clear the page More...
 
void SetBaseRowId (size_t row_id)
 Set the base row id for this page. More...
 
SparsePage GetTranspose (int num_columns, int32_t n_threads) const
 
void SortIndices (int32_t n_threads)
 Sort the column index. More...
 
bool IsIndicesSorted (int32_t n_threads) const
 Check wether the column index is sorted. More...
 
void SortRows (int32_t n_threads)
 
template<typename AdapterBatchT >
uint64_t Push (const AdapterBatchT &batch, float missing, int nthread)
 Pushes external data batch onto this page. More...
 
void Push (const SparsePage &batch)
 Push a sparse page. More...
 
void PushCSC (const SparsePage &batch)
 Push a SparsePage stored in CSC format. More...
 

Public Attributes

HostDeviceVector< bst_row_toffset
 
HostDeviceVector< Entrydata
 the data of the segments More...
 
size_t base_rowid {0}
 

Detailed Description

In-memory storage unit of sparse batch, stored in CSR format.

Member Typedef Documentation

◆ Inst

an instance of sparse vector in the batch

Constructor & Destructor Documentation

◆ SparsePage() [1/3]

xgboost::SparsePage::SparsePage ( )
inline

constructor

◆ SparsePage() [2/3]

xgboost::SparsePage::SparsePage ( SparsePage const &  that)
delete

◆ SparsePage() [3/3]

xgboost::SparsePage::SparsePage ( SparsePage &&  that)
default

◆ ~SparsePage()

virtual xgboost::SparsePage::~SparsePage ( )
virtualdefault

Member Function Documentation

◆ Clear()

void xgboost::SparsePage::Clear ( )
inline

clear the page

◆ GetTranspose()

SparsePage xgboost::SparsePage::GetTranspose ( int  num_columns,
int32_t  n_threads 
) const

◆ GetView()

HostSparsePageView xgboost::SparsePage::GetView ( ) const
inline

◆ IsIndicesSorted()

bool xgboost::SparsePage::IsIndicesSorted ( int32_t  n_threads) const

Check wether the column index is sorted.

◆ MemCostBytes()

size_t xgboost::SparsePage::MemCostBytes ( ) const
inline
Returns
estimation of memory cost of this page

◆ operator=() [1/2]

SparsePage& xgboost::SparsePage::operator= ( SparsePage &&  that)
default

◆ operator=() [2/2]

SparsePage& xgboost::SparsePage::operator= ( SparsePage const &  that)
delete

◆ Push() [1/2]

template<typename AdapterBatchT >
uint64_t xgboost::SparsePage::Push ( const AdapterBatchT &  batch,
float  missing,
int  nthread 
)

Pushes external data batch onto this page.

Template Parameters
AdapterBatchT
Parameters
batch
missing
nthread
Returns
The maximum number of columns encountered in this input batch. Useful when pushing many adapter batches to work out the total number of columns.

◆ Push() [2/2]

void xgboost::SparsePage::Push ( const SparsePage batch)

Push a sparse page.

Parameters
batchthe row page

◆ PushCSC()

void xgboost::SparsePage::PushCSC ( const SparsePage batch)

Push a SparsePage stored in CSC format.

Parameters
batchThe row batch to be pushed

◆ SetBaseRowId()

void xgboost::SparsePage::SetBaseRowId ( size_t  row_id)
inline

Set the base row id for this page.

◆ Size()

size_t xgboost::SparsePage::Size ( ) const
inline
Returns
Number of instances in the page.

◆ SortIndices()

void xgboost::SparsePage::SortIndices ( int32_t  n_threads)

Sort the column index.

◆ SortRows()

void xgboost::SparsePage::SortRows ( int32_t  n_threads)

Member Data Documentation

◆ base_rowid

size_t xgboost::SparsePage::base_rowid {0}

◆ data

HostDeviceVector<Entry> xgboost::SparsePage::data

the data of the segments

◆ offset

HostDeviceVector<bst_row_t> xgboost::SparsePage::offset

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