Skip to content

function multiply_matrix(T *, const T *, size_t, size_t) demo

template <typename T>
void multiply_matrix(T* out, const T* in, size_t rows, size_t cols)

Multiplies two matrices.

Performs a standard matrix multiplication on the given input and stores the result in the output buffer. All matrices are assumed to be stored in row-major order.

Template parameters
T The numeric type of the matrix elements.
Parameters
out Pointer to the output matrix buffer.
in Pointer to the input matrix buffer.
rows Number of rows in both matrices.
cols Number of columns in both matrices.
Preconditions
out, in must point to valid buffers.
rows and cols must be greater than zero.
Postconditions
On return, out contains the matrix product of in.
Exceptions
std::invalid_argument if rows or cols are zero.
std::bad_alloc if internal allocation fails.

Since

1.2.0

Version

1.2.1

Defined at library.hpp:331