11#include <initializer_list>
138 explicit Matrix(
const std::initializer_list<std::initializer_list<T>> &
values)
381 template <
typename U>
384 template <
typename U>
387 template <
typename U>
390 template <
typename U>
393 template <
typename U>
396 template <
typename U>
399 template <
typename U>
402 template <
typename U>
405 template <
typename U>
423 using std::runtime_error::runtime_error;
A container for managing training, evaluation, and test data splits.
Exceptions concerning txeo::Matrix.
A class representing a matrix, derived from Tensor.
friend Matrix< U > operator-(const Matrix< U > &left, const U &right)
Matrix(Matrix &&matrix) noexcept
Matrix(size_t row_size, size_t col_size, const std::vector< T > &values)
Constructs a matrix with the specified row and column sizes and values.
Matrix & operator=(const Matrix &matrix)
void reshape(const std::vector< size_t > &shape)
friend Matrix< U > operator*(const U &scalar, const Matrix< U > &matrix)
static Matrix< T > to_matrix(txeo::Tensor< T > &&tensor)
Converts a tensor to a matrix by moving data.
Matrix< T > & transpose()
Transposes the matrix (swaps rows and columns) in-place.
friend Matrix< U > operator+(const Matrix< U > &left, const Matrix< U > &right)
size_t size() const
Returns the size of the matrix.
Tensor< T > dot(const txeo::Vector< T > &vector) const
Performs matrix-vector multiplication.
friend class txeo::detail::TensorHelper
void normalize_columns(txeo::NormalizationType type)
Normalizes matrix columns in-place using specified normalization method.
Matrix(size_t row_size, size_t col_size, const std::initializer_list< T > &values)
Constructs a matrix with the specified row and column sizes and initializer list.
static Matrix< T > to_matrix(const txeo::Tensor< T > &tensor)
Creates a matrix from a tensor (preforms copy).
Matrix(const std::initializer_list< std::initializer_list< T > > &values)
Constructs a matrix from a nested initializer list.
Matrix(txeo::Tensor< T > &&tensor)
Constructs a matrix by moving data from a Tensor.
Matrix(size_t row_size, size_t col_size, const T &fill_value)
Constructs a matrix with the specified row and column sizes and a fill value.
Matrix(const Matrix &matrix)
static txeo::Tensor< T > to_tensor(Matrix< T > &&matrix)
Converts a matrix to a tensor by moving data.
void normalize_rows(txeo::NormalizationType type)
Normalizes matrix rows in-place using specified normalization method.
void reshape(const std::initializer_list< size_t > &shape)
friend Matrix< U > operator/(const Matrix< U > &left, const U &right)
size_t row_size() const
Returns the row size of the matrix.
friend Matrix< U > operator-(const U &left, const Matrix< U > &right)
Matrix(size_t row_size, size_t col_size)
Constructs a matrix with the specified row and column sizes.
Matrix & operator=(Matrix &&matrix) noexcept
size_t col_size() const
Returns the column size of the matrix.
static txeo::Tensor< T > to_tensor(const Matrix< T > &matrix)
Creates a tensor from a matrix (performs copy).
friend Matrix< U > operator/(const U &left, const Matrix< U > &right)
friend Matrix< U > operator*(const Matrix< U > &matrix, const U &scalar)
friend Matrix< U > operator+(const Matrix< U > &left, const U &right)
void reshape(const txeo::TensorShape &shape)
Matrix< T > clone() const
Matrix< T > dot(const Matrix< T > &matrix) const
Performs matrix multiplication with another matrix.
friend Matrix< U > operator-(const Matrix< U > &left, const Matrix< U > &right)
Class that deals with the main tasks of prediction (inference)
A utility class for aggregation functions on tensors.
A utility class for common math functions on tensors.
Implements the mathematical concept of tensor, which is a magnitude of multiple order....
Tensor & operator=(const Tensor &tensor)
constexpr std::type_identity_t< T > type() const
Returns the data type of this tensor.
const txeo::TensorShape & shape() const
Returns the shape of this tensor.
size_t dim() const
Returns the dimension of this tensor.
A utility class for performing operations on tensors and vectors.
A utility class for partitioning tensors.
The shape of a tensor is an ordered collection of dimensions of mathematical vector spaces.
A class representing a vector, derived from Tensor.
NormalizationType
Normalization types to be used in normalization functions.