Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
dmlc::data::RowBlockContainer< IndexType, DType > Struct Template Reference

dynamic data structure that holds a row block of data More...

#include <row_block.h>

Public Member Functions

RowBlock< IndexType, DType > GetBlock (void) const
 convert to a row block
 
void Save (Stream *fo) const
 write the row block to a binary stream
 
bool Load (Stream *fi)
 load row block from a binary stream
 
void Clear (void)
 clear the container
 
size_t Size (void) const
 size of the data
 
size_t MemCostBytes (void) const
 
template<typename I >
void Push (Row< I, DType > row)
 push the row into container
 
template<typename I >
void Push (RowBlock< I, DType > batch)
 push the row block into container
 

Data Fields

std::vector< size_t > offset
 array[size+1], row pointer to beginning of each rows
 
std::vector< DType > label
 array[size] label of each instance
 
std::vector< real_tweight
 array[size] weight of each instance
 
std::vector< uint64_t > qid
 array[size] session-id of each instance
 
std::vector< IndexType > field
 field index
 
std::vector< IndexType > index
 feature index
 
std::vector< DType > value
 feature value
 
IndexType max_field
 maximum value of field
 
IndexType max_index
 maximum value of index
 

Detailed Description

template<typename IndexType, typename DType = real_t>
struct dmlc::data::RowBlockContainer< IndexType, DType >

dynamic data structure that holds a row block of data

Template Parameters
IndexTypethe type of index we are using

Member Function Documentation

◆ Load()

template<typename IndexType , typename DType >
bool dmlc::data::RowBlockContainer< IndexType, DType >::Load ( Stream fi)
inline

load row block from a binary stream

Parameters
fioutput stream
Returns
false if at end of file

◆ MemCostBytes()

template<typename IndexType , typename DType = real_t>
size_t dmlc::data::RowBlockContainer< IndexType, DType >::MemCostBytes ( void  ) const
inline
Returns
estimation of memory cost of this container

◆ Push() [1/2]

template<typename IndexType , typename DType = real_t>
template<typename I >
void dmlc::data::RowBlockContainer< IndexType, DType >::Push ( Row< I, DType >  row)
inline

push the row into container

Parameters
rowthe row to push back
Template Parameters
Ithe index type of the row

◆ Push() [2/2]

template<typename IndexType , typename DType = real_t>
template<typename I >
void dmlc::data::RowBlockContainer< IndexType, DType >::Push ( RowBlock< I, DType >  batch)
inline

push the row block into container

Parameters
rowthe row to push back
Template Parameters
Ithe index type of the row

◆ Save()

template<typename IndexType , typename DType >
void dmlc::data::RowBlockContainer< IndexType, DType >::Save ( Stream fo) const
inline

write the row block to a binary stream

Parameters
fooutput stream

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