chsvlib
chsv helper source code

◆ add_matrix_inplace()

void Chusov::Math::add_matrix_inplace ( ValueType *  left_column_matrix,
const ValueType *  right_column_matrix,
std::size_t  columns,
std::size_t  rows 
)

Performs an in-place addition of two matrices using two-dimensional array representation.

Template Parameters
ValueTypeA type of a matrix element.
Parameters
[in,out]left_column_matrixA pointer to a buffer, that on input contains elements of the left addend which is a matrix of columns by rows elements. On output the buffer contains the result of the addition.
[in]right_column_matrixA pointer to a buffer holding the second matrix of columns by rows elements to add to left_column_matrix.
columnsA number of columns in the matrices to add.
rowsA number of rows in the matrices to add.
Exceptions
Anyexceptions that originate from in-place addition of ValueType scalars.

To add matrices writing the sum to a buffer different from buffers of the operands, use either add_matrix_copy, to replace some other existing matrix with the sum, or add_matrix_construct to construct the result of addition in an uninitialized buffer.