This file contains hidden or 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
/* DO NOT EDIT THIS FILE, IT IS GENERATED */ | |
/*!*/ | |
/*!*/ | |
/*!*/ | |
/*!*/ | |
/*!*/ | |
/*!*/ | |
/*!*/ #include <stdio.h> | |
/*!*/ #include <string.h> | |
/*!*/ |
This file contains hidden or 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
from __future__ import division | |
import numpy as np | |
import sys | |
def simulate(nitems, nslots, nsims=100): | |
k = int(np.log2(nslots)) | |
assert 2**k == nslots | |
success_count = 0 | |
for isim in range(nsims): | |
hashes = np.random.randint(2**32, size=nitems).astype(np.uint64) |
This file contains hidden or 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
cdef extern from *: | |
void* malloc(long) | |
void free(void*) | |
double sin(double) | |
from random import randint | |
from time import clock | |
cdef extern from "time.h": | |
cdef struct timespec: |
This file contains hidden or 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
An IPython notebook running on Amazon EC2: | |
http://ec2-54-247-153-111.eu-west-1.compute.amazonaws.com:8888/ | |
Where to find help: | |
- numpy-discussion: http://www.scipy.org/Mailing_Lists | |
- cython-users: https://groups.google.com/forum/?fromgroups#!forum/cython-users | |
- http://scicomp.stackexchange.com | |
- http://stackoverflow.com/ |
This file contains hidden or 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
PyHeapExtensibleTypeObject MyProvider_Type = | |
{ | |
/* PyHeapTypeObject etp_heaptype */ | |
{ | |
/* PyTypeObject ht_type */ | |
{ | |
PyVarObject_HEAD_INIT(0, 0), | |
"myprovidertype", /*tp_name*/, | |
sizeof(MyProvider_Object), /* tp_basicsize */ | |
0, /* tp_itemsize */ |
This file contains hidden or 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
from __future__ import division | |
import numpy as np | |
import os | |
import commander as cm | |
# | |
# Parameters (just variables that are reused further down)\ | |
# | |
output_filename = 'sync-dust-priors-%d.h5' % os.getpid() |
This file contains hidden or 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
from __future__ import division | |
import numpy as np | |
import os | |
import commander as cm | |
# | |
# Parameters (just variables that are reused further down)\ | |
# | |
output_filename = 'newmonodip-em7-%d.h5' % os.getpid() |
This file contains hidden or 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
from __future__ import division | |
import numpy as np | |
from matplotlib import pyplot as plt | |
import cPickle as pickle | |
import scipy.linalg as la | |
import scipy | |
from commander.sphere.mmajor import lm_to_idx | |
nside = 16 |
This file contains hidden or 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
!/bin/sh | |
# start multi-line shebang | |
if "true" : '''\'; then | |
p=`pwd`; f="$0"; b=`basename $f` | |
while [ -L "$f" ]; do | |
f=`readlink $f`; cd `dirname $f`; f=`basename $f` | |
done | |
f=`pwd -P` | |
cd "$f/../../../../usr/bin" | |
i=`pwd -P` |
This file contains hidden or 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
from numpy import * | |
from scipy.linalg import eig, eigh | |
N = 100 | |
M = 40 | |
noise = 0.01 | |
i = arange(M, dtype=float) | |
cinv = 1 + i**2 |
OlderNewer