Operators.h 676 B

12345678910111213141516171819202122232425262728
  1. #ifndef OPERATORS_H
  2. #define OPERATORS_H
  3. #include <core/vector/MatrixT.h>
  4. #include <core/vector/VectorT.h>
  5. template <class T>
  6. inline MatrixT<T> operator*(const MatrixT<T>& A, const MatrixT<T>& B) {
  7. MatrixT<T> result(A.rows(),B.cols());
  8. result.multiply(A,B);
  9. return result;
  10. }
  11. template <class T>
  12. inline VectorT<T> operator*(const MatrixT<T>& A, const VectorT<T>& v) {
  13. VectorT<T> result(A.rows(),v.size());
  14. result.multiply(A,v);
  15. return result;
  16. }
  17. template <class T>
  18. inline VectorT<T> operator*(const VectorT<T>& v, const MatrixT<T>& B) {
  19. VectorT<T> result(v.size(),B.cols());
  20. result.multiply(v,B);
  21. return result;
  22. }
  23. #endif // OPERATORS_H