Skip to content

Commit

Permalink
Refactored lapack wrappers so they are embedded in a Python module as
Browse files Browse the repository at this point in the history
well.
  • Loading branch information
insertinterestingnamehere committed Sep 12, 2014
1 parent 8108cb6 commit a2ca37f
Show file tree
Hide file tree
Showing 3 changed files with 187 additions and 173 deletions.
174 changes: 1 addition & 173 deletions scipy_lapack.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ ctypedef int zungqr_t(int *m, int *n, int *k, z *a, int *lda, z *tau, z *work, i
ctypedef int zungrq_t(int *m, int *n, int *k, z *a, int *lda, z *tau, z *work, int *lwork, int *info) nogil
ctypedef int zunmqr_t(char *side, char *trans, int *m, int *n, int *k, z *a, int *lda, z *tau, z *c, int *ldc, z *work, int *lwork, int *info) nogil

cdef struct lapack_t:
cdef:
cgbsv_t *cgbsv
cgbtrf_t *cgbtrf
cgbtrs_t *cgbtrs
Expand Down Expand Up @@ -344,175 +344,3 @@ cdef struct lapack_t:
zungqr_t *zungqr
zungrq_t *zungrq
zunmqr_t *zunmqr

cdef inline lapack_t getlapack(object lapack_module):
cdef lapack_t lapack
lapack.cgbsv = <cgbsv_t*>f2py_ptr(lapack_module.cgbsv._cpointer)
lapack.cgbtrf = <cgbtrf_t*>f2py_ptr(lapack_module.cgbtrf._cpointer)
lapack.cgbtrs = <cgbtrs_t*>f2py_ptr(lapack_module.cgbtrs._cpointer)
lapack.cgebal = <cgebal_t*>f2py_ptr(lapack_module.cgebal._cpointer)
# lapack.cgees = <cgees_t*>f2py_ptr(lapack_module.cgees._cpointer)
lapack.cgeev = <cgeev_t*>f2py_ptr(lapack_module.cgeev._cpointer)
lapack.cgegv = <cgegv_t*>f2py_ptr(lapack_module.cgegv._cpointer)
lapack.cgehrd = <cgehrd_t*>f2py_ptr(lapack_module.cgehrd._cpointer)
lapack.cgelss = <cgelss_t*>f2py_ptr(lapack_module.cgelss._cpointer)
lapack.cgeqp3 = <cgeqp3_t*>f2py_ptr(lapack_module.cgeqp3._cpointer)
lapack.cgeqrf = <cgeqrf_t*>f2py_ptr(lapack_module.cgeqrf._cpointer)
lapack.cgerqf = <cgerqf_t*>f2py_ptr(lapack_module.cgerqf._cpointer)
lapack.cgesdd = <cgesdd_t*>f2py_ptr(lapack_module.cgesdd._cpointer)
lapack.cgesv = <cgesv_t*>f2py_ptr(lapack_module.cgesv._cpointer)
lapack.cgetrf = <cgetrf_t*>f2py_ptr(lapack_module.cgetrf._cpointer)
lapack.cgetri = <cgetri_t*>f2py_ptr(lapack_module.cgetri._cpointer)
lapack.cgetrs = <cgetrs_t*>f2py_ptr(lapack_module.cgetrs._cpointer)
# lapack.cgges = <cgges_t*>f2py_ptr(lapack_module.cgges._cpointer)
lapack.cggev = <cggev_t*>f2py_ptr(lapack_module.cggev._cpointer)
lapack.chbevd = <chbevd_t*>f2py_ptr(lapack_module.chbevd._cpointer)
lapack.chbevx = <chbevx_t*>f2py_ptr(lapack_module.chbevx._cpointer)
lapack.cheev = <cheev_t*>f2py_ptr(lapack_module.cheev._cpointer)
lapack.cheevd = <cheevd_t*>f2py_ptr(lapack_module.cheevd._cpointer)
lapack.cheevr = <cheevr_t*>f2py_ptr(lapack_module.cheevr._cpointer)
lapack.chegv = <chegv_t*>f2py_ptr(lapack_module.chegv._cpointer)
lapack.chegvd = <chegvd_t*>f2py_ptr(lapack_module.chegvd._cpointer)
lapack.chegvx = <chegvx_t*>f2py_ptr(lapack_module.chegvx._cpointer)
lapack.claswp = <claswp_t*>f2py_ptr(lapack_module.claswp._cpointer)
lapack.clauum = <clauum_t*>f2py_ptr(lapack_module.clauum._cpointer)
lapack.cpbsv = <cpbsv_t*>f2py_ptr(lapack_module.cpbsv._cpointer)
lapack.cpbtrf = <cpbtrf_t*>f2py_ptr(lapack_module.cpbtrf._cpointer)
lapack.cpbtrs = <cpbtrs_t*>f2py_ptr(lapack_module.cpbtrs._cpointer)
lapack.cposv = <cposv_t*>f2py_ptr(lapack_module.cposv._cpointer)
lapack.cpotrf = <cpotrf_t*>f2py_ptr(lapack_module.cpotrf._cpointer)
lapack.cpotri = <cpotri_t*>f2py_ptr(lapack_module.cpotri._cpointer)
lapack.cpotrs = <cpotrs_t*>f2py_ptr(lapack_module.cpotrs._cpointer)
lapack.ctrsyl = <ctrsyl_t*>f2py_ptr(lapack_module.ctrsyl._cpointer)
lapack.ctrtri = <ctrtri_t*>f2py_ptr(lapack_module.ctrtri._cpointer)
lapack.ctrtrs = <ctrtrs_t*>f2py_ptr(lapack_module.ctrtrs._cpointer)
lapack.cungqr = <cungqr_t*>f2py_ptr(lapack_module.cungqr._cpointer)
lapack.cungrq = <cungrq_t*>f2py_ptr(lapack_module.cungrq._cpointer)
lapack.cunmqr = <cunmqr_t*>f2py_ptr(lapack_module.cunmqr._cpointer)
lapack.dgbsv = <dgbsv_t*>f2py_ptr(lapack_module.dgbsv._cpointer)
lapack.dgbtrf = <dgbtrf_t*>f2py_ptr(lapack_module.dgbtrf._cpointer)
lapack.dgbtrs = <dgbtrs_t*>f2py_ptr(lapack_module.dgbtrs._cpointer)
lapack.dgebal = <dgebal_t*>f2py_ptr(lapack_module.dgebal._cpointer)
# lapack.dgees = <dgees_t*>f2py_ptr(lapack_module.dgees._cpointer)
lapack.dgeev = <dgeev_t*>f2py_ptr(lapack_module.dgeev._cpointer)
lapack.dgegv = <dgegv_t*>f2py_ptr(lapack_module.dgegv._cpointer)
lapack.dgehrd = <dgehrd_t*>f2py_ptr(lapack_module.dgehrd._cpointer)
lapack.dgelss = <dgelss_t*>f2py_ptr(lapack_module.dgelss._cpointer)
lapack.dgeqp3 = <dgeqp3_t*>f2py_ptr(lapack_module.dgeqp3._cpointer)
lapack.dgeqrf = <dgeqrf_t*>f2py_ptr(lapack_module.dgeqrf._cpointer)
lapack.dgerqf = <dgerqf_t*>f2py_ptr(lapack_module.dgerqf._cpointer)
lapack.dgesdd = <dgesdd_t*>f2py_ptr(lapack_module.dgesdd._cpointer)
lapack.dgesv = <dgesv_t*>f2py_ptr(lapack_module.dgesv._cpointer)
lapack.dgetrf = <dgetrf_t*>f2py_ptr(lapack_module.dgetrf._cpointer)
lapack.dgetri = <dgetri_t*>f2py_ptr(lapack_module.dgetri._cpointer)
lapack.dgetrs = <dgetrs_t*>f2py_ptr(lapack_module.dgetrs._cpointer)
# lapack.dgges = <dgges_t*>f2py_ptr(lapack_module.dgges._cpointer)
lapack.dggev = <dggev_t*>f2py_ptr(lapack_module.dggev._cpointer)
lapack.dhbevd = <dhbevd_t*>f2py_ptr(lapack_module.dhbevd._cpointer)
lapack.dhbevx = <dhbevx_t*>f2py_ptr(lapack_module.dhbevx._cpointer)
lapack.dheev = <dheev_t*>f2py_ptr(lapack_module.dheev._cpointer)
lapack.dheevd = <dheevd_t*>f2py_ptr(lapack_module.dheevd._cpointer)
lapack.dheevr = <dheevr_t*>f2py_ptr(lapack_module.dheevr._cpointer)
lapack.dhegv = <dhegv_t*>f2py_ptr(lapack_module.dhegv._cpointer)
lapack.dhegvd = <dhegvd_t*>f2py_ptr(lapack_module.dhegvd._cpointer)
lapack.dhegvx = <dhegvx_t*>f2py_ptr(lapack_module.dhegvx._cpointer)
lapack.dlaswp = <dlaswp_t*>f2py_ptr(lapack_module.dlaswp._cpointer)
lapack.dlauum = <dlauum_t*>f2py_ptr(lapack_module.dlauum._cpointer)
lapack.dpbsv = <dpbsv_t*>f2py_ptr(lapack_module.dpbsv._cpointer)
lapack.dpbtrf = <dpbtrf_t*>f2py_ptr(lapack_module.dpbtrf._cpointer)
lapack.dpbtrs = <dpbtrs_t*>f2py_ptr(lapack_module.dpbtrs._cpointer)
lapack.dposv = <dposv_t*>f2py_ptr(lapack_module.dposv._cpointer)
lapack.dpotrf = <dpotrf_t*>f2py_ptr(lapack_module.dpotrf._cpointer)
lapack.dpotri = <dpotri_t*>f2py_ptr(lapack_module.dpotri._cpointer)
lapack.dpotrs = <dpotrs_t*>f2py_ptr(lapack_module.dpotrs._cpointer)
lapack.dtrsyl = <dtrsyl_t*>f2py_ptr(lapack_module.dtrsyl._cpointer)
lapack.dtrtri = <dtrtri_t*>f2py_ptr(lapack_module.dtrtri._cpointer)
lapack.dtrtrs = <dtrtrs_t*>f2py_ptr(lapack_module.dtrtrs._cpointer)
lapack.dungqr = <dungqr_t*>f2py_ptr(lapack_module.dungqr._cpointer)
lapack.dungrq = <dungrq_t*>f2py_ptr(lapack_module.dungrq._cpointer)
lapack.dunmqr = <dunmqr_t*>f2py_ptr(lapack_module.dunmqr._cpointer)
lapack.sgbsv = <sgbsv_t*>f2py_ptr(lapack_module.sgbsv._cpointer)
lapack.sgbtrf = <sgbtrf_t*>f2py_ptr(lapack_module.sgbtrf._cpointer)
lapack.sgbtrs = <sgbtrs_t*>f2py_ptr(lapack_module.sgbtrs._cpointer)
lapack.sgebal = <sgebal_t*>f2py_ptr(lapack_module.sgebal._cpointer)
# lapack.sgees = <sgees_t*>f2py_ptr(lapack_module.sgees._cpointer)
lapack.sgeev = <sgeev_t*>f2py_ptr(lapack_module.sgeev._cpointer)
lapack.sgegv = <sgegv_t*>f2py_ptr(lapack_module.sgegv._cpointer)
lapack.sgehrd = <sgehrd_t*>f2py_ptr(lapack_module.sgehrd._cpointer)
lapack.sgelss = <sgelss_t*>f2py_ptr(lapack_module.sgelss._cpointer)
lapack.sgeqp3 = <sgeqp3_t*>f2py_ptr(lapack_module.sgeqp3._cpointer)
lapack.sgeqrf = <sgeqrf_t*>f2py_ptr(lapack_module.sgeqrf._cpointer)
lapack.sgerqf = <sgerqf_t*>f2py_ptr(lapack_module.sgerqf._cpointer)
lapack.sgesdd = <sgesdd_t*>f2py_ptr(lapack_module.sgesdd._cpointer)
lapack.sgesv = <sgesv_t*>f2py_ptr(lapack_module.sgesv._cpointer)
lapack.sgetrf = <sgetrf_t*>f2py_ptr(lapack_module.sgetrf._cpointer)
lapack.sgetri = <sgetri_t*>f2py_ptr(lapack_module.sgetri._cpointer)
lapack.sgetrs = <sgetrs_t*>f2py_ptr(lapack_module.sgetrs._cpointer)
# lapack.sgges = <sgges_t*>f2py_ptr(lapack_module.sgges._cpointer)
lapack.sggev = <sggev_t*>f2py_ptr(lapack_module.sggev._cpointer)
lapack.shbevd = <shbevd_t*>f2py_ptr(lapack_module.shbevd._cpointer)
lapack.shbevx = <shbevx_t*>f2py_ptr(lapack_module.shbevx._cpointer)
lapack.sheev = <sheev_t*>f2py_ptr(lapack_module.sheev._cpointer)
lapack.sheevd = <sheevd_t*>f2py_ptr(lapack_module.sheevd._cpointer)
lapack.sheevr = <sheevr_t*>f2py_ptr(lapack_module.sheevr._cpointer)
lapack.shegv = <shegv_t*>f2py_ptr(lapack_module.shegv._cpointer)
lapack.shegvd = <shegvd_t*>f2py_ptr(lapack_module.shegvd._cpointer)
lapack.shegvx = <shegvx_t*>f2py_ptr(lapack_module.shegvx._cpointer)
lapack.slaswp = <slaswp_t*>f2py_ptr(lapack_module.slaswp._cpointer)
lapack.slauum = <slauum_t*>f2py_ptr(lapack_module.slauum._cpointer)
lapack.spbsv = <spbsv_t*>f2py_ptr(lapack_module.spbsv._cpointer)
lapack.spbtrf = <spbtrf_t*>f2py_ptr(lapack_module.spbtrf._cpointer)
lapack.spbtrs = <spbtrs_t*>f2py_ptr(lapack_module.spbtrs._cpointer)
lapack.sposv = <sposv_t*>f2py_ptr(lapack_module.sposv._cpointer)
lapack.spotrf = <spotrf_t*>f2py_ptr(lapack_module.spotrf._cpointer)
lapack.spotri = <spotri_t*>f2py_ptr(lapack_module.spotri._cpointer)
lapack.spotrs = <spotrs_t*>f2py_ptr(lapack_module.spotrs._cpointer)
lapack.strsyl = <strsyl_t*>f2py_ptr(lapack_module.strsyl._cpointer)
lapack.strtri = <strtri_t*>f2py_ptr(lapack_module.strtri._cpointer)
lapack.strtrs = <strtrs_t*>f2py_ptr(lapack_module.strtrs._cpointer)
lapack.sungqr = <sungqr_t*>f2py_ptr(lapack_module.sungqr._cpointer)
lapack.sungrq = <sungrq_t*>f2py_ptr(lapack_module.sungrq._cpointer)
lapack.sunmqr = <sunmqr_t*>f2py_ptr(lapack_module.sunmqr._cpointer)
lapack.zgbsv = <zgbsv_t*>f2py_ptr(lapack_module.zgbsv._cpointer)
lapack.zgbtrf = <zgbtrf_t*>f2py_ptr(lapack_module.zgbtrf._cpointer)
lapack.zgbtrs = <zgbtrs_t*>f2py_ptr(lapack_module.zgbtrs._cpointer)
lapack.zgebal = <zgebal_t*>f2py_ptr(lapack_module.zgebal._cpointer)
# lapack.zgees = <zgees_t*>f2py_ptr(lapack_module.zgees._cpointer)
lapack.zgeev = <zgeev_t*>f2py_ptr(lapack_module.zgeev._cpointer)
lapack.zgegv = <zgegv_t*>f2py_ptr(lapack_module.zgegv._cpointer)
lapack.zgehrd = <zgehrd_t*>f2py_ptr(lapack_module.zgehrd._cpointer)
lapack.zgelss = <zgelss_t*>f2py_ptr(lapack_module.zgelss._cpointer)
lapack.zgeqp3 = <zgeqp3_t*>f2py_ptr(lapack_module.zgeqp3._cpointer)
lapack.zgeqrf = <zgeqrf_t*>f2py_ptr(lapack_module.zgeqrf._cpointer)
lapack.zgerqf = <zgerqf_t*>f2py_ptr(lapack_module.zgerqf._cpointer)
lapack.zgesdd = <zgesdd_t*>f2py_ptr(lapack_module.zgesdd._cpointer)
lapack.zgesv = <zgesv_t*>f2py_ptr(lapack_module.zgesv._cpointer)
lapack.zgetrf = <zgetrf_t*>f2py_ptr(lapack_module.zgetrf._cpointer)
lapack.zgetri = <zgetri_t*>f2py_ptr(lapack_module.zgetri._cpointer)
lapack.zgetrs = <zgetrs_t*>f2py_ptr(lapack_module.zgetrs._cpointer)
# lapack.zgges = <zgges_t*>f2py_ptr(lapack_module.zgges._cpointer)
lapack.zggev = <zggev_t*>f2py_ptr(lapack_module.zggev._cpointer)
lapack.zhbevd = <zhbevd_t*>f2py_ptr(lapack_module.zhbevd._cpointer)
lapack.zhbevx = <zhbevx_t*>f2py_ptr(lapack_module.zhbevx._cpointer)
lapack.zheev = <zheev_t*>f2py_ptr(lapack_module.zheev._cpointer)
lapack.zheevd = <zheevd_t*>f2py_ptr(lapack_module.zheevd._cpointer)
lapack.zheevr = <zheevr_t*>f2py_ptr(lapack_module.zheevr._cpointer)
lapack.zhegv = <zhegv_t*>f2py_ptr(lapack_module.zhegv._cpointer)
lapack.zhegvd = <zhegvd_t*>f2py_ptr(lapack_module.zhegvd._cpointer)
lapack.zhegvx = <zhegvx_t*>f2py_ptr(lapack_module.zhegvx._cpointer)
lapack.zlaswp = <zlaswp_t*>f2py_ptr(lapack_module.zlaswp._cpointer)
lapack.zlauum = <zlauum_t*>f2py_ptr(lapack_module.zlauum._cpointer)
lapack.zpbsv = <zpbsv_t*>f2py_ptr(lapack_module.zpbsv._cpointer)
lapack.zpbtrf = <zpbtrf_t*>f2py_ptr(lapack_module.zpbtrf._cpointer)
lapack.zpbtrs = <zpbtrs_t*>f2py_ptr(lapack_module.zpbtrs._cpointer)
lapack.zposv = <zposv_t*>f2py_ptr(lapack_module.zposv._cpointer)
lapack.zpotrf = <zpotrf_t*>f2py_ptr(lapack_module.zpotrf._cpointer)
lapack.zpotri = <zpotri_t*>f2py_ptr(lapack_module.zpotri._cpointer)
lapack.zpotrs = <zpotrs_t*>f2py_ptr(lapack_module.zpotrs._cpointer)
lapack.ztrsyl = <ztrsyl_t*>f2py_ptr(lapack_module.ztrsyl._cpointer)
lapack.ztrtri = <ztrtri_t*>f2py_ptr(lapack_module.ztrtri._cpointer)
lapack.ztrtrs = <ztrtrs_t*>f2py_ptr(lapack_module.ztrtrs._cpointer)
lapack.zungqr = <zungqr_t*>f2py_ptr(lapack_module.zungqr._cpointer)
lapack.zungrq = <zungrq_t*>f2py_ptr(lapack_module.zungrq._cpointer)
lapack.zunmqr = <zunmqr_t*>f2py_ptr(lapack_module.zunmqr._cpointer)
return lapack
Loading

0 comments on commit a2ca37f

Please sign in to comment.