Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <fstream>
- struct Element {
- int row;
- int col;
- int value;
- Element* next = nullptr;
- Element(int, int, int);
- };
- class SparseMatrix {
- private:
- Element* Start = nullptr;
- Element* End = nullptr;
- int rows;
- int cols;
- public:
- SparseMatrix(int, int);
- ~SparseMatrix();
- void addElement(int row, int col, int value);
- void Read(std::ifstream& file1);
- void Sort();
- void Print(std::ofstream& file2);
- SparseMatrix& operator+=(const SparseMatrix& other);
- SparseMatrix& operator-=(const SparseMatrix& other);
- SparseMatrix& operator=(const SparseMatrix& other);
- SparseMatrix& operator*=(const double a);
- SparseMatrix& operator*=(const SparseMatrix& other);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement