#include <iostream>
#include <omp.h>
int main() {
int SIZE = 1000;
double start, stop;
int** A = new int* [SIZE];
int** B = new int* [SIZE];
int** C = new int* [SIZE];
int** BT = new int* [SIZE];
start = omp_get_wtime();
for (int i = 0;i < SIZE;i++)
A[i] = new int[SIZE];
for (int i = 0;i < SIZE;i++)
B[i] = new int[SIZE];
for (int i = 0;i < SIZE;i++)
C[i] = new int[SIZE];
for (int i = 0;i < SIZE;i++)
BT[i] = new int[SIZE];
for (int i = 0;i < SIZE;i++) { //tworzenie A
for (int j = 0;j < SIZE;j++)
A[i][j] = rand() % 10;
}
for (int i = 0;i < SIZE;i++) { //tworzenie B
for (int j = 0;j < SIZE;j++)
B[i][j] = rand() % 10;
}
for (int i = 0;i < SIZE;i++) { //transponowanie
for (int j = 0;j < SIZE;j++)
BT[i][j] = B[j][i];
}
for (int i = 0;i < SIZE;i++) { //tworzenie C
for (int j = 0;j < SIZE;j++)
C[i][j] = 0;
}
for(int i = 0;i < SIZE;i++) { //mnozenie A i B
for (int j = 0;j < SIZE;j++) {
for (int k = 0;k < SIZE;k++)
C[i][j] += A[i][k] * BT[j][k];
}
}
stop = omp_get_wtime();
std::cout << "Czas wykonania: " << stop - start << std::endl;
return 0;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}