|
| Matrix (size_t row, size_t column) |
|
| Matrix (size_t row, size_t column, ElementType v) |
| Create a row x column matrix. All elements are v .
|
|
| Matrix (size_t row, size_t column, std::span< ElementType > initData) |
|
| Matrix (std::initializer_list< std::initializer_list< ElementType > > initData) |
|
| Matrix (std::initializer_list< Matrix > matrixs) |
| Stack matrixs in sequence horizontally (column wise).
|
|
| Matrix (const Matrix &m) |
|
| Matrix (Matrix &&m) |
|
template<size_t N> |
void | Write (std::span< ElementType, N > data) |
|
std::vector< ElementType > | Read () const |
|
Matrix | operator- () const |
|
Matrix | operator+ (const Matrix &other) const |
|
Matrix & | operator+= (const Matrix &other) |
|
Matrix | operator- (const Matrix &other) const |
|
Matrix | operator+ (ElementType v) const |
|
Matrix | operator/ (ElementType v) const |
|
Matrix | operator- (ElementType v) const |
|
Matrix | operator* (ElementType v) const |
|
Matrix | operator* (const Matrix &other) const |
|
size_t | Row () const |
|
size_t | Column () const |
|
Matrix & | operator= (std::vector< ElementType > data) |
|
Matrix & | operator= (ElementType f) |
|
Matrix & | operator= (std::span< ElementType > data) |
|
Matrix & | operator= (Matrix &&m) |
|
Matrix | Transpose () const |
|
Matrix | ElementProduct (const Matrix &other) const |
|
Matrix | Relu () const |
|
Matrix | Exp () const |
| Caculate exp() element-wise.
|
|
Matrix | Pow (ElementType e) const |
|
float | operator[] (size_t row, size_t column) const |
|
Matrix | AddToRow (const Matrix &m) const |
| Add value each row. The input should be a 1xC matrix.
|
|
Matrix | Sum () const |
| Returns the sum of all elements in the matrix. The value will be a 1 x 1 matrix.
|
|
Matrix | SumByRow () const |
| Returns the sum of all elements in the same row. If this is a R x C matrix, the result will be a R x 1 matrix.
|
|
Matrix | SumByColumn () const |
| Returns the sum of all elements in the same column. If this is a R x C matrix, the result will be a 1 x C matrix.
|
|
template<MatrixBackend M>
Stack matrixs in sequence horizontally (column wise).
- Exceptions
-
std::runtime_error | If matrix has different number of rows. |
This constructor will create a matrix by stack other matrixs in sequence horizontally.
For example, there are two matrixs:
auto a = Matrix {
{1.0, 1.1},
{2.0, 2.1}
};
auto b = Matrix {
{1.2, 1.3, 1.4},
{2.2, 2.3, 2.4}
};
Now, you can create the third matrix like this:
auto c = Matrix { a, b };
The matrix c
will be:
c = {
{1.0, 1.1, 1.2, 1.3, 1.4},
{2.0, 2.1, 2.2, 2.3, 2.4}
};