Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector Vector::operator*(const mat_vec::Matrix &mat) const {
- size_t size = min(mat.shape().first,this->size());
- Vector tmp(mat.shape().second);
- for (size_t i = 0;i < mat.shape().second;++i) {
- for (size_t j = 0;j < size;++j) {
- tmp[i] += this->vecData[j]*mat.get(j,i);
- }
- }
- return tmp;
- }
- Vector& Vector::operator*=(const mat_vec::Matrix &mat) {
- Vector tmp = *this * mat;
- *this = tmp;
- return *this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement