#include <ctime>
#include <iostream>
Go to the source code of this file.
◆ fused()
void fused |
( |
const double |
metric[6][N], |
|
|
double |
inverse[6][N] |
|
) |
| |
Definition at line 5 of file speed_test.cpp.
7 for(
int i = 0;
i <
N; ++
i)
9 double det = metric[0][
i] * metric[3][
i] * metric[5][
i]
10 + metric[1][
i] * metric[4][
i] * metric[2][
i]
11 + metric[2][
i] * metric[1][
i] * metric[4][
i]
12 - metric[0][
i] * metric[4][
i] * metric[4][
i]
13 - metric[1][
i] * metric[1][
i] * metric[5][
i]
14 - metric[2][
i] * metric[3][
i] * metric[2][
i];
16 = (metric[3][
i] * metric[5][
i] - metric[4][
i] * metric[4][
i]) / det;
18 = (metric[2][
i] * metric[4][
i] - metric[1][
i] * metric[5][
i]) / det;
20 = (metric[1][
i] * metric[4][
i] - metric[2][
i] * metric[3][
i]) / det;
22 = (metric[0][
i] * metric[5][
i] - metric[2][
i] * metric[2][
i]) / det;
24 = (metric[2][
i] * metric[1][
i] - metric[0][
i] * metric[4][
i]) / det;
26 = (metric[3][
i] * metric[0][
i] - metric[1][
i] * metric[1][
i]) / det;
◆ fused_big()
void fused_big |
( |
const double |
metric[6][N], |
|
|
double |
inverse[6][N] |
|
) |
| |
Definition at line 30 of file speed_test.cpp.
33 for(
int i = 0;
i <
N; ++
i)
35 det[
i] = metric[0][
i] * metric[3][
i] * metric[5][
i]
36 + metric[1][
i] * metric[4][
i] * metric[2][
i]
37 + metric[2][
i] * metric[1][
i] * metric[4][
i]
38 - metric[0][
i] * metric[4][
i] * metric[4][
i]
39 - metric[1][
i] * metric[1][
i] * metric[5][
i]
40 - metric[2][
i] * metric[3][
i] * metric[2][
i];
42 for(
int i = 0;
i <
N; ++
i)
45 = (metric[3][
i] * metric[5][
i] - metric[4][
i] * metric[4][
i]) / det[
i];
47 for(
int i = 0;
i <
N; ++
i)
50 = (metric[2][
i] * metric[4][
i] - metric[1][
i] * metric[5][
i]) / det[
i];
52 for(
int i = 0;
i <
N; ++
i)
55 = (metric[1][
i] * metric[4][
i] - metric[2][
i] * metric[3][
i]) / det[
i];
57 for(
int i = 0;
i <
N; ++
i)
60 = (metric[0][
i] * metric[5][
i] - metric[2][
i] * metric[2][
i]) / det[
i];
62 for(
int i = 0;
i <
N; ++
i)
65 = (metric[2][
i] * metric[1][
i] - metric[0][
i] * metric[4][
i]) / det[
i];
67 for(
int i = 0;
i <
N; ++
i)
70 = (metric[3][
i] * metric[0][
i] - metric[1][
i] * metric[1][
i]) / det[
i];
◆ main()
Definition at line 109 of file speed_test.cpp.
111 double metric[6][
N], inverse[6][
N];
113 for(
int j = 0;
j < 6; ++
j)
114 for(
int i = 0;
i <
N; ++
i)
115 metric[
j][
i] = 1 +
i +
j;
117 const int iterations = 30;
119 for(
int i = 0;
i < iterations; ++
i)
◆ unfused()
void unfused |
( |
const double |
metric[6][N], |
|
|
double |
inverse[6][N] |
|
) |
| |
Definition at line 74 of file speed_test.cpp.
78 for(
int i = 0;
i <
N; ++
i)
79 det[
i] = metric[0][
i] * metric[3][
i] * metric[5][
i]
80 + metric[1][
i] * metric[4][
i] * metric[2][
i]
81 + metric[2][
i] * metric[1][
i] * metric[4][
i]
82 - metric[0][
i] * metric[4][
i] * metric[4][
i]
83 - metric[1][
i] * metric[1][
i] * metric[5][
i]
84 - metric[2][
i] * metric[3][
i] * metric[2][
i];
85 for(
int i = 0;
i <
N; ++
i)
87 = (metric[3][
i] * metric[5][
i] - metric[4][
i] * metric[4][
i]) / det[
i];
88 for(
int i = 0;
i <
N; ++
i)
90 = (metric[2][
i] * metric[4][
i] - metric[1][
i] * metric[5][
i]) / det[
i];
91 for(
int i = 0;
i <
N; ++
i)
93 = (metric[1][
i] * metric[4][
i] - metric[2][
i] * metric[3][
i]) / det[
i];
94 for(
int i = 0;
i <
N; ++
i)
96 = (metric[0][
i] * metric[5][
i] - metric[2][
i] * metric[2][
i]) / det[
i];
97 for(
int i = 0;
i <
N; ++
i)
99 = (metric[2][
i] * metric[1][
i] - metric[0][
i] * metric[4][
i]) / det[
i];
100 for(
int i = 0;
i <
N; ++
i)
102 = (metric[3][
i] * metric[0][
i] - metric[1][
i] * metric[1][
i]) / det[
i];