diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/matrix.hpp | 7 | ||||
| -rw-r--r-- | include/norms.hpp | 9 | ||||
| -rw-r--r-- | include/vector.hpp | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/include/matrix.hpp b/include/matrix.hpp index ba3e4ae..d78f814 100644 --- a/include/matrix.hpp +++ b/include/matrix.hpp @@ -3,6 +3,7 @@ #include <cstddef> #include <initializer_list> #include <vector> +#include "vector.hpp" namespace linalg { @@ -37,5 +38,11 @@ private: std::vector<double> data_; }; +Matrix transpose(const Matrix& matrix); +Matrix operator+(const Matrix& lhs, const Matrix& rhs); +Matrix operator-(const Matrix& lhs, const Matrix& rhs); +Vector operator*(const Matrix& matrix, const Vector& vector); +Matrix operator*(const Matrix& lhs, const Matrix& rhs); + } // namespace linalg diff --git a/include/norms.hpp b/include/norms.hpp new file mode 100644 index 0000000..85fad41 --- /dev/null +++ b/include/norms.hpp @@ -0,0 +1,9 @@ +#pragma once + +#include "vector.hpp" + +namespace linalg { + +double norm2(const Vector& vector); + +} diff --git a/include/vector.hpp b/include/vector.hpp index e6bc0ce..3e797d8 100644 --- a/include/vector.hpp +++ b/include/vector.hpp @@ -41,6 +41,7 @@ Vector operator+(const Vector& lhs, const Vector& rhs); Vector operator-(const Vector& lhs, const Vector& rhs); Vector operator*(const Vector& v, double scalar); Vector operator*(double scalar, const Vector& v); +Vector operator/(const Vector& v, double scalar); double dot(const Vector& lhs, const Vector& rhs); } // namespace linalg |