Template Function otyca::operator*=(std::vector<T>&, const std::vector<T>&)

Function Documentation

template<typename T>
void otyca::operator*=(std::vector<T> &v1, const std::vector<T> &v2)

Performs element-wise multiplication of two vectors.

This function multiplies each element of the first vector v1 by the corresponding element of the second vector v2, and stores the result in v1. The operation is performed in-place, meaning v1 is modified.

Note

The sizes of the two vectors must be equal. If the sizes do not match, the function does nothing.

Template Parameters:

T – Type of elements in the vectors.

Parameters:
  • v1 – The first vector. The result of the multiplication will be stored here.

  • v2 – The second vector used for element-wise multiplication.