removed numpy_defs.h, scipy_defs.h

This commit is contained in:
Zoltán Vörös 2020-11-25 21:03:35 +01:00
parent c7f47819e0
commit b35c1568f3
20 changed files with 166 additions and 219 deletions

View file

@ -17,8 +17,7 @@
#include "py/runtime.h"
#include "py/misc.h"
#include "../numpy_defs.h"
#include "../scipy_defs.h"
#include "../ulab.h"
#include "../ulab_tools.h"
#include "approx.h"

View file

@ -17,7 +17,7 @@
#include "py/runtime.h"
#include "py/misc.h"
#include "../numpy_defs.h"
#include "../ulab.h"
#include "compare.h"
//| """Comparison functions"""

View file

@ -19,8 +19,7 @@
#include "py/runtime.h"
#include "py/misc.h"
#include "../numpy_defs.h"
#include "../scipy_defs.h"
#include "../ulab.h"
#include "filter.h"
#if ULAB_NUMPY_HAS_CONVOLVE
@ -110,11 +109,11 @@ MP_DEFINE_CONST_FUN_OBJ_KW(filter_convolve_obj, 2, filter_convolve);
#if !ULAB_NUMPY_COMPATIBILITY
STATIC const mp_rom_map_elem_t ulab_filter_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_filter) },
#if ULAB_FILTER_HAS_CONVOLVE
#if ULAB_NUMPY_HAS_CONVOLVE
{ MP_OBJ_NEW_QSTR(MP_QSTR_convolve), (mp_obj_t)&filter_convolve_obj },
#endif
#if ULAB_FILTER_HAS_SOSFILT
{ MP_OBJ_NEW_QSTR(MP_QSTR_sosfilt), (mp_obj_t)&filter_sosfilt_obj },
#if ULAB_SCIPY_SIGNAL_HAS_SOSFILT
{ MP_OBJ_NEW_QSTR(MP_QSTR_sosfilt), (mp_obj_t)&signal_sosfilt_obj },
#endif
};

View file

@ -20,7 +20,7 @@
#include "py/runtime.h"
#include "py/misc.h"
#include "../numpy.h"
#include "../ulab.h"
#include "../ulab_tools.h"
#include "linalg.h"

View file

@ -1937,7 +1937,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(ndarray_reshape_obj, ndarray_reshape);
#endif /* NDARRAY_HAS_RESHAPE */
#endif /* ULAB_MAX_DIMS > 1 */
#if ULAB_HAS_NDINFO
#if ULAB_NUMPY_HAS_NDINFO
mp_obj_t ndarray_info(mp_obj_t obj_in) {
ndarray_obj_t *ndarray = MP_OBJ_TO_PTR(obj_in);
if(!MP_OBJ_IS_TYPE(ndarray, &ulab_ndarray_type)) {

View file

@ -185,7 +185,7 @@ mp_obj_t ndarray_transpose(mp_obj_t );
MP_DECLARE_CONST_FUN_OBJ_1(ndarray_transpose_obj);
#endif
#if ULAB_HAS_NDINFO
#if ULAB_NUMPY_HAS_NDINFO
mp_obj_t ndarray_info(mp_obj_t );
MP_DECLARE_CONST_FUN_OBJ_1(ndarray_info_obj);
#endif

View file

@ -20,7 +20,7 @@
#include "py/builtin.h"
#include "py/misc.h"
#include "../numpy_defs.h"
#include "../ulab.h"
#include "../ulab_tools.h"
#include "numerical.h"

View file

@ -27,19 +27,19 @@
#include "vector/vectorise.h"
// math constants
#if ULAB_HAS_E
#if ULAB_NUMPY_HAS_E
mp_obj_float_t ulab_const_float_e_obj = {{&mp_type_float}, MP_E};
#endif
#if ULAB_HAS_INF
#if ULAB_NUMPY_HAS_INF
mp_obj_float_t numpy_const_float_inf_obj = {{&mp_type_float}, INFINITY};
#endif
#if ULAB_HAS_NAN
#if ULAB_NUMPY_HAS_NAN
mp_obj_float_t numpy_const_float_nan_obj = {{&mp_type_float}, NAN};
#endif
#if ULAB_HAS_PI
#if ULAB_NUMPY_HAS_PI
mp_obj_float_t ulab_const_float_pi_obj = {{&mp_type_float}, MP_PI};
#endif
@ -47,16 +47,16 @@ static const mp_rom_map_elem_t ulab_numpy_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_numpy) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_array), (mp_obj_t)&ulab_ndarray_type },
// math constants
#if ULAB_HAS_E
#if ULAB_NUMPY_HAS_E
{ MP_ROM_QSTR(MP_QSTR_e), MP_ROM_PTR(&ulab_const_float_e_obj) },
#endif
#if ULAB_HAS_INF
#if ULAB_NUMPY_HAS_INF
{ MP_ROM_QSTR(MP_QSTR_inf), MP_ROM_PTR(&numpy_const_float_inf_obj) },
#endif
#if ULAB_HAS_NAN
#if ULAB_NUMPY_HAS_NAN
{ MP_ROM_QSTR(MP_QSTR_nan), MP_ROM_PTR(&numpy_const_float_nan_obj) },
#endif
#if ULAB_HAS_PI
#if ULAB_NUMPY_HAS_PI
{ MP_ROM_QSTR(MP_QSTR_pi), MP_ROM_PTR(&ulab_const_float_pi_obj) },
#endif
// class constants, always included
@ -77,7 +77,7 @@ static const mp_rom_map_elem_t ulab_numpy_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_set_printoptions), (mp_obj_t)&ndarray_set_printoptions_obj },
{ MP_ROM_QSTR(MP_QSTR_get_printoptions), (mp_obj_t)&ndarray_get_printoptions_obj },
#endif
#if ULAB_HAS_NDINFO
#if ULAB_NUMPY_HAS_NDINFO
{ MP_ROM_QSTR(MP_QSTR_ndinfo), (mp_obj_t)&ndarray_info_obj },
#endif
#if ULAB_NUMPY_HAS_ARANGE

