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 v1 by the scalar value v2, and stores the result back in the respective elements of v1. The operation is performed in-place, meaning v1 is modified.

Note

The function assumes that v1 is a valid 2D vector, and it multiplies each sub-vector (row) by the scalar value v2.

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 v1 is multiplied.