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>

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

Inst operator[] (size_t i) const
 get i-th row from the batch More...
 
 SparsePage ()
 constructor More...
 
size_t Size () const
 
size_t MemCostBytes () const
 
void Clear ()
 clear the page More...
 
SparsePage GetTranspose (int num_columns) const
 
void SortRows ()
 
void Push (const dmlc::RowBlock< uint32_t > &batch)
 Push row block into the 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...
 
void Push (const Inst &inst)
 Push one instance into page. More...
 
size_t Size ()
 

Public Attributes

HostDeviceVector< size_t > offset
 
HostDeviceVector< Entrydata
 the data of the segments More...
 
size_t base_rowid
 

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()

xgboost::SparsePage::SparsePage ( )
inline

constructor

Member Function Documentation

◆ Clear()

void xgboost::SparsePage::Clear ( )
inline

clear the page

◆ GetTranspose()

SparsePage xgboost::SparsePage::GetTranspose ( int  num_columns) const
inline

◆ MemCostBytes()

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

◆ operator[]()

Inst xgboost::SparsePage::operator[] ( size_t  i) const
inline

get i-th row from the batch

◆ Push() [1/3]

void xgboost::SparsePage::Push ( const dmlc::RowBlock< uint32_t > &  batch)

Push row block into the page.

Parameters
batchthe row batch.

◆ Push() [2/3]

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

Push a sparse page.

Parameters
batchthe row page

◆ Push() [3/3]

void xgboost::SparsePage::Push ( const Inst inst)
inline

Push one instance into page.

Parameters
instan instance row

◆ PushCSC()

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

Push a SparsePage stored in CSC format.

Parameters
batchThe row batch to be pushed

◆ Size() [1/2]

size_t xgboost::SparsePage::Size ( ) const
inline
Returns
number of instance in the page

◆ Size() [2/2]

size_t xgboost::SparsePage::Size ( )
inline

◆ SortRows()

void xgboost::SparsePage::SortRows ( )
inline

Member Data Documentation

◆ base_rowid

size_t xgboost::SparsePage::base_rowid

◆ data

HostDeviceVector<Entry> xgboost::SparsePage::data

the data of the segments

◆ offset

HostDeviceVector<size_t> xgboost::SparsePage::offset

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