Template Function otyca::operator*=(std::vector<std::vector<T>>&, const T&)
Function Documentation
-
template<typename T>
void otyca::operator*=(std::vector<std::vector<T>> &v1, const T &v2) Performs element-wise multiplication of a 2D vector with a scalar.
This function multiplies each element of the 2D vector
v1by the scalar valuev2, and stores the result back in the respective elements ofv1. The operation is performed in-place, meaningv1is modified.Note
The function assumes that
v1is a valid 2D vector, and it multiplies each sub-vector (row) by the scalar valuev2.- Template Parameters:
T – Type of elements in the 2D vector.
- Parameters:
v1 – The 2D vector to be multiplied by the scalar. The result of the multiplication will be stored here.
v2 – The scalar value by which each element of
v1is multiplied.