View file

@ -15,7 +15,6 @@
#include "ulab.h"
#include "ndarray.h"
#include "numpy_defs.h"
extern mp_obj_module_t ulab_numpy_module;

View file

@ -1,130 +0,0 @@
/*
* This file is part of the micropython-ulab project,
*
* https://github.com/v923z/micropython-ulab
*
* The MIT License (MIT)
*
* Copyright (c) 2019-2020 Zoltán Vörös
*/
#ifndef __ULAB_NUMPY_DEFS__
#define __ULAB_NUMPY_DEFS__
// The pre-processor constants in this file determine which functions
// the numpy module has
// The default threshold for pretty printing. These variables can be overwritten
// at run-time via the set_printoptions() function
#define NDARRAY_PRINT_THRESHOLD 10
#define NDARRAY_PRINT_EDGEITEMS 3
// determines, whether e is defined in ulab.numpy itself
#define ULAB_HAS_E (1)
// ulab defines infinite as a class constant in ulab.numpy
#define ULAB_HAS_INF (1)
// ulab defines NaN as a class constant in ulab.numpy
#define ULAB_HAS_NAN (1)
// determines, whether pi is defined in ulab.numpy itself
#define ULAB_HAS_PI (1)
// determines, whether the ndinfo function is available
#define ULAB_HAS_NDINFO (1)
// determines, whether the dtype is an object, or simply a character
// the object implementation is numpythonic, but requires more space
#define ULAB_HAS_DTYPE_OBJECT (0)
// the ndarray binary operators
#define NDARRAY_HAS_BINARY_OPS (1)
// functions that create an array
#define ULAB_NUMPY_HAS_ARANGE (1)
#define ULAB_NUMPY_HAS_CONCATENATE (1)
#define ULAB_NUMPY_HAS_DIAG (1)
#define ULAB_NUMPY_HAS_EYE (1)
#define ULAB_NUMPY_HAS_FULL (1)
#define ULAB_NUMPY_HAS_LINSPACE (1)
#define ULAB_NUMPY_HAS_LOGSPACE (1)
#define ULAB_NUMPY_HAS_ONES (1)
#define ULAB_NUMPY_HAS_ZEROS (1)
// functions that compare arrays
#define ULAB_NUMPY_HAS_CLIP (1)
#define ULAB_NUMPY_HAS_EQUAL (1)
#define ULAB_NUMPY_HAS_NOTEQUAL (1)
#define ULAB_NUMPY_HAS_MAXIMUM (1)
#define ULAB_NUMPY_HAS_MINIMUM (1)
// the linalg module; functions of the linalg module still have
// to be defined separately
#ifndef ULAB_NUMPY_HAS_LINALG_MODULE
#define ULAB_NUMPY_HAS_LINALG_MODULE (1)
#define ULAB_LINALG_HAS_CHOLESKY (1)
#define ULAB_LINALG_HAS_DET (1)
#define ULAB_LINALG_HAS_DOT (1)
#define ULAB_LINALG_HAS_EIG (1)
#define ULAB_LINALG_HAS_INV (1)
#define ULAB_LINALG_HAS_NORM (1)
#define ULAB_LINALG_HAS_TRACE (1)
#endif
// the FFT module; functions of the fft module still have
// to be defined separately
#ifndef ULAB_NUMPY_HAS_FFT_MODULE
#define ULAB_NUMPY_HAS_FFT_MODULE (1)
#define ULAB_FFT_HAS_FFT (1)
#define ULAB_FFT_HAS_IFFT (1)
#endif
#define ULAB_NUMPY_HAS_ARGMINMAX (1)
#define ULAB_NUMPY_HAS_ARGSORT (1)
#define ULAB_NUMPY_HAS_CONVOLVE (1)
#define ULAB_NUMPY_HAS_CROSS (1)
#define ULAB_NUMPY_HAS_DIFF (1)
#define ULAB_NUMPY_HAS_FLIP (1)
#define ULAB_NUMPY_HAS_INTERP (1)
#define ULAB_NUMPY_HAS_MEAN (1)
#define ULAB_NUMPY_HAS_MEDIAN (1)
#define ULAB_NUMPY_HAS_MINMAX (1)
#define ULAB_NUMPY_HAS_POLYFIT (1)
#define ULAB_NUMPY_HAS_POLYVAL (1)
#define ULAB_NUMPY_HAS_ROLL (1)
#define ULAB_NUMPY_HAS_SORT (1)
#define ULAB_NUMPY_HAS_STD (1)
#define ULAB_NUMPY_HAS_SUM (1)
#define ULAB_NUMPY_HAS_TRAPZ (1)
// vectorised versions of the functions of the math python module, with
// the exception of the functions listed in scipy.special
#define ULAB_NUMPY_HAS_ACOS (1)
#define ULAB_NUMPY_HAS_ACOSH (1)
#define ULAB_NUMPY_HAS_ARCTAN2 (1)
#define ULAB_NUMPY_HAS_AROUND (1)
#define ULAB_NUMPY_HAS_ASIN (1)
#define ULAB_NUMPY_HAS_ASINH (1)
#define ULAB_NUMPY_HAS_ATAN (1)
#define ULAB_NUMPY_HAS_ATANH (1)
#define ULAB_NUMPY_HAS_CEIL (1)
#define ULAB_NUMPY_HAS_COS (1)
#define ULAB_NUMPY_HAS_COSH (1)
#define ULAB_NUMPY_HAS_DEGREES (1)
#define ULAB_NUMPY_HAS_EXP (1)
#define ULAB_NUMPY_HAS_EXPM1 (1)
#define ULAB_NUMPY_HAS_FLOOR (1)
#define ULAB_NUMPY_HAS_LOG (1)
#define ULAB_NUMPY_HAS_LOG10 (1)
#define ULAB_NUMPY_HAS_LOG2 (1)
#define ULAB_NUMPY_HAS_RADIANS (1)
#define ULAB_NUMPY_HAS_SIN (1)
#define ULAB_NUMPY_HAS_SINH (1)
#define ULAB_NUMPY_HAS_SQRT (1)
#define ULAB_NUMPY_HAS_TAN (1)
#define ULAB_NUMPY_HAS_TANH (1)
#define ULAB_NUMPY_HAS_VECTORIZE (1)
#endif

