Skip to content

Instantly share code, notes, and snippets.

View ofgulban's full-sized avatar

Omer Faruk Gulban ofgulban

View GitHub Profile
import numpy as np
cimport numpy as np
cimport cython
@cython.boundscheck(False)
@cython.wraparound(False)
cpdef cython_lstsqr(x_ary, y_ary):
""" Computes the least-squares solution to a linear matrix equation. """
cdef double x_avg, y_avg, var_x, cov_xy,\
slope, y_interc