big internal rework
This commit is contained in:
24
src/Matrix.h
24
src/Matrix.h
@@ -6,26 +6,23 @@
|
||||
#include <vector>
|
||||
|
||||
class Matrix {
|
||||
public:
|
||||
typedef long double Element;
|
||||
|
||||
private:
|
||||
std::size_t m_Raws;
|
||||
std::size_t m_Columns;
|
||||
std::vector<long double> m_Data;
|
||||
std::vector<Element> m_Data;
|
||||
|
||||
public:
|
||||
Matrix(const std::string& fileNameInput);
|
||||
Matrix() : m_Raws(0), m_Columns(0) {}
|
||||
Matrix(std::size_t raws, std::size_t columns);
|
||||
Matrix(std::size_t raws, std::size_t columns, std::initializer_list<long double>&& initList);
|
||||
Matrix(std::size_t raws, std::size_t columns, std::initializer_list<Element>&& initList);
|
||||
~Matrix();
|
||||
|
||||
std::size_t GetRawCount() const;
|
||||
std::size_t GetColumnCount() const;
|
||||
|
||||
void Insert();
|
||||
void Print() const;
|
||||
|
||||
void Save(const std::string& fileName);
|
||||
void Load(const std::string& filename);
|
||||
|
||||
void Transpose();
|
||||
|
||||
static Matrix Identity(std::size_t size);
|
||||
@@ -36,13 +33,10 @@ class Matrix {
|
||||
|
||||
bool operator==(const Matrix& other) const;
|
||||
Matrix operator*(const Matrix& other) const;
|
||||
long double& operator[](std::size_t index);
|
||||
Element& operator[](std::size_t index);
|
||||
|
||||
long double& at(std::size_t raw, std::size_t column);
|
||||
long double at(std::size_t raw, std::size_t column) const;
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& stream, const Matrix& mat);
|
||||
friend std::istream& operator>>(std::istream& stream, Matrix& mat);
|
||||
Element& at(std::size_t raw, std::size_t column);
|
||||
Element at(std::size_t raw, std::size_t column) const;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user