-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for skew-symmerty and fancy skew-symmetry
- Loading branch information
1 parent
7da9053
commit 4329cd4
Showing
5 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
symbols: N | ||
A(i, j) := B(i, j) | ||
A:D(i, j) := (0 <= i < N) * (0 <= j < N) | ||
B:D(i, j) := (0 <= i < N) * (0 <= j < N) | ||
B:U(i, j) := (0 <= i <= j < N) | ||
B:R(i, j, ip, jp) := -21.5 * (0 <= j < i < N) * (ip = j) * (jp = i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
symbols: N | ||
A(i, j) := B(i, j) | ||
A:D(i, j) := (0 <= i < N) * (0 <= j < N) | ||
B:D(i, j) := (0 <= i < N) * (0 <= j < N) | ||
B:U(i, j) := (0 <= i <= j < N) | ||
B:R(i, j, ip, jp) := -1 * (0 <= j < i < N) * (ip = j) * (jp = i) |
41 changes: 41 additions & 0 deletions
41
src/test/resources/correct_test_outputs/fancy-symmetry_wo_body.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
#include <iostream> | ||
#include <random> | ||
#include <algorithm> | ||
#include <chrono> | ||
|
||
using namespace std; | ||
using namespace std::chrono; | ||
|
||
extern "C" | ||
void fn(double ** A, double ** B, int N) { | ||
|
||
|
||
long time_computation = 0, start_computation, end_computation; | ||
start_computation = duration_cast<microseconds>(system_clock::now().time_since_epoch()).count(); | ||
for (int i = 0; i < N; ++i) { | ||
|
||
for (int j = max({0, i}); j < N; ++j) { | ||
|
||
A[i][j] += B[i][j]; | ||
} | ||
} | ||
end_computation = duration_cast<microseconds>(system_clock::now().time_since_epoch()).count(); | ||
time_computation = end_computation - start_computation; | ||
cout << time_computation << endl; | ||
long time_reconstruction = 0, start_reconstruction, end_reconstruction; | ||
start_reconstruction = duration_cast<microseconds>(system_clock::now().time_since_epoch()).count(); | ||
|
||
|
||
for (int ip = 0; ip < N; ++ip) { | ||
int j = ip; | ||
for (int jp = max({0, (ip) + 1}); jp < N; ++jp) { | ||
int i = jp; | ||
A[i][j] = (A[ip][jp] * -21.5); | ||
} | ||
} | ||
end_reconstruction = duration_cast<microseconds>(system_clock::now().time_since_epoch()).count(); | ||
time_reconstruction = end_reconstruction - start_reconstruction; | ||
cout << time_reconstruction << endl; | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
src/test/resources/correct_test_outputs/skew-symmetry_wo_body.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
#include <iostream> | ||
#include <random> | ||
#include <algorithm> | ||
#include <chrono> | ||
|
||
using namespace std; | ||
using namespace std::chrono; | ||
|
||
extern "C" | ||
void fn(double ** A, double ** B, int N) { | ||
|
||
|
||
long time_computation = 0, start_computation, end_computation; | ||
start_computation = duration_cast<microseconds>(system_clock::now().time_since_epoch()).count(); | ||
for (int i = 0; i < N; ++i) { | ||
|
||
for (int j = max({0, i}); j < N; ++j) { | ||
|
||
A[i][j] += B[i][j]; | ||
} | ||
} | ||
end_computation = duration_cast<microseconds>(system_clock::now().time_since_epoch()).count(); | ||
time_computation = end_computation - start_computation; | ||
cout << time_computation << endl; | ||
long time_reconstruction = 0, start_reconstruction, end_reconstruction; | ||
start_reconstruction = duration_cast<microseconds>(system_clock::now().time_since_epoch()).count(); | ||
|
||
|
||
for (int ip = 0; ip < N; ++ip) { | ||
int j = ip; | ||
for (int jp = max({0, (ip) + 1}); jp < N; ++jp) { | ||
int i = jp; | ||
A[i][j] = (A[ip][jp] * -1); | ||
} | ||
} | ||
end_reconstruction = duration_cast<microseconds>(system_clock::now().time_since_epoch()).count(); | ||
time_reconstruction = end_reconstruction - start_reconstruction; | ||
cout << time_reconstruction << endl; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters