2018-01-29 15:14:50 +00:00
|
|
|
|
|
|
|
import numpy as np
|
|
|
|
cimport numpy as np
|
|
|
|
from libcpp cimport bool
|
|
|
|
|
|
|
|
DEF ASCEE_FLOAT = "@ASCEE_FLOAT@"
|
|
|
|
|
|
|
|
IF ASCEE_FLOAT == "double":
|
|
|
|
ctypedef double d
|
|
|
|
ctypedef double complex c
|
|
|
|
NUMPY_FLOAT_TYPE = np.float64
|
|
|
|
NUMPY_COMPLEX_TYPE = np.complex128
|
|
|
|
ELSE:
|
|
|
|
ctypedef float d
|
|
|
|
ctypedef float complex c
|
|
|
|
NUMPY_FLOAT_TYPE = np.float32
|
|
|
|
NUMPY_COMPLEX_TYPE = np.complex128
|
|
|
|
|
|
|
|
ctypedef size_t us
|
|
|
|
|
2018-02-06 11:01:27 +00:00
|
|
|
cdef extern from "ascee_tracer.h":
|
|
|
|
void setTracerLevel(int)
|
|
|
|
|
|
|
|
cdef extern from "ascee_math.h":
|
2018-01-29 15:14:50 +00:00
|
|
|
ctypedef struct dmat:
|
|
|
|
d* data
|
2018-02-06 11:01:27 +00:00
|
|
|
d** col_ptrs
|
2018-01-29 15:14:50 +00:00
|
|
|
us n_cols,n_rows
|
|
|
|
ctypedef struct cmat:
|
|
|
|
c* data
|
2018-02-06 11:01:27 +00:00
|
|
|
c** col_ptrs
|
2018-01-29 15:14:50 +00:00
|
|
|
us n_cols,n_rows
|
|
|
|
|
2018-02-06 11:01:27 +00:00
|
|
|
dmat dmat_foreign(us n_rows,
|
|
|
|
us n_cols,
|
|
|
|
d* data)
|
|
|
|
cmat cmat_foreign(us n_rows,
|
|
|
|
us n_cols,
|
|
|
|
c* data)
|
|
|
|
|
2018-02-09 10:56:49 +00:00
|
|
|
cmat cmat_alloc(us n_rows,us n_cols)
|
|
|
|
dmat dmat_alloc(us n_rows,us n_cols)
|
|
|
|
|
2018-02-06 11:01:27 +00:00
|
|
|
void dmat_free(dmat*)
|
|
|
|
void cmat_free(cmat*)
|
|
|
|
void cmat_copy(cmat* to,cmat* from_)
|
2018-02-09 10:56:49 +00:00
|
|
|
|
|
|
|
cdef extern from "ascee_tracer.h":
|
|
|
|
void clearScreen()
|