diff options
author | Siddarth-Suresh <65844402+Siddarth-Suresh@users.noreply.github.com> | 2025-04-26 20:21:02 -0400 |
---|---|---|
committer | Siddarth-Suresh <65844402+Siddarth-Suresh@users.noreply.github.com> | 2025-04-26 20:21:02 -0400 |
commit | 41f612789f652654b5f2fa8c3fee4e348e2081b1 (patch) | |
tree | 386658b4231c6c1daa4f2f9769959d0934b2b44e /inc/vec.h | |
parent | 73633535288711de4850b9d9eec6326eb5de06c0 (diff) |
Initial vector extension changes
Diffstat (limited to 'inc/vec.h')
-rw-r--r-- | inc/vec.h | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/inc/vec.h b/inc/vec.h deleted file mode 100644 index 68482d5..0000000 --- a/inc/vec.h +++ /dev/null @@ -1,44 +0,0 @@ -// vec.h -#ifndef VEC_H -#define VEC_H - -#include <iostream> -#include <vector> -#include <stdexcept> - -template<typename T> -class Vec { -private: - std::vector<T> data; - -public: - Vec() = default; - Vec(const std::vector<T>& values) : data(values) {} - - // Vector-Vector Operations - Vec<T> operator+(const Vec<T>& other) const; - Vec<T> operator-(const Vec<T>& other) const; - Vec<T> operator*(const Vec<T>& other) const; - Vec<T> operator/(const Vec<T>& other) const; - Vec<T> operator%(const Vec<T>& other) const; - - // Vector-Scalar Operations - Vec<T> operator+(T scalar) const; - Vec<T> operator-(T scalar) const; - Vec<T> operator*(T scalar) const; - Vec<T> operator/(T scalar) const; - Vec<T> operator%(T scalar) const; - - // Utility - void print() const; - size_t size() const { return data.size(); } - - // Friend scalar-vector operations - friend Vec<T> operator+(T scalar, const Vec<T>& vec) { return vec + scalar; } - friend Vec<T> operator-(T scalar, const Vec<T>& vec); - friend Vec<T> operator*(T scalar, const Vec<T>& vec) { return vec * scalar; } - friend Vec<T> operator/(T scalar, const Vec<T>& vec); - friend Vec<T> operator%(T scalar, const Vec<T>& vec); -}; - -#endif |