9#include <initializer_list>
72 explicit Matrix(
size_t row_size,
size_t col_size)
87 explicit Matrix(
size_t row_size,
size_t col_size,
const T &fill_value)
88 :
txeo::
Tensor<T>({row_size, col_size}, fill_value) {};
103 explicit Matrix(
size_t row_size,
size_t col_size,
const std::vector<T> &values)
104 :
txeo::
Tensor<T>({row_size, col_size}, values) {};
119 explicit Matrix(
size_t row_size,
size_t col_size,
const std::initializer_list<T> &values)
120 :
txeo::
Tensor<T>({row_size, col_size}, std::vector<T>(values)) {};
133 explicit Matrix(
const std::initializer_list<std::initializer_list<T>> &values)
255 using std::runtime_error::runtime_error;
Exceptions concerning txeo::Matrix.
A class representing a matrix, derived from Tensor.
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)
static Matrix< T > to_matrix(txeo::Tensor< T > &&tensor)
Converts a tensor to a matrix by moving data.
size_t size() const
Returns the size of the matrix.
friend class txeo::detail::TensorHelper
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 reshape(const std::initializer_list< size_t > &shape)
Matrix(size_t row_size, size_t col_size)
Constructs a matrix with the specified row and column sizes.
Matrix & operator=(Matrix &&matrix) noexcept
static txeo::Tensor< T > to_tensor(const Matrix< T > &matrix)
Creates a tensor from a matrix (performs copy).
void reshape(const txeo::TensorShape &shape)
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)
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.