Skip to content

Commit 359cf78

Browse files
authored
Merge pull request v923z#151 from v923z/docs
fixed indentation error in approx.c
2 parents 9a82e70 + f8bf869 commit 359cf78

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

code/approx/approx.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ STATIC mp_float_t approx_python_call(const mp_obj_type_t *type, mp_obj_t fun, mp
4747
//| (``a``..``b``) using the bisection method. The result is accurate to within
4848
//| ``xtol`` unless more than ``maxiter`` steps are required."""
4949
//| ...
50-
//|
50+
//|
5151

5252
STATIC mp_obj_t approx_bisect(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
5353
// Simple bisection routine
@@ -95,17 +95,17 @@ STATIC mp_obj_t approx_bisect(size_t n_args, const mp_obj_t *pos_args, mp_map_t
9595
MP_DEFINE_CONST_FUN_OBJ_KW(approx_bisect_obj, 3, approx_bisect);
9696

9797
//| def fmin(fun, x0, *, xatol=2.4e-7, fatol=2.4e-7, maxiter=200) -> float:
98-
//| """
99-
//| :param callable f: The function to bisect
100-
//| :param float x0: The initial x value
101-
//| :param float xatol: The absolute tolerance value
102-
//| :param float fatol: The relative tolerance value
98+
//| """
99+
//| :param callable f: The function to bisect
100+
//| :param float x0: The initial x value
101+
//| :param float xatol: The absolute tolerance value
102+
//| :param float fatol: The relative tolerance value
103103
//|
104-
//| Find a minimum of the function ``f(x)`` using the downhill simplex method.
105-
//| The located ``x`` is within ``fxtol`` of the actual minimum, and ``f(x)``
106-
//| is within ``fatol`` of the actual minimum unless more than ``maxiter``
107-
//| steps are requried."""
108-
//| ...
104+
//| Find a minimum of the function ``f(x)`` using the downhill simplex method.
105+
//| The located ``x`` is within ``fxtol`` of the actual minimum, and ``f(x)``
106+
//| is within ``fatol`` of the actual minimum unless more than ``maxiter``
107+
//| steps are requried."""
108+
//| ...
109109
//|
110110

111111
STATIC mp_obj_t approx_fmin(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
@@ -307,7 +307,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(approx_curve_fit_obj, 2, approx_curve_fit);
307307
#endif
308308

309309
//| def interp(x: ulab.array, xp:ulab.array, fp:ulab.array, *, left=None, right=None) -> ulab.array:
310-
//| """
310+
//| """
311311
//| :param ulab.array x: The x-coordinates at which to evaluate the interpolated values.
312312
//| :param ulab.array xp: The x-coordinates of the data points, must be increasing
313313
//| :param ulab.array fp: The y-coordinates of the data points, same length as xp

code/linalg/linalg.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ bool linalg_invert_matrix(mp_float_t *data, size_t N) {
9191
//|
9292

9393
static mp_obj_t linalg_cholesky(mp_obj_t oin) {
94-
ndarray_obj_t *in = MP_OBJ_TO_PTR(oin);
95-
ndarray_obj_t *L = create_new_ndarray(in->n, in->n, NDARRAY_FLOAT);
94+
ndarray_obj_t *in = MP_OBJ_TO_PTR(oin);
95+
ndarray_obj_t *L = create_new_ndarray(in->n, in->n, NDARRAY_FLOAT);
9696
mp_float_t *array = (mp_float_t *)L->array->items;
9797

9898
size_t pos = 0;
@@ -244,7 +244,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(linalg_dot_obj, linalg_dot);
244244
//|
245245

246246
static mp_obj_t linalg_eig(mp_obj_t oin) {
247-
ndarray_obj_t *in = linalg_object_is_square(oin);
247+
ndarray_obj_t *in = linalg_object_is_square(oin);
248248
mp_float_t *array = m_new(mp_float_t, in->array->len);
249249
for(size_t i=0; i < in->array->len; i++) {
250250
array[i] = ndarray_get_float_value(in->array->items, in->array->typecode, i);
@@ -404,7 +404,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(linalg_inv_obj, linalg_inv);
404404
//| """
405405
//| :param ~ulab.array x: a vector or a matrix
406406
//|
407-
//| Computes the 2-norm of a vector or a matrix, i.e., sqrt(sum(x*x)), however, without the RAM overhead.."""
407+
//| Computes the 2-norm of a vector or a matrix, i.e., ``sqrt(sum(x*x))``, however, without the RAM overhead."""
408408
//| ...
409409
//|
410410

0 commit comments

Comments
 (0)