|
|
|
@ -21,6 +21,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include <cstring> |
|
|
|
#include <cstring> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "Vector.h" |
|
|
|
#include "constants.h" |
|
|
|
#include "constants.h" |
|
|
|
|
|
|
|
|
|
|
|
namespace Magnum { |
|
|
|
namespace Magnum { |
|
|
|
@ -114,6 +115,18 @@ template<class T, size_t size> class Matrix { |
|
|
|
return out; |
|
|
|
return out; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @brief Multiply vector operator */ |
|
|
|
|
|
|
|
Vector<T, size> operator*(const Vector<T, size>& other) const { |
|
|
|
|
|
|
|
Vector<T, size> out; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(size_t row = 0; row != size; ++row) { |
|
|
|
|
|
|
|
for(size_t pos = 0; pos != size; ++pos) |
|
|
|
|
|
|
|
out.add(row, at(pos, row)*other.at(pos)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return out; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @brief Transposed matrix */ |
|
|
|
/** @brief Transposed matrix */ |
|
|
|
Matrix<T, size> transposed() const { |
|
|
|
Matrix<T, size> transposed() const { |
|
|
|
Matrix<T, size> out; |
|
|
|
Matrix<T, size> out; |
|
|
|
|