aboutsummaryrefslogtreecommitdiff
path: root/include/vector.hpp
diff options
context:
space:
mode:
authory-jan137 <yousefjan24000@gmail.com>2026-04-27 07:24:41 +0300
committery-jan137 <yousefjan24000@gmail.com>2026-04-27 07:24:41 +0300
commit4602b36e9d5ea08656e3222846a1f161bbb1cec1 (patch)
tree87618f154f7ebe91657ba1501d695d45a31e7881 /include/vector.hpp
parentb8bc28c70a6f2b0e7de81e85a796303d514df008 (diff)
Module refactor
Diffstat (limited to 'include/vector.hpp')
-rw-r--r--include/vector.hpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/include/vector.hpp b/include/vector.hpp
deleted file mode 100644
index 3e797d8..0000000
--- a/include/vector.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-#pragma once
-
-#include <cstddef>
-#include <initializer_list>
-#include <vector>
-
-namespace linalg {
-
-class Vector {
-public:
- Vector() = default;
- explicit Vector(std::size_t n);
- Vector(std::size_t n, double value);
- Vector(std::initializer_list<double> values);
-
- [[nodiscard]] std::size_t size() const noexcept;
- [[nodiscard]] bool empty() const noexcept;
-
- double& operator[](std::size_t i);
- const double& operator[](std::size_t i) const;
-
- void fill(double value);
-
- double* data() noexcept;
- const double* data() const noexcept;
-
- auto begin() noexcept { return data_.begin(); }
- auto end() noexcept { return data_.end(); }
- auto begin() const noexcept { return data_.begin(); }
- auto end() const noexcept { return data_.end(); }
- auto cbegin() const noexcept { return data_.cbegin(); }
- auto cend() const noexcept { return data_.cend(); }
-
-private:
- void check_index(std::size_t i) const;
-
- std::vector<double> data_;
-};
-
-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