Reworking vector class with core funtionality

This commit is contained in:
2025-09-08 20:24:51 +02:00
parent 417afb32b5
commit 0bd96dd219
7 changed files with 236 additions and 106 deletions
+3 -6
View File
@@ -1,10 +1,6 @@
#ifndef _matrix_n_
#define _matrix_n_
#include "iostream"
#include <vector>
//#include <random>
#include "./utils/vector.h"
@@ -16,6 +12,8 @@ namespace utils{
struct Matrix{
utils::Vector<T> m;
T& operator[](uint64_t idx) { return m[idx]; } // Makes it able to do matr[1][1]
const T& operator[](uint64_t idx) const { return m[idx]; } // Makes it able to do matr[1][1]
using vector_type = typename decltype(std::declval<T>().v)::value_type;
@@ -26,8 +24,7 @@ namespace utils{
Matrix() = default; // Default constructor
T& operator[](uint64_t idx) { return m[idx]; } // Makes it able to do matr[1][1]
const T& operator[](uint64_t idx) const { return m[idx]; } // Makes it able to do matr[1][1]
void fill(uint64_t rows, uint64_t cols, const vector_type num=0){