-
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.
Merge pull request #22 from edin-dal/feature/skew-symmetry-support
Add skew-symmetry and fancier structure support
- Loading branch information
Showing
7 changed files
with
154 additions
and
2 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
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) |
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
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