better cython compiler directives for choleskies

This commit is contained in:
James Hensman 2015-04-30 13:47:38 +01:00
parent e9ff315a19
commit 3c3af7f3fe
3 changed files with 211 additions and 625 deletions

View file

@ -1,7 +1,8 @@
#cython: wraparaound=False
#cython: boundscheck=False
#cython: nonecheck=False
# Copyright James Hensman and Alan Saul 2015
#cython: wraparaound(False)
#cython: boundscheck(False)
#cython: nonecheck(False)
import numpy as np
cimport numpy as np
@ -17,6 +18,7 @@ def flat_to_triang(np.ndarray[double, ndim=2] flat, int M):
cdef int D = flat.shape[1]
cdef int count = 0
cdef np.ndarray[double, ndim=3] ret = np.zeros((M, M, D))
cdef int d, m, mm
for d in range(D):
count = 0
for m in range(M):
@ -31,6 +33,7 @@ def triang_to_flat(np.ndarray[double, ndim=3] L):
cdef int N = M*(M+1)/2
cdef int count = 0
cdef np.ndarray[double, ndim=2] flat = np.empty((N, D))
cdef int d, m, mm
for d in range(D):
count = 0
for m in range(M):