chsvlib
chsv helper source code

◆ sub_matrix_copy()

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

Calculates a difference between two matrices specified as two-dimensional arrays of scalars and assigns the result to a third matrix.

Template Parameters
ValueTypeA type of a matrix element.
Parameters
[in]left_column_matrixA pointer which addresses the left operand which is a matrix of columns by rows elements.
[in]right_column_matrixA pointer to the subtrahend matrix of columns by rows elements.
columnsA number of columns in the matrices to subtract.
rowsA number of rows in the matrices to subtract.
[in,out]resultA pointer to a matrix which accepts the result of the operation. The elements of the difference are copy-assigned to the respective elements of result. The buffer must not overlap with either left_column_matrix or right_column_matrix.
Exceptions
Anyexceptions thrown from subtraction or move-assignment of ValueType elements.

The elements of the resulting matrix are sequentially copy-assigned to the elements of the two-dimensional array pointed to by result. In order to construct elements of the result in an uninitialized buffer, use sub_matrix_construct. In order to perform subtraction in place, use sub_matrix_inplace or sub_matrix_inplace_rev.