chsvlib
chsv helper source code

◆ Matrix() [9/16]

Matrix ( input_iterator_t  itBegin,
input_iterator_t  itEnd,
std::size_t  cColumns,
std::size_t  cRows,
array_interpretation_t  array_interpretation,
const allocator_type alloc = allocator_type() 
)

Constructs a matrix from a specified set of elements given by a pair of iterators and an interpretation mark.

Template Parameters
input_iterator_tis a type of at least InputIterator specifying the set of elements for which the matrix is created.
array_interpretation_tis a type of the array_interpretation parameter denoting a way to copy the iterated elements into the matrix.
Parameters
itBeginis an iterator denoting a start of the sequence and associated with the top-left element of the constructed matrix.
itEndis an iterator which is associated with a (pseudo) element past the end of the sequence of elements assigned to the matrix.
cColumnsis a number of columns within the constructed matrix. The product of the value with a value of cRows must be equal to
std::distance(itBegin, itEnd)
.
cRowsis a number of rows in the constructed matrix. A size of the sequence between the iterators must be exactly equal to the product of cColumns and cRows.
array_interpretationis an identifier for interpretation of the set of elements which can be set to either interpret_array_as_matrix_rows_set (to insert consequent elements of the set to the matrix row-by-row) or interpret_array_as_matrix_columns_set (to insert the elements column-by-column).
allocis an allocator object used to manage storage for elements of the created matrix.
Exceptions
Chusov::Exceptions::InvalidParameterExceptionA product of cColumns and cRows is not equal to a size of the range.