https://github.com/4s4v1n/matrix
Implementation of matrices in C++ with standart operations.
https://github.com/4s4v1n/matrix
cpp matrix oop
Last synced: 4 months ago
JSON representation
Implementation of matrices in C++ with standart operations.
- Host: GitHub
- URL: https://github.com/4s4v1n/matrix
- Owner: 4s4v1n
- License: gpl-3.0
- Created: 2022-04-14T15:02:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-02T19:19:16.000Z (almost 3 years ago)
- Last Synced: 2025-01-08T03:11:08.423Z (5 months ago)
- Topics: cpp, matrix, oop
- Language: C++
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Matrix

## This project presents the implementation of matrices in the form of a class, and operations on matrices in the form of objects of this class
The concept of a matrix is implemented using the `Matrix` class
This class contains fields `_matrix` - data, `_rows` - rows, `_cols` - columns
## All operations are implemented as public methods
1) `bool eq_matrix(const Matrix& other)` - matrix comparison
2) `void sum_matrix(const Matrix& other)` - addition of the current matrix to another
3) `void sub_matrix(const Matrix& other)` - difference of the current matrix with another
4) `void mul_number(const double num)` - multiplication of a matrix by a number
5) `void mul_matrix(const Matrix& other)` - multiplying a matrix by another matrix
6) `Matrix transpose()` - calculating the transposed matrix from the current one
7) `Matrix calc_complements()` - calculation of the matrix of algebraic additions from the current one
8) `double determinant()` - determinant calculation
9) `Matrix inverse_matrix()` - calculation of the inverse matrix for the current## Additionally, for simplified use of methods - operator overloading is implemented
1) `Matrix operator+(const Matrix& other)` - sum of two matrices (A * B)
2) `Matrix operator-(const Matrix& other)` - difference of two matrices (A - B)
3) `Matrix operator*(const Matrix& other)` - product of two matrices (A * B)
4) `Matrix operator*(const double num)` - product of a matrix and a number (A * x)
5) `bool operator==(const Matrix& other)` - equality of two matrices (A == B)
6) `void operator=(const Matrix& other)` - assigning values from one matrix to another (A = B)
7) `void operator+=(const Matrix& other)` - addition of one matrix to another (A += B)
8) `void operator-=(const Matrix& other)` - subtracting one matrix from another (A -= B)
9) `void operator*=(const Matrix& other)` - multiplying a matrix by another matrix (A*= B)
10) `void operator*=(const double num)` - multiplication of a matrix by a number (A*= x)
11) `double& operator()(const int i, const int j)` - getting a reference to a matrix element by index A(i, j)The library is built using makefile with g++ version 9.4.0, on Linux. Unit tests are written in gtest.All source materials and makefile are in the src folder.