Commit d8dda26d by Kenneth Vanhoey

### vector by transposed vector multiplication

parent 7af03e77
 ... @@ -161,11 +161,15 @@ class Matrix ... @@ -161,11 +161,15 @@ class Matrix // Vector / Matrix multiplication // Vector / Matrix multiplication template template Vector operator*(const Vector& v, const Matrix& m); Vector operator*(const Vector& v, const Matrix& m) ; // Scalar / Matrix multiplication // Scalar / Matrix multiplication template template Matrix operator*(T s, const Matrix& m); Matrix operator*(T s, const Matrix& m) ; // Vector / Transposed vector multiplication template Matrix transposed_vectors_mult(const Vector& v1, const Vector& v2) ; /**********************************************/ /**********************************************/ ... ...
 ... @@ -405,9 +405,11 @@ bool Matrix::operator==(const Matrix& m) const { ... @@ -405,9 +405,11 @@ bool Matrix::operator==(const Matrix& m) const { template template std::ostream& operator<<(std::ostream& out, const Matrix& m) std::ostream& operator<<(std::ostream& out, const Matrix& m) { { for(unsigned int i = 0; i < M; ++i) for(unsigned int i = 0; i < M; ++i) { for(unsigned int j = 0; j < N; ++j) for(unsigned int j = 0; j < N; ++j) out << m(i,j) << " " ; out << m(i,j) << " " ; std::cout << std::endl ; } return out ; return out ; } } ... @@ -446,6 +448,15 @@ Matrix operator*(T s, const Matrix& m) ... @@ -446,6 +448,15 @@ Matrix operator*(T s, const Matrix& m) return res ; return res ; } } template Matrix transposed_vectors_mult(const Vector& v1, const Vector& v2) { Matrix res ; for(unsigned int i = 0; i < M; ++i) for(unsigned int j = 0; j < N; ++j) res(i,j) = v1[i] * v2[j] ; return res ; } } // namespace Geom } // namespace Geom } // namespace CGoGN } // namespace CGoGN
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!