-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
17 additions
and
17 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 |
---|---|---|
|
@@ -6,14 +6,14 @@ | |
% http://shootout.alioth.debian.org/ | ||
% | ||
% Author: Julien Fischer <[email protected]> | ||
% | ||
% | ||
% A variant of the nbody benchmark in nbody.m that uses mutable data | ||
% structures defined in whatever the target language is. | ||
% | ||
% Compile with: -O5 --intermodule-optimization | ||
% | ||
% Compile with: -O5 --intermodule-optimization | ||
% | ||
% For C (gcc) add: --cflags="-O3 -mfpmath=sse -msse3" | ||
% | ||
% | ||
% TODO: support Erlang. | ||
% | ||
%-----------------------------------------------------------------------------% | ||
|
@@ -50,7 +50,7 @@ | |
int.fold_up(advance(0.01, NBodySystem), 1, N, !IO), | ||
energy(NBodySystem, FinalEnergy, !IO), | ||
io.format("%.9f\n", [f(FinalEnergy)], !IO) | ||
else | ||
else | ||
io.set_exit_status(1, !IO) | ||
). | ||
|
||
|
@@ -105,7 +105,7 @@ | |
|
||
:- pred energy_3(bodies::array_ui, body_ref::in, int::in, | ||
float::in, float::out, io::di, io::uo) is det. | ||
|
||
energy_3(Bodies, B, J, !E, !IO) :- | ||
B2 = Bodies ^ unsafe_elem(J), | ||
get_position(B, Bx, By, Bz, !IO), | ||
|
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
% | ||
% Author: Julien Fischer <[email protected]> | ||
% | ||
% A variant of the nbody benchmark in nbody.m that uses stores and refernces. | ||
% A variant of the nbody benchmark in nbody.m that uses stores and references. | ||
% | ||
% Compile with: -O5 --intermodule-optimization --ctgc | ||
% | ||
|