SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Vector Vector::operator*(const mat_vec::Matrix &mat) const {
  2.     size_t size = min(mat.shape().first,this->size());
  3.     Vector tmp(mat.shape().second);
  4.     for (size_t i = 0;i < mat.shape().second;++i) {
  5.         for (size_t j = 0;j < size;++j) {
  6.             tmp[i] += this->vecData[j]*mat.get(j,i);
  7.         }
  8.     }
  9.     return tmp;
  10. }
  11.  
  12. Vector& Vector::operator*=(const mat_vec::Matrix &mat) {
  13.     Vector tmp = *this * mat;
  14.     *this = tmp;
  15.     return *this;
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top