From 4602b36e9d5ea08656e3222846a1f161bbb1cec1 Mon Sep 17 00:00:00 2001 From: y-jan137 Date: Mon, 27 Apr 2026 07:24:41 +0300 Subject: Module refactor --- include/matrix.hpp | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 include/matrix.hpp (limited to 'include/matrix.hpp') diff --git a/include/matrix.hpp b/include/matrix.hpp deleted file mode 100644 index d78f814..0000000 --- a/include/matrix.hpp +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once - -#include -#include -#include -#include "vector.hpp" - -namespace linalg { - -class Matrix { -public: - Matrix() = default; - Matrix(std::size_t rows, std::size_t cols); - Matrix(std::size_t rows, std::size_t cols, double value); - Matrix(std::initializer_list> values); - - [[nodiscard]] std::size_t rows() const noexcept; - [[nodiscard]] std::size_t cols() const noexcept; - [[nodiscard]] bool empty() const noexcept; - - double& operator()(std::size_t i, std::size_t j); - const double& operator()(std::size_t i, std::size_t j) const; - - void fill(double value); - - double* data() noexcept; - const double* data() const noexcept; - - static Matrix identity(std::size_t n); - static Matrix zeros(std::size_t rows, std::size_t cols); - -private: - [[nodiscard]] std::size_t index(std::size_t i, std::size_t j) const; - void check_bounds(std::size_t i, std::size_t j) const; - - std::size_t rows_ = 0; - std::size_t cols_ = 0; - std::vector 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 - -- cgit v1.2.3