chsvlib
chsv helper source code

◆ sub_matrix_inplace()

void Chusov::Math::sub_matrix_inplace ( ValueType *  minuend_column_matrix,
const ValueType *  subtrahend_column_matrix,
std::size_t  columns,
std::size_t  rows 
)

Performs a subtraction of two matrices using two-dimensional array representation and writes the difference in place of the minuend.

Template Parameters
ValueTypeA type of a matrix element.
Parameters
[in,out]minuend_column_matrixA pointer to a buffer, that on input contains elements of the minuend which is a matrix of columns by rows elements. On output the buffer contains the result of the subtraction.
[in]subtrahend_column_matrixA pointer to a buffer holding the second matrix of columns by rows elements to subtract from minuend_column_matrix.
columnsA number of columns in the matrices to subtract.
rowsA number of rows in the matrices to subtract.
Exceptions
Anyexceptions that originate from in-place subtraction of ValueType scalars.

To subtract matrices writing the difference in place of the subtrahend rather than the minuend, use sub_matrix_inplace_rev. To write the difference to a buffer different from buffers of both of the operands, use either sub_matrix_copy, to replace some other existing matrix with the difference, or sub_matrix_construct to construct the result of subtraction in an uninitialized buffer.

Assumed that \(A\) is the matrix pointed to by minuend_column_matrix, and \(B\) is a matrix addressed by minuend_column_matrix, the function computes \(A\gets A - B\).