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
#pragma once | |
#include <vector> | |
#include <map> | |
#include <unordered_set> | |
template<typename T> | |
struct AdjM { | |
std::vector<T> mat; | |
size_t V; |
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
import cxxfilt | |
def toxml(s): | |
s = str.replace(str(s), '&', '&') | |
s = str.replace(str(s), '<', '<') | |
return str.replace(str(s), '>', '>') | |
def tostr(s): | |
s = str.replace(str(s), '>', '>') | |
s = str.replace(str(s), '<', '<') |
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
var maxIterations; | |
var maxVal; | |
var height; | |
var width; | |
var pointx; | |
var pointy; | |
var thresh; |
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
var maxIterations; | |
var maxVal; | |
var height; | |
var width; | |
function preload() { | |
maxIterations = 200; | |
maxVal = 50; |
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
int tt = 10, it = 1; | |
double total = 0.; | |
cout << "primality test using primality_miller_rabin_probabilistic(int64_t)" << endl; | |
cout << "Miller Rabin iteration count = " << it << endl; | |
cout << "L : " << L << " R : " << R << endl; | |
for(int k = 0, c = 0, t = clock(); k < tt; k++, c = 0, t = clock()) { | |
for(int i = L; i <= R; i++) | |
c += primality_miller_rabin_probabilistic(i, it); | |
double time = (clock() - t) / (CLOCKS_PER_SEC + 0.); | |
total += time; |
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
primality test using primality_miller_rabin(int64_t) | |
L = 100000000 : R = 100100000 | |
test 1 duration : 0.861 s | |
test 2 duration : 0.853 s | |
test 3 duration : 0.856 s | |
test 4 duration : 0.844 s | |
test 5 duration : 0.84 s | |
test 6 duration : 0.835 s | |
test 7 duration : 0.839 s | |
test 8 duration : 0.839 s |
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
primality test using primality_sqrt_bound_coprime_30(int64_t) | |
L = 100000000 : R = 100100000 | |
test 1 duration : 0.281 s | |
test 2 duration : 0.225 s | |
test 3 duration : 0.222 s | |
test 4 duration : 0.227 s | |
test 5 duration : 0.226 s | |
test 6 duration : 0.223 s | |
test 7 duration : 0.223 s | |
test 8 duration : 0.225 s |
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
primality test using primality_sqrt_bound_coprime_6(int64_t) | |
L = 100000000 : R = 100100000 | |
test 1 duration : 0.278 s | |
test 2 duration : 0.269 s | |
test 3 duration : 0.283 s | |
test 4 duration : 0.258 s | |
test 5 duration : 0.263 s | |
test 6 duration : 0.272 s | |
test 7 duration : 0.262 s | |
test 8 duration : 0.265 s |
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
primality test using primality_sqrt_bound_coprime_2(int64_t) | |
L = 100000000 : R = 100100000 | |
test 1 duration : 0.418 s | |
test 2 duration : 0.393 s | |
test 3 duration : 0.397 s | |
test 4 duration : 0.406 s | |
test 5 duration : 0.379 s | |
test 6 duration : 0.381 s | |
test 7 duration : 0.383 s | |
test 8 duration : 0.383 s |
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
primality test using primality_sqrt_bound(int64_t) | |
L = 100000000 : R = 100100000 | |
test 1 duration : 0.761 s | |
test 2 duration : 0.762 s | |
test 3 duration : 0.764 s | |
test 4 duration : 0.771 s | |
test 5 duration : 0.741 s | |
test 6 duration : 0.741 s | |
test 7 duration : 0.769 s | |
test 8 duration : 0.744 s |
NewerOlder