N (dimension) |
vec runtime [s] |
valarray runtime [s] |
---|---|---|
3 | 1.82 | 14.7 |
10 | 1.82 | 14.7 |
15 | 1.82 | 14.7 |
20 | 13.8 | 14.7 |
25 | 17.2 | 14.7 |
50 | 40.5 | 14.7 |
100 | 78.4 | 14.7 |
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
#include <algorithm> | |
#include <array> | |
#include <iostream> | |
#include <iterator> | |
#include <utility> | |
#include <vector> | |
struct foo { | |
foo(int i) : data(i) {} | |
friend std::ostream& operator<<(std::ostream& os, foo const& f) { |
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
1.139094106868506 1.906912332044604 1.155279971572842 1.816240119921928 | |
1.968538028170452 1.705944581231948 1.918194220532118 1.812205985231770 | |
1.118324298619098 1.725613776800635 1.384799205428535 1.866053809172827 | |
1.737349609441751 1.606855600174225 1.015329937740098 1.753721504578023 | |
1.940862584344073 1.808855307356398 1.202632643688191 1.957539399728702 | |
1.859908234819278 1.530527429322220 1.619837819772417 1.742353445157978 | |
1.740218780123652 1.412897280275937 1.699645694977586 1.287551553928310 | |
1.886571871186663 1.945403843665351 1.720919068945055 1.615504507618511 | |
1.609826281455626 1.443930696540812 1.418713470467047 1.504665550385818 | |
1.201470173935238 1.741604588352925 1.783894411407497 1.373038600912394 |
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
#include <cstdio> | |
int square(int x) { | |
return x*x; | |
} | |
int main() { | |
int a = 5; | |
int b = 2; | |
int c = a + b; |
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
#include <iostream> | |
#include <vector> | |
double average(const std::vector<int>& v) { | |
double a; | |
size_t N = v.size(); | |
for (size_t i = 0; i <= N; i++) { | |
int b = v[i]; | |
a += b / N; | |
} |
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
#include <iostream> | |
#include <string> | |
#include <alps/accumulators.hpp> | |
#include <alps/utilities/mpi.hpp> | |
#include <alps/hdf5/archive.hpp> | |
int main (int argc, char *argv[]) { | |
alps::mpi::environment env(argc, argv, false); | |
alps::mpi::communicator c; |
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
#include <iostream> | |
#include <cstdlib> | |
double f_one(double x) { | |
return x; | |
} | |
double f_two(double x) { | |
return x*x; | |
} |
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
#include <iostream> | |
#include <type_traits> | |
using namespace std; | |
template <typename...> using void_t = void; | |
template <typename T, typename = void> | |
struct has_foo : false_type {}; |
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
LDLIBS += -lcblas -llapacke | |
.PHONY: clean | |
test: test.o | |
clean: | |
$(RM) test.o test |
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
*.tex.backup | |
*.aux | |
*.log | |
*.toc | |
*.fls | |
*.fdb_latexmk | |
*.bbl | |
*.blg | |
*.out |