mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-02 00:02:38 +02:00
better cython compiler directives for choleskies
This commit is contained in:
parent
e9ff315a19
commit
3c3af7f3fe
3 changed files with 211 additions and 625 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue