Matrix | ( | const std::vector< value_t, alloc_t > & | v, |
typename std::vector< value_t, alloc_t >::size_type | cColumns, | ||
typename std::vector< value_t, alloc_t >::size_type | cRows, | ||
const allocator_type & | alloc = allocator_type() |
||
) |
Creates a matrix from a set of its elements given by an std::vector object.
value_t | is a type of elements of the input vector to be explicitly converted into value_type . |
alloc_t | is a type of an allocator object used by the vector specified as the input parameter. |
v | is an std::vector<value_t ,alloc_t> set of elements to be explicitly converted to elements of the value_type type and stored within the internal storage of the matrix to be created with respect to other parameters. It is assumed that input buffer stores elements row-by-row with first cColumns elements of the vector to be elements of the first row of the matrix, the next cColumns elements are to be elements of the second row and so on. Hence, the input vector must contain at least a number of elements that is determined as a multiple of a number of columns and a number of rows, both of which are specified parametrically. This number of elements will be read from the vector and copied to the internal storage. |
cColumns | is a number of columns in the created matrix. |
cRows | is a number of rows in the created matrix. |
alloc | is an allocator object used to manage storage of the matrix elements. |
Chusov::Exceptions::InvalidParameterException | The values of cColumns and cRows do not correspond to a size of the input vector v (i.e. size of the vector is less than a result of multiplication of cColumns and cRows ). |