chsvlib
chsv helper source code

◆ mul_matrix_construct()

void Chusov::Math::mul_matrix_construct ( const ValueType *  left_column_matrix,
const ValueType *  right_column_matrix,
std::size_t  left_rows,
std::size_t  left_columns_right_rows,
std::size_t  right_columns,
ValueType *restrict  result 
)

Calculates a product of two matrices specified as two-dimensional arrays of scalars and constructs the resulting matrix in an uninitialized buffer.

Template Parameters
ValueTypeA type of a matrix element.
Parameters
[in]left_column_matrixA pointer which addresses the left multiplicand which is a column-major matrix of left_columns_right_rows by left_rows elements.
[in]right_column_matrixA pointer to the second, right, column-major matrix of right_columns by left_columns_right_rows elements.
left_rowsA number of rows in the left multiplicand.
left_columns_right_rowsA number of columns in the left multiplicand and a number of rows in the right multiplicand.
right_columnsA number of columns in the right matrix multiplicand.
[out]resultA pointer to a buffer sufficient to hold the resulting left_rows by right_columns two-dimensional array of elements of the product matrix. The elements of the resulting column-major matrix are constructed in place of the respective elements in result. The buffer must not overlap with either left_column_matrix or right_column_matrix.
Exceptions
Anyexceptions thrown from addition, multiplication or construction of ValueType elements in result.

The elements of the resulting matrix are constructed in place of the respective elements of the two-dimensional buffer pointed to by result which is considered uninitialized. That is, no destruction or assignment of elements in result takes place. In order to replace an existing matrix (different from both left_column_matrix and right_column_matrix) with the product, one should use mul_matrix_copy which performs assignment of elements rather than their construction. In order to perform multiplication in place, use mul_matrix_inplace or mul_matrix_inplace_rev.