View file

@ -16,7 +16,7 @@
#include "py/runtime.h"
#include "py/objarray.h"
#include "../numpy.h"
#include "../ulab.h"
#include "../linalg/linalg_tools.h"
#include "../ulab_tools.h"
#include "poly.h"

View file

@ -16,7 +16,6 @@
#include "py/runtime.h"
#include "ulab.h"
#include "scipy_defs.h"
#include "scipy/optimize.h"
#include "scipy/signal.h"
#include "scipy/special.h"

View file

@ -13,14 +13,14 @@
*/
#include <math.h>
#include "py/runtime.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "py/misc.h"
#include "scipy_defs.h"
#include "../ndarray.h"
#include "../ulab.h"
#include "../ulab_tools.h"
#include "../approx/approx.h"
#include "optimize.h"
const mp_obj_float_t xtolerance = {{&mp_type_float}, MICROPY_FLOAT_CONST(2.4e-7)};
const mp_obj_float_t rtolerance = {{&mp_type_float}, MICROPY_FLOAT_CONST(0.0)};
@ -153,7 +153,7 @@ STATIC mp_obj_t optimize_fmin(size_t n_args, const mp_obj_t *pos_args, mp_map_t
uint16_t maxiter = (uint16_t)args[4].u_int;
mp_float_t x0 = mp_obj_get_float(args[1].u_obj);
mp_float_t x1 = x0 != MICROPY_FLOAT_CONST(0.0) ? (MICROPY_FLOAT_CONST(1.0) + APPROX_NONZDELTA) * x0 : APPROX_ZDELTA;
mp_float_t x1 = x0 != MICROPY_FLOAT_CONST(0.0) ? (MICROPY_FLOAT_CONST(1.0) + OPTIMIZE_NONZDELTA) * x0 : OPTIMIZE_ZDELTA;
mp_obj_t *fargs = m_new(mp_obj_t, 1);
mp_float_t f0 = optimize_python_call(type, fun, x0, fargs, 0);
mp_float_t f1 = optimize_python_call(type, fun, x1, fargs, 0);
@ -167,10 +167,10 @@ STATIC mp_obj_t optimize_fmin(size_t n_args, const mp_obj_t *pos_args, mp_map_t
f1 = optimize_python_call(type, fun, x1, fargs, 0);
// reflection
mp_float_t xr = (MICROPY_FLOAT_CONST(1.0) + APPROX_ALPHA) * x0 - APPROX_ALPHA * x1;
mp_float_t xr = (MICROPY_FLOAT_CONST(1.0) + OPTIMIZE_ALPHA) * x0 - OPTIMIZE_ALPHA * x1;
mp_float_t fr = optimize_python_call(type, fun, xr, fargs, 0);
if(fr < f0) { // expansion
mp_float_t xe = (1 + APPROX_ALPHA * APPROX_BETA) * x0 - APPROX_ALPHA * APPROX_BETA * x1;
mp_float_t xe = (1 + OPTIMIZE_ALPHA * OPTIMIZE_BETA) * x0 - OPTIMIZE_ALPHA * OPTIMIZE_BETA * x1;
mp_float_t fe = optimize_python_call(type, fun, xe, fargs, 0);
if(fe < fr) {
x1 = xe;
@ -181,7 +181,7 @@ STATIC mp_obj_t optimize_fmin(size_t n_args, const mp_obj_t *pos_args, mp_map_t
}
} else {
if(fr < f1) { // contraction
mp_float_t xc = (1 + APPROX_GAMMA * APPROX_ALPHA) * x0 - APPROX_GAMMA * APPROX_ALPHA * x1;
mp_float_t xc = (1 + OPTIMIZE_GAMMA * OPTIMIZE_ALPHA) * x0 - OPTIMIZE_GAMMA * OPTIMIZE_ALPHA * x1;
mp_float_t fc = optimize_python_call(type, fun, xc, fargs, 0);
if(fc < fr) {
x1 = xc;
@ -190,7 +190,7 @@ STATIC mp_obj_t optimize_fmin(size_t n_args, const mp_obj_t *pos_args, mp_map_t
shrink = 1;
}
} else { // inside contraction
mp_float_t xc = (MICROPY_FLOAT_CONST(1.0) - APPROX_GAMMA) * x0 + APPROX_GAMMA * x1;
mp_float_t xc = (MICROPY_FLOAT_CONST(1.0) - OPTIMIZE_GAMMA) * x0 + OPTIMIZE_GAMMA * x1;
mp_float_t fc = optimize_python_call(type, fun, xc, fargs, 0);
if(fc < f1) {
x1 = xc;
@ -200,7 +200,7 @@ STATIC mp_obj_t optimize_fmin(size_t n_args, const mp_obj_t *pos_args, mp_map_t
}
}
if(shrink == 1) {
x1 = x0 + APPROX_DELTA * (x1 - x0);
x1 = x0 + OPTIMIZE_DELTA * (x1 - x0);
f1 = optimize_python_call(type, fun, x1, fargs, 0);
}
if((MICROPY_FLOAT_C_FUN(fabs)(f1 - f0) < fatol) ||
@ -372,7 +372,7 @@ STATIC mp_obj_t optimize_newton(size_t n_args, const mp_obj_t *pos_args, mp_map_
mp_float_t tol = mp_obj_get_float(args[2].u_obj);
mp_float_t rtol = mp_obj_get_float(args[3].u_obj);
mp_float_t dx, df, fx;
dx = x > MICROPY_FLOAT_CONST(0.0) ? APPROX_EPS * x : -APPROX_EPS * x;
dx = x > MICROPY_FLOAT_CONST(0.0) ? OPTIMIZE_EPS * x : -OPTIMIZE_EPS * x;
mp_obj_t *fargs = m_new(mp_obj_t, 1);
if(args[4].u_int <= 0) {
mp_raise_ValueError(translate("maxiter must be > 0"));

View file

@ -15,6 +15,14 @@
#include "../ulab_tools.h"
#define OPTIMIZE_EPS MICROPY_FLOAT_CONST(1.0e-4)
#define OPTIMIZE_NONZDELTA MICROPY_FLOAT_CONST(0.05)
#define OPTIMIZE_ZDELTA MICROPY_FLOAT_CONST(0.00025)
#define OPTIMIZE_ALPHA MICROPY_FLOAT_CONST(1.0)
#define OPTIMIZE_BETA MICROPY_FLOAT_CONST(2.0)
#define OPTIMIZE_GAMMA MICROPY_FLOAT_CONST(0.5)
#define OPTIMIZE_DELTA MICROPY_FLOAT_CONST(0.5)
extern mp_obj_module_t ulab_scipy_optimize_module;
MP_DECLARE_CONST_FUN_OBJ_KW(optimize_bisect_obj);

View file

@ -16,9 +16,8 @@
#include <string.h>
#include "py/runtime.h"
#include "scipy_defs.h"
#include "../ulab.h"
#include "../fft/fft.h"
#include "../filter/filter.h"
#if ULAB_SCIPY_SIGNAL_HAS_SOSFILT

View file

@ -15,7 +15,7 @@
#include <math.h>
#include "py/runtime.h"
#include "scipy_defs.h"
#include "../ulab.h"
#include "../vector/vectorise.h"
static const mp_rom_map_elem_t ulab_scipy_special_globals_table[] = {

View file

@ -1,34 +0,0 @@
/*
* This file is part of the micropython-ulab project,
*
* https://github.com/v923z/micropython-ulab
*
* The MIT License (MIT)
*
* Copyright (c) 2019-2020 Zoltán Vörös
*/
#ifndef __ULAB_SCIPY_DEFS__
#define __ULAB_SCIPY_DEFS__
#define ULAB_SCIPY_HAS_SIGNAL_MODULE (1)
#define ULAB_SCIPY_SIGNAL_HAS_SPECTROGRAM (1)
#define ULAB_SCIPY_SIGNAL_HAS_SOSFILT (1)
#define ULAB_SCIPY_HAS_OPTIMIZE_MODULE (1)
#define ULAB_SCIPY_OPTIMIZE_HAS_BISECT (1)
#define ULAB_SCIPY_OPTIMIZE_HAS_CURVE_FIT (0) // not fully implemented
#define ULAB_SCIPY_OPTIMIZE_HAS_FMIN (1)
#define ULAB_SCIPY_OPTIMIZE_HAS_NEWTON (1)
#define ULAB_SCIPY_HAS_SPECIAL_MODULE (1)
#define ULAB_SCIPY_SPECIAL_HAS_ERF (1)
#define ULAB_SCIPY_SPECIAL_HAS_ERFC (1)
#define ULAB_SCIPY_SPECIAL_HAS_GAMMA (1)
#define ULAB_SCIPY_SPECIAL_HAS_GAMMALN (1)
#endif

View file

@ -59,21 +59,6 @@
#define NDARRAY_PRINT_THRESHOLD 10
#define NDARRAY_PRINT_EDGEITEMS 3
// determines, whether e is defined in ulab.numpy itself
#define ULAB_HAS_E (1)
// ulab defines infinite as a class constant in ulab.numpy
#define ULAB_HAS_INF (1)
// ulab defines NaN as a class constant in ulab.numpy
#define ULAB_HAS_NAN (1)
// determines, whether pi is defined in ulab.numpy itself
#define ULAB_HAS_PI (1)
// determines, whether the ndinfo function is available
#define ULAB_HAS_NDINFO (1)
// determines, whether the dtype is an object, or simply a character
// the object implementation is numpythonic, but requires more space
#define ULAB_HAS_DTYPE_OBJECT (0)
@ -132,6 +117,130 @@
// around 800 bytes in the four-dimensional case, and around 200 in two dimensions.
#define ULAB_VECTORISE_USES_FUN_POINTER (1)
// The default threshold for pretty printing. These variables can be overwritten
// at run-time via the set_printoptions() function
#define NDARRAY_PRINT_THRESHOLD 10
#define NDARRAY_PRINT_EDGEITEMS 3
// determines, whether e is defined in ulab.numpy itself
#define ULAB_NUMPY_HAS_E (1)
// ulab defines infinite as a class constant in ulab.numpy
#define ULAB_NUMPY_HAS_INF (1)
// ulab defines NaN as a class constant in ulab.numpy
#define ULAB_NUMPY_HAS_NAN (1)
// determines, whether pi is defined in ulab.numpy itself
#define ULAB_NUMPY_HAS_PI (1)
// determines, whether the ndinfo function is available
#define ULAB_NUMPY_HAS_NDINFO (1)
// functions that create an array
#define ULAB_NUMPY_HAS_ARANGE (1)
#define ULAB_NUMPY_HAS_CONCATENATE (1)
#define ULAB_NUMPY_HAS_DIAG (1)
#define ULAB_NUMPY_HAS_EYE (1)
#define ULAB_NUMPY_HAS_FULL (1)
#define ULAB_NUMPY_HAS_LINSPACE (1)
#define ULAB_NUMPY_HAS_LOGSPACE (1)
#define ULAB_NUMPY_HAS_ONES (1)
#define ULAB_NUMPY_HAS_ZEROS (1)
// functions that compare arrays
#define ULAB_NUMPY_HAS_CLIP (1)
#define ULAB_NUMPY_HAS_EQUAL (1)
#define ULAB_NUMPY_HAS_NOTEQUAL (1)
#define ULAB_NUMPY_HAS_MAXIMUM (1)
#define ULAB_NUMPY_HAS_MINIMUM (1)
// the linalg module; functions of the linalg module still have
// to be defined separately
#ifndef ULAB_NUMPY_HAS_LINALG_MODULE
#define ULAB_NUMPY_HAS_LINALG_MODULE (1)
#define ULAB_LINALG_HAS_CHOLESKY (1)
#define ULAB_LINALG_HAS_DET (1)
#define ULAB_LINALG_HAS_DOT (1)
#define ULAB_LINALG_HAS_EIG (1)
#define ULAB_LINALG_HAS_INV (1)
#define ULAB_LINALG_HAS_NORM (1)
#define ULAB_LINALG_HAS_TRACE (1)
#endif
// the FFT module; functions of the fft module still have
// to be defined separately
#ifndef ULAB_NUMPY_HAS_FFT_MODULE
#define ULAB_NUMPY_HAS_FFT_MODULE (1)
#define ULAB_FFT_HAS_FFT (1)
#define ULAB_FFT_HAS_IFFT (1)
#endif
#define ULAB_NUMPY_HAS_ARGMINMAX (1)
#define ULAB_NUMPY_HAS_ARGSORT (1)
#define ULAB_NUMPY_HAS_CONVOLVE (1)
#define ULAB_NUMPY_HAS_CROSS (1)
#define ULAB_NUMPY_HAS_DIFF (1)
#define ULAB_NUMPY_HAS_FLIP (1)
#define ULAB_NUMPY_HAS_INTERP (1)
#define ULAB_NUMPY_HAS_MEAN (1)
#define ULAB_NUMPY_HAS_MEDIAN (1)
#define ULAB_NUMPY_HAS_MINMAX (1)
#define ULAB_NUMPY_HAS_POLYFIT (1)
#define ULAB_NUMPY_HAS_POLYVAL (1)
#define ULAB_NUMPY_HAS_ROLL (1)
#define ULAB_NUMPY_HAS_SORT (1)
#define ULAB_NUMPY_HAS_STD (1)
#define ULAB_NUMPY_HAS_SUM (1)
#define ULAB_NUMPY_HAS_TRAPZ (1)
// vectorised versions of the functions of the math python module, with
// the exception of the functions listed in scipy.special
#define ULAB_NUMPY_HAS_ACOS (1)
#define ULAB_NUMPY_HAS_ACOSH (1)
#define ULAB_NUMPY_HAS_ARCTAN2 (1)
#define ULAB_NUMPY_HAS_AROUND (1)
#define ULAB_NUMPY_HAS_ASIN (1)
#define ULAB_NUMPY_HAS_ASINH (1)
#define ULAB_NUMPY_HAS_ATAN (1)
#define ULAB_NUMPY_HAS_ATANH (1)
#define ULAB_NUMPY_HAS_CEIL (1)
#define ULAB_NUMPY_HAS_COS (1)
#define ULAB_NUMPY_HAS_COSH (1)
#define ULAB_NUMPY_HAS_DEGREES (1)
#define ULAB_NUMPY_HAS_EXP (1)
#define ULAB_NUMPY_HAS_EXPM1 (1)
#define ULAB_NUMPY_HAS_FLOOR (1)
#define ULAB_NUMPY_HAS_LOG (1)
#define ULAB_NUMPY_HAS_LOG10 (1)
#define ULAB_NUMPY_HAS_LOG2 (1)
#define ULAB_NUMPY_HAS_RADIANS (1)
#define ULAB_NUMPY_HAS_SIN (1)
#define ULAB_NUMPY_HAS_SINH (1)
#define ULAB_NUMPY_HAS_SQRT (1)
#define ULAB_NUMPY_HAS_TAN (1)
#define ULAB_NUMPY_HAS_TANH (1)
#define ULAB_NUMPY_HAS_VECTORIZE (1)
#define ULAB_SCIPY_HAS_SIGNAL_MODULE (1)
#define ULAB_SCIPY_SIGNAL_HAS_SPECTROGRAM (1)
#define ULAB_SCIPY_SIGNAL_HAS_SOSFILT (1)
#define ULAB_SCIPY_HAS_OPTIMIZE_MODULE (1)
#define ULAB_SCIPY_OPTIMIZE_HAS_BISECT (1)
#define ULAB_SCIPY_OPTIMIZE_HAS_CURVE_FIT (0) // not fully implemented
#define ULAB_SCIPY_OPTIMIZE_HAS_FMIN (1)
#define ULAB_SCIPY_OPTIMIZE_HAS_NEWTON (1)
#define ULAB_SCIPY_HAS_SPECIAL_MODULE (1)
#define ULAB_SCIPY_SPECIAL_HAS_ERF (1)
#define ULAB_SCIPY_SPECIAL_HAS_ERFC (1)
#define ULAB_SCIPY_SPECIAL_HAS_GAMMA (1)
#define ULAB_SCIPY_SPECIAL_HAS_GAMMALN (1)
// user-defined module
#ifndef ULAB_USER_MODULE
#define ULAB_USER_MODULE (0)

View file

@ -17,7 +17,7 @@
#include "py/obj.h"
#include "py/runtime.h"
#include "numpy_defs.h"
#include "ulab.h"
#include "ulab_create.h"
#if ULAB_NUMPY_HAS_ONES | ULAB_NUMPY_HAS_ZEROS | ULAB_NUMPY_HAS_FULL

View file

@ -20,8 +20,7 @@
#include "py/obj.h"
#include "py/objarray.h"
#include "../numpy_defs.h"
#include "../scipy_defs.h"
#include "../ulab.h"
#include "../ulab_tools.h"
#include "vectorise.h"