compile unix double-precision, select integrations algos
This commit is contained in:
parent
7c13c24b1c
commit
a4c0c0b90f
4 changed files with 15 additions and 4 deletions
4
build.sh
4
build.sh
|
|
@ -59,8 +59,8 @@ fi
|
|||
|
||||
bash test-common.sh "${dims}" "$PROG"
|
||||
|
||||
# Build with single-precision float.
|
||||
make -C micropython/ports/unix -j${NPROC} USER_C_MODULES="${HERE}" DEBUG=1 STRIP=: MICROPY_PY_FFI=0 MICROPY_PY_BTREE=0 CFLAGS_EXTRA=-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT CFLAGS_EXTRA+=-DULAB_MAX_DIMS=$dims CFLAGS_EXTRA+=-DULAB_HASH=$GIT_HASH BUILD=build-nanbox-$dims PROG=micropython-nanbox-$dims
|
||||
# Build with double-precision float.
|
||||
make -C micropython/ports/unix -j${NPROC} USER_C_MODULES="${HERE}" DEBUG=1 STRIP=: MICROPY_PY_FFI=0 MICROPY_PY_BTREE=0 CFLAGS_EXTRA=-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_DOUBLE CFLAGS_EXTRA+=-DULAB_MAX_DIMS=$dims CFLAGS_EXTRA+=-DULAB_HASH=$GIT_HASH BUILD=build-nanbox-$dims PROG=micropython-nanbox-$dims
|
||||
|
||||
# The unix nanbox variant builds as a 32-bit executable and requires gcc-multilib.
|
||||
# macOS doesn't support i386 builds so only build on linux.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
USERMODULES_DIR := $(USERMOD_DIR)
|
||||
|
||||
# Add all C files to SRC_USERMOD.
|
||||
#if ULAB_SCIPY_HAS_INTEGRATE_MODULE
|
||||
SRC_USERMOD += $(USERMODULES_DIR)/scipy/integrate/integrate.c
|
||||
#endif
|
||||
SRC_USERMOD += $(USERMODULES_DIR)/scipy/linalg/linalg.c
|
||||
SRC_USERMOD += $(USERMODULES_DIR)/scipy/optimize/optimize.c
|
||||
SRC_USERMOD += $(USERMODULES_DIR)/scipy/signal/signal.c
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is not part of the micropython-ulab project,
|
||||
* This file is part of the micropython-ulab project,
|
||||
*
|
||||
* https://github.com/v923z/micropython-ulab
|
||||
*
|
||||
|
|
@ -261,9 +261,11 @@ static mp_obj_t integrate_quad(size_t n_args, const mp_obj_t *pos_args, mp_map_t
|
|||
mp_float_t a = mp_obj_get_float(args[1].u_obj);
|
||||
mp_float_t b = mp_obj_get_float(args[2].u_obj);
|
||||
uint16_t n = (uint16_t)args[3].u_int;
|
||||
#if 0
|
||||
if(n < 0) {
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("levels should be > 0"));
|
||||
}
|
||||
#endif
|
||||
mp_float_t eps = mp_obj_get_float(args[4].u_obj);
|
||||
|
||||
mp_obj_t res[2];
|
||||
|
|
@ -355,9 +357,11 @@ static mp_obj_t integrate_romberg(size_t n_args, const mp_obj_t *pos_args, mp_ma
|
|||
mp_float_t a = mp_obj_get_float(args[1].u_obj);
|
||||
mp_float_t b = mp_obj_get_float(args[2].u_obj);
|
||||
uint16_t steps = (uint16_t)args[3].u_int;
|
||||
# if 0
|
||||
if(steps < 0) {
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("steps should be > 0"));
|
||||
}
|
||||
#endif
|
||||
mp_float_t eps = mp_obj_get_float(args[4].u_obj);
|
||||
|
||||
return mp_obj_new_float(qromb(fun, a, b, steps, eps));
|
||||
|
|
@ -442,9 +446,11 @@ static mp_obj_t integrate_simpson(size_t n_args, const mp_obj_t *pos_args, mp_ma
|
|||
mp_float_t a = mp_obj_get_float(args[1].u_obj);
|
||||
mp_float_t b = mp_obj_get_float(args[2].u_obj);
|
||||
uint16_t steps = (uint16_t)args[3].u_int;
|
||||
#if 0
|
||||
if(steps < 0) {
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("steps should be > 0"));
|
||||
}
|
||||
#endif
|
||||
mp_float_t eps = mp_obj_get_float(args[4].u_obj);
|
||||
|
||||
return mp_obj_new_float(qasi(fun, a, b, steps, eps));
|
||||
|
|
@ -606,9 +612,11 @@ static mp_obj_t integrate_quadgk(size_t n_args, const mp_obj_t *pos_args, mp_map
|
|||
mp_float_t a = mp_obj_get_float(args[1].u_obj);
|
||||
mp_float_t b = mp_obj_get_float(args[2].u_obj);
|
||||
uint16_t order = (uint16_t)args[3].u_int;
|
||||
#if 0
|
||||
if(order < 0) {
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("levels should be > 0"));
|
||||
}
|
||||
#endif
|
||||
mp_float_t eps = mp_obj_get_float(args[4].u_obj);
|
||||
|
||||
mp_obj_t res[2];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
/*
|
||||
* This file is not part of the micropython-ulab project,
|
||||
* This file is part of the micropython-ulab project,
|
||||
*
|
||||
* https://github.com/v923z/micropython-ulab
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue