xgboost
Public Member Functions | List of all members
xgboost::MatrixView< T > Class Template Reference

A view over a matrix on contiguous storage. More...

#include <linalg.h>

Collaboration diagram for xgboost::MatrixView< T >:
Collaboration graph

Public Member Functions

 MatrixView (HostDeviceVector< T > *vec, std::array< size_t, 2 > strides, std::array< size_t, 2 > shape, int32_t device)
 
 MatrixView (HostDeviceVector< std::remove_const_t< T >> const *vec, std::array< size_t, 2 > strides, std::array< size_t, 2 > shape, int32_t device)
 
 MatrixView (HostDeviceVector< T > *vec, std::array< size_t, 2 > shape, int32_t device)
 Row major constructor. More...
 
 MatrixView (std::vector< T > *vec, std::array< size_t, 2 > shape)
 
 MatrixView (HostDeviceVector< std::remove_const_t< T >> const *vec, std::array< size_t, 2 > shape, int32_t device)
 
XGBOOST_DEVICE const T & operator() (size_t r, size_t c) const
 
XGBOOST_DEVICE T & operator() (size_t r, size_t c)
 
auto Strides () const
 
auto Shape () const
 
auto Values () const
 
auto Size () const
 
auto DeviceIdx () const
 

Detailed Description

template<typename T>
class xgboost::MatrixView< T >

A view over a matrix on contiguous storage.

Template Parameters
Tdata type of matrix

Constructor & Destructor Documentation

◆ MatrixView() [1/5]

template<typename T >
xgboost::MatrixView< T >::MatrixView ( HostDeviceVector< T > *  vec,
std::array< size_t, 2 >  strides,
std::array< size_t, 2 >  shape,
int32_t  device 
)
inline
Parameters
vecstorage.
stridesStrides for matrix.
shapeRows and columns.
deviceWhere the data is stored in.

◆ MatrixView() [2/5]

template<typename T >
xgboost::MatrixView< T >::MatrixView ( HostDeviceVector< std::remove_const_t< T >> const *  vec,
std::array< size_t, 2 >  strides,
std::array< size_t, 2 >  shape,
int32_t  device 
)
inline

◆ MatrixView() [3/5]

template<typename T >
xgboost::MatrixView< T >::MatrixView ( HostDeviceVector< T > *  vec,
std::array< size_t, 2 >  shape,
int32_t  device 
)
inline

Row major constructor.

◆ MatrixView() [4/5]

template<typename T >
xgboost::MatrixView< T >::MatrixView ( std::vector< T > *  vec,
std::array< size_t, 2 >  shape 
)
inline

◆ MatrixView() [5/5]

template<typename T >
xgboost::MatrixView< T >::MatrixView ( HostDeviceVector< std::remove_const_t< T >> const *  vec,
std::array< size_t, 2 >  shape,
int32_t  device 
)
inline

Member Function Documentation

◆ DeviceIdx()

template<typename T >
auto xgboost::MatrixView< T >::DeviceIdx ( ) const
inline

◆ operator()() [1/2]

template<typename T >
XGBOOST_DEVICE T& xgboost::MatrixView< T >::operator() ( size_t  r,
size_t  c 
)
inline

◆ operator()() [2/2]

template<typename T >
XGBOOST_DEVICE const T& xgboost::MatrixView< T >::operator() ( size_t  r,
size_t  c 
) const
inline

◆ Shape()

template<typename T >
auto xgboost::MatrixView< T >::Shape ( ) const
inline

◆ Size()

template<typename T >
auto xgboost::MatrixView< T >::Size ( ) const
inline

◆ Strides()

template<typename T >
auto xgboost::MatrixView< T >::Strides ( ) const
inline

◆ Values()

template<typename T >
auto xgboost::MatrixView< T >::Values ( ) const
inline

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