Class cumat

Inheritance Relationships

Base Type

Class Documentation

class cumat : public cubase

Matrix. Elements are stored in GPU by column-major format.

Public Functions

inline cumat()

Construct a new cumat object.

inline cumat(size_t rows, size_t cols, cubase::Init init = cubase::Init::Zero)

Construct a new cumat object. Number of rows Number of columns How to initialise.

inline cumat(arma::mat src)

Construct a new cumat object from armadillo matrix. Armadillo matrix.

inline cumat(const cumat &mat)

Copy construct a new cumat object. Source matrix.

inline cumat(cumat &&mat)

Move construct a new cumat object. The source object will move the management of memory to the new object.

template<class L, class R>
inline cumat(cuop_matmul<L, R, cutraits<L>::type, cutraits<R>::type> &&op)
cumat(cuop_diagmul &&op)
inline virtual ~cumat()

Destroy the cumat object.

inline virtual size_t nbytes() const override

Get size in bytes Size in bytes.

const cuop_trans<cumat> t() const

Transpose matrix. Do not do the calculation immediately, unless it is assigned to a new object. Object with transpose mark.

inline void resize(size_t rows, size_t cols)
inline cumat &operator=(const cumat &right)
inline cumat &operator=(cumat &&right)
cumat &operator=(const cuop_trans<cumat> &right)
template<class L, class R>
inline cumat &operator=(cuop_matmul<L, R, cutraits<L>::type, cutraits<R>::type> &&op)
cumat &operator=(cuop_diagmul &&op)
template<class R>
inline auto operator*(const R &right) const
custride as_stride() const

Convert to object of custride type in which each column is a stride. Converted custride object.

cuop_diagmul diagmul(const cumat &diag) const

Multiply with a diagonal matrix. Diagonal elements of the diagonal matrix Result matrix.

inline size_t nrows() const
inline size_t ncols() const

Public Static Attributes

static constexpr cuop::Op op = cuop::Op::Origin
static constexpr cubase::Type type = cubase::Type::Mat

Protected Attributes

size_t mRows = 0
size_t mCols = 0