|
Square Matrix v0.1.3
|
Klasa reprezentująca macierz kwadratową. More...
#include <square_matrix.hpp>
Public Member Functions | |
| SquareMatrix () | |
| Konstruktor domyślny, tworzy pustą macierz. | |
| SquareMatrix (int size) | |
| Konstruktor z parametrem rozmiaru macierzy. | |
| SquareMatrix (int size, const int *rowData) | |
| Konstruktor z parametrem danych wiersza. | |
| SquareMatrix (SquareMatrix &other) | |
| Konstruktor kopiujący. | |
| ~SquareMatrix () | |
| Destruktor, zwalnia pamięć. | |
| SquareMatrix & | allocate (int size) |
| Przydziela pamięć dla macierzy o podanym rozmiarze. | |
| SquareMatrix & | insert (int row, int col, int value) |
| Wstawia wartość do elementu macierzy. | |
| int | get (int row, int col) |
| Zwraca wartość z elementu macierzy. | |
| SquareMatrix & | transpose () |
| Transponuje macierz. | |
| SquareMatrix & | randomize () |
| Losowo wypełnia macierz. | |
| SquareMatrix & | randomize (int count) |
| Losowo wypełnia macierz określoną liczbą losowych elementów. | |
| SquareMatrix & | insertMainDiagonal (const int *mainDiagonalData) |
| Wstawia dane na główną przekątną macierzy. | |
| SquareMatrix & | insertDiagonal (int offset, const int *diagonalData) |
| Wstawia dane na przekątną o określonym przesunięciu. | |
| SquareMatrix & | insertColumn (int col, const int *columnData) |
| Wstawia dane do kolumny. | |
| SquareMatrix & | insertRow (int row, const int *rowData) |
| Wstawia dane do wiersza. | |
| SquareMatrix & | fillDiagonal () |
| Wypełnia macierz przekątną. | |
| SquareMatrix & | fillUnderDiagonal () |
| Wypełnia macierz poniżej przekątnej. | |
| SquareMatrix & | fillOverDiagonal () |
| Wypełnia macierz powyżej przekątnej. | |
| SquareMatrix & | fillChessboardStyle () |
| Wypełnia macierz w stylu szachownicy. | |
| SquareMatrix & | operator+ (const SquareMatrix &other) const |
| Dodaje dwie macierze. | |
| SquareMatrix & | operator* (const SquareMatrix &other) const |
| Mnoży dwie macierze. | |
| SquareMatrix & | operator+ (int scalar) const |
| Dodaje skalara do macierzy. | |
| SquareMatrix & | operator* (int scalar) const |
| Mnoży macierz przez skalar. | |
| SquareMatrix & | operator- (int scalar) const |
| Odejmuje skalar od macierzy. | |
| SquareMatrix & | operator++ (int) |
| Zwiększa macierz o 1. | |
| SquareMatrix & | operator-- (int) |
| Zmniejsza macierz o 1. | |
| SquareMatrix & | operator+= (int scalar) |
| Dodaje skalar do macierzy i zwraca wynik. | |
| SquareMatrix & | operator-= (int scalar) |
| Odejmuje skalar od macierzy i zwraca wynik. | |
| SquareMatrix & | operator*= (int scalar) |
| Mnoży macierz przez skalar i zwraca wynik. | |
| SquareMatrix & | operator+= (double) |
| Dodaje skalar typu double do macierzy. | |
| bool | operator== (const SquareMatrix &other) const |
| Porównuje dwie macierze pod kątem równości. | |
| bool | operator> (const SquareMatrix &other) const |
| Porównuje dwie macierze pod kątem większości. | |
| bool | operator< (const SquareMatrix &other) const |
| Porównuje dwie macierze pod kątem mniejszości. | |
| bool | operator!= (const SquareMatrix &other) const |
| Porównuje dwie macierze pod kątem nierówności. | |
| void | displayFull () const |
| Wyświetla pełną macierz. | |
| void | displayTruncated () const |
| Wyświetla skróconą wersję macierzy. | |
Friends | |
| SquareMatrix | operator+ (int scalar, const SquareMatrix &matrix) |
| Dodaje skalar do macierzy. | |
| SquareMatrix | operator* (int scalar, const SquareMatrix &matrix) |
| Mnoży macierz przez skalar. | |
| SquareMatrix | operator- (int scalar, const SquareMatrix &matrix) |
| Odejmuje macierz od skalara. | |
| std::ostream & | operator<< (std::ostream &os, const SquareMatrix &matrix) |
| Wypisuje macierz na standardowe wyjście. | |
Klasa reprezentująca macierz kwadratową.
|
explicit |
Konstruktor z parametrem rozmiaru macierzy.
| size | Rozmiar macierzy. |
| SquareMatrix::SquareMatrix | ( | int | size, |
| const int * | rowData ) |
Konstruktor z parametrem danych wiersza.
| size | Rozmiar macierzy. |
| rowData | Dane wiersza do zainicjowania macierzy. |
| SquareMatrix::SquareMatrix | ( | SquareMatrix & | other | ) |
Konstruktor kopiujący.
| other | Inna macierz, która ma być skopiowana. |
| SquareMatrix & SquareMatrix::allocate | ( | int | size | ) |
Przydziela pamięć dla macierzy o podanym rozmiarze.
| size | Rozmiar macierzy. |
| SquareMatrix & SquareMatrix::fillChessboardStyle | ( | ) |
Wypełnia macierz w stylu szachownicy.
| SquareMatrix & SquareMatrix::fillDiagonal | ( | ) |
Wypełnia macierz przekątną.
| SquareMatrix & SquareMatrix::fillOverDiagonal | ( | ) |
Wypełnia macierz powyżej przekątnej.
| SquareMatrix & SquareMatrix::fillUnderDiagonal | ( | ) |
Wypełnia macierz poniżej przekątnej.
| int SquareMatrix::get | ( | int | row, |
| int | col ) |
Zwraca wartość z elementu macierzy.
| row | Numer wiersza. |
| col | Numer kolumny. |
| SquareMatrix & SquareMatrix::insert | ( | int | row, |
| int | col, | ||
| int | value ) |
Wstawia wartość do elementu macierzy.
| row | Numer wiersza. |
| col | Numer kolumny. |
| value | Wartość do wstawienia. |
| SquareMatrix & SquareMatrix::insertColumn | ( | int | col, |
| const int * | columnData ) |
Wstawia dane do kolumny.
| col | Numer kolumny. |
| columnData | Dane do wstawienia w kolumnie. |
| SquareMatrix & SquareMatrix::insertDiagonal | ( | int | offset, |
| const int * | diagonalData ) |
Wstawia dane na przekątną o określonym przesunięciu.
| offset | Przesunięcie dla przekątnej. |
| diagonalData | Dane do wstawienia na przekątną. |
| SquareMatrix & SquareMatrix::insertMainDiagonal | ( | const int * | mainDiagonalData | ) |
Wstawia dane na główną przekątną macierzy.
| mainDiagonalData | Dane do wstawienia na główną przekątną. |
| SquareMatrix & SquareMatrix::insertRow | ( | int | row, |
| const int * | rowData ) |
Wstawia dane do wiersza.
| row | Numer wiersza. |
| rowData | Dane do wstawienia w wierszu. |
| bool SquareMatrix::operator!= | ( | const SquareMatrix & | other | ) | const |
Porównuje dwie macierze pod kątem nierówności.
| other | Inna macierz do porównania. |
| SquareMatrix & SquareMatrix::operator* | ( | const SquareMatrix & | other | ) | const |
Mnoży dwie macierze.
| other | Inna macierz do pomnożenia. |
| SquareMatrix & SquareMatrix::operator* | ( | int | scalar | ) | const |
Mnoży macierz przez skalar.
| scalar | Skalar do mnożenia. |
| SquareMatrix & SquareMatrix::operator*= | ( | int | scalar | ) |
Mnoży macierz przez skalar i zwraca wynik.
| scalar | Skalar do mnożenia. |
| SquareMatrix & SquareMatrix::operator+ | ( | const SquareMatrix & | other | ) | const |
Dodaje dwie macierze.
| other | Inna macierz do dodania. |
| SquareMatrix & SquareMatrix::operator+ | ( | int | scalar | ) | const |
Dodaje skalara do macierzy.
| scalar | Skalar do dodania. |
| SquareMatrix & SquareMatrix::operator++ | ( | int | ) |
Zwiększa macierz o 1.
| SquareMatrix & SquareMatrix::operator+= | ( | double | scalar | ) |
Dodaje skalar typu double do macierzy.
| scalar | Skalar typu double do dodania. |
| SquareMatrix & SquareMatrix::operator+= | ( | int | scalar | ) |
Dodaje skalar do macierzy i zwraca wynik.
| scalar | Skalar do dodania. |
| SquareMatrix & SquareMatrix::operator- | ( | int | scalar | ) | const |
Odejmuje skalar od macierzy.
| scalar | Skalar do odjęcia. |
| SquareMatrix & SquareMatrix::operator-- | ( | int | ) |
Zmniejsza macierz o 1.
| SquareMatrix & SquareMatrix::operator-= | ( | int | scalar | ) |
Odejmuje skalar od macierzy i zwraca wynik.
| scalar | Skalar do odjęcia. |
| bool SquareMatrix::operator< | ( | const SquareMatrix & | other | ) | const |
Porównuje dwie macierze pod kątem mniejszości.
| other | Inna macierz do porównania. |
| bool SquareMatrix::operator== | ( | const SquareMatrix & | other | ) | const |
Porównuje dwie macierze pod kątem równości.
| other | Inna macierz do porównania. |
| bool SquareMatrix::operator> | ( | const SquareMatrix & | other | ) | const |
Porównuje dwie macierze pod kątem większości.
| other | Inna macierz do porównania. |
| SquareMatrix & SquareMatrix::randomize | ( | ) |
Losowo wypełnia macierz.
| SquareMatrix & SquareMatrix::randomize | ( | int | count | ) |
Losowo wypełnia macierz określoną liczbą losowych elementów.
| count | Liczba losowych elementów. |
| SquareMatrix & SquareMatrix::transpose | ( | ) |
Transponuje macierz.
|
friend |
Mnoży macierz przez skalar.
| scalar | Skalar do mnożenia. |
| matrix | Macierz do mnożenia przez skalar. |
|
friend |
Dodaje skalar do macierzy.
| scalar | Skalar do dodania. |
| matrix | Macierz do dodania skalara. |
|
friend |
Odejmuje macierz od skalara.
| scalar | Skalar, od którego odejmujemy macierz. |
| matrix | Macierz do odjęcia. |
|
friend |
Wypisuje macierz na standardowe wyjście.
| os | Strumień wyjściowy. |
| matrix | Macierz do wypisania. |