Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //uzyty konstruktor
- matrix(unsigned int n_rows, unsigned int n_cols, element** tab) {
- cols = n_cols;
- rows = n_rows;
- element** body = new element* [rows];
- for (int i = 0; i < rows; i++) {
- body[i] = new element [cols];
- for (int j = 0; j < cols; j++) {
- body[i][j] = tab[i][j];
- }
- }
- }
- //wywołanie razem ze stworzeniem tablicy
- complexNumber** tabA = new complexNumber* [3];
- for (int i = 0; i < 3; i++) {
- tabA[i] = new complexNumber[2];
- for (int j = 0; j < 2; j++){
- complexNumber tmp((10 + static_cast <float> (rand()) /( static_cast <float> (RAND_MAX/(10-20)))),
- (10 + static_cast <float> (rand()) /( static_cast <float> (RAND_MAX/(10-20)))));
- tabA[i][j] = tmp;
- }
- }
- matrix<complexNumber> matA(3, 2, tabA);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement