{{ message }}

Instantly share code, notes, and snippets.

# DavidButts

Created Jan 26, 2018
View Julia-Numpy-Numba.py
 import time import numpy as np from numba import jit x_dim = 1000 y_dim = 1000 x_min = -1.8 x_max = 1.8 y_min = -1.8j y_max = 1.8j
Created Jan 26, 2018
View Julia-Python-Numba.py
 import time import numpy as np from numba import njit, prange x_dim = 1000 y_dim = 1000 x_min = -1.8 x_max = 1.8 y_min = -1.8j y_max = 1.8j
Created Jan 26, 2018
View Julia-Numpy.py
 import time #timing import numpy as np #arrays import numba as nb #speed x_dim = 1000 y_dim = 1000 x_min = -1.8 x_max = 1.8 y_min = -1.8j y_max = 1.8j
Created Jan 26, 2018
View Julia-Python.py
 import time #timing import numpy as np #arrays import numba as nb #speed x_dim = 1000 y_dim = 1000 x_min = -1.8 x_max = 1.8 y_min = -1.8j y_max = 1.8j
Last active Jan 13, 2018
View C++David-Timing.cpp
 //Written by David Butts #include #include #include #include int next_val(const vector &v){ if (v == vector{0,0,0}) return 0; else if (v == vector{0,0,1}) return 0;
Last active Jan 13, 2018
View C++Bill-Timing.cpp
 //Written by Bill Punch #include using std::cout; using std::endl; using std::boolalpha; #include #include #include using std::bitset; int main() { const size_t sz = 100000;
Last active Jan 13, 2018
View Numba-Timing.py
 #Written by David Butts #This code is an implementation of a Rule 30 Wolfram model written in Python. import numpy as np import time import numba @nb.jit #numba the function def Rule30_code(): Rule30 = np.zeros((1000,100000)) #initilize an array to run on (timesteps, width) Rule30[0,50] = 1 for y in range(Rule30.shape[0]-1): #iterate through grid
Last active Jan 13, 2018
View Python-Timing.py
 #Written by David Butts #This code is an implementation of a Rule 30 Wolfram model written in Python. import numpy as np import time def Rule30_code(): Rule30 = np.zeros((1000,100000)) #initilize an array to run on (timesteps, width) Rule30[0,50] = 1 for y in range(Rule30.shape[0]-1): #iterate through grid for x in range(Rule30.shape[1]): #update the next rows values according to neighbor & self value