From d68a4e5a825153a070c21ab6b096cd6c6e66034e Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Thu, 29 May 2025 14:36:22 +0900 Subject: [PATCH 1/8] Fix typo: Constatnts -> Constants --- ext/numo/narray/gen/spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/numo/narray/gen/spec.rb b/ext/numo/narray/gen/spec.rb index 33f8517a..ae379556 100644 --- a/ext/numo/narray/gen/spec.rb +++ b/ext/numo/narray/gen/spec.rb @@ -56,7 +56,7 @@ def_id "minlength" # for bincount end -# Constatnts +# Constants if is_bit def_const "ELEMENT_BIT_SIZE", "INT2FIX(1)" From 3ee6b8d6f47fda37d5d0e74df49ea34083017249 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Thu, 29 May 2025 14:33:59 +0900 Subject: [PATCH 2/8] Correct spelling of dimension in comments --- ToDo.md | 2 +- doc/api.ja.md | 2 +- ext/numo/narray/array.c | 2 +- ext/numo/narray/data.c | 2 +- ext/numo/narray/index.c | 4 ++-- ext/numo/narray/ndloop.c | 2 +- ext/numo/narray/numo/ndloop.h | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ToDo.md b/ToDo.md index 07db5aab..80de9d48 100644 --- a/ToDo.md +++ b/ToDo.md @@ -1,6 +1,6 @@ - [x] copy to buffer if non-contiguous.gc -- [x] contract contiguous dimesions.gc +- [x] contract contiguous dimensions.gc - [ ] transpose and flatten reduce dimeinsion to last user dimension. -- almost done. diff --git a/doc/api.ja.md b/doc/api.ja.md index e55d65e4..fbe0411d 100644 --- a/doc/api.ja.md +++ b/doc/api.ja.md @@ -157,7 +157,7 @@ typedef struct NDF_ARG_OUT { typedef struct NA_LOOP { int narg; - int ndim; // n of user dimention + int ndim; // n of user dimension size_t *n; // n of elements for each dim na_loop_args_t *args; // for each arg VALUE option; diff --git a/ext/numo/narray/array.c b/ext/numo/narray/array.c index 0a8807dc..8956e506 100644 --- a/ext/numo/narray/array.c +++ b/ext/numo/narray/array.c @@ -560,7 +560,7 @@ na_mdai_for_struct(na_mdai_t *mdai, int ndim) //fputs("compati\n",stderr); return 1; } - // otherwise, multi-dimention + // otherwise, multi-dimension if (ndim >= mdai->capa) { //fprintf(stderr,"exeed capa\n"); abort(); na_mdai_realloc(mdai,4); diff --git a/ext/numo/narray/data.c b/ext/numo/narray/data.c index b12532c1..1501125d 100644 --- a/ext/numo/narray/data.c +++ b/ext/numo/narray/data.c @@ -521,7 +521,7 @@ na_flatten_dim(VALUE self, int sd) na2->stridx[i] = na1->stridx[i]; } } - // flat dimenion == last dimension + // flat dimension == last dimension if (RTEST(na_check_ladder(self,sd))) { na2->stridx[sd] = na1->stridx[nd-1]; } else { diff --git a/ext/numo/narray/index.c b/ext/numo/narray/index.c index 9b19b9d5..0e1bf539 100644 --- a/ext/numo/narray/index.c +++ b/ext/numo/narray/index.c @@ -18,7 +18,7 @@ // note: the memory refed by this pointer is not freed and causes memroy leak. typedef struct { - size_t n; // the number of elements of the dimesnion + size_t n; // the number of elements of the dimension size_t beg; // the starting point in the dimension ssize_t step; // the step size of the dimension size_t *idx; // list of indices @@ -508,7 +508,7 @@ na_index_parse_args(VALUE args, narray_t *na, na_index_arg_t *q, int ndim) na_index_parse_each(v, 1, k, &q[j]); j++; } - // other dimention + // other dimension else { na_index_parse_each(v, na->shape[k], k, &q[j]); if (q[j].n > 1) { diff --git a/ext/numo/narray/ndloop.c b/ext/numo/narray/ndloop.c index 6f0d91ac..4d2f0d82 100644 --- a/ext/numo/narray/ndloop.c +++ b/ext/numo/narray/ndloop.c @@ -41,7 +41,7 @@ typedef struct NA_LOOP_XARGS { typedef struct NA_MD_LOOP { int narg; int nin; - int ndim; // n of total dimention + int ndim; // n of total dimension unsigned int copy_flag; // set i-th bit if i-th arg is cast void *ptr; // memory for n na_loop_iter_t *iter_ptr; // memory for iter diff --git a/ext/numo/narray/numo/ndloop.h b/ext/numo/narray/numo/ndloop.h index e9880261..692fbf5e 100644 --- a/ext/numo/narray/numo/ndloop.h +++ b/ext/numo/narray/numo/ndloop.h @@ -26,7 +26,7 @@ typedef struct NA_LOOP_ARGS { // pass this structure to user iterator typedef struct NA_LOOP { int narg; - int ndim; // n of user dimention - required for each iterator. + int ndim; // n of user dimension - required for each iterator. size_t *n; // n of elements for each dim (=shape) na_loop_args_t *args; // for each arg VALUE option; From 2cb8ab1f06cd536102ec79b362b2698c79a3b77e Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Thu, 29 May 2025 14:47:04 +0900 Subject: [PATCH 3/8] Fix typo: uppler -> upper --- lib/numo/narray/extra.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/numo/narray/extra.rb b/lib/numo/narray/extra.rb index e64084ec..29ecb4e9 100644 --- a/lib/numo/narray/extra.rb +++ b/lib/numo/narray/extra.rb @@ -998,7 +998,7 @@ def triu!(k=0) end end - # Return the indices for the uppler-triangle on and above the k-th diagonal. + # Return the indices for the upper-triangle on and above the k-th diagonal. def triu_indices(k=0) if ndim < 2 raise NArray::ShapeError, "must be >= 2-dimensional array" @@ -1007,7 +1007,7 @@ def triu_indices(k=0) NArray.triu_indices(m,n,k) end - # Return the indices for the uppler-triangle on and above the k-th diagonal. + # Return the indices for the upper-triangle on and above the k-th diagonal. def self.triu_indices(m,n,k=0) x = Numo::Int64.new(m,1).seq + k y = Numo::Int64.new(1,n).seq From f08c727e088585f9eb33ff0368ebfebaba930944 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Thu, 29 May 2025 14:48:39 +0900 Subject: [PATCH 4/8] Fix typo: formated -> formatted --- ext/numo/narray/gen/tmpl/format.c | 2 +- ext/numo/narray/gen/tmpl/format_to_a.c | 2 +- ext/numo/narray/gen/tmpl_bit/format.c | 2 +- ext/numo/narray/gen/tmpl_bit/format_to_a.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/numo/narray/gen/tmpl/format.c b/ext/numo/narray/gen/tmpl/format.c index e7ef9f05..3fb4d5ef 100644 --- a/ext/numo/narray/gen/tmpl/format.c +++ b/ext/numo/narray/gen/tmpl/format.c @@ -44,7 +44,7 @@ static void Format elements into strings. @overload <%=name%> format @param [String] format - @return [Numo::RObject] array of formated strings. + @return [Numo::RObject] array of formatted strings. */ static VALUE <%=c_func(-1)%>(int argc, VALUE *argv, VALUE self) diff --git a/ext/numo/narray/gen/tmpl/format_to_a.c b/ext/numo/narray/gen/tmpl/format_to_a.c index 5d8f954e..2dd3daf1 100644 --- a/ext/numo/narray/gen/tmpl/format_to_a.c +++ b/ext/numo/narray/gen/tmpl/format_to_a.c @@ -32,7 +32,7 @@ static void Format elements into strings. @overload <%=name%> format @param [String] format - @return [Array] array of formated strings. + @return [Array] array of formatted strings. */ static VALUE <%=c_func(-1)%>(int argc, VALUE *argv, VALUE self) diff --git a/ext/numo/narray/gen/tmpl_bit/format.c b/ext/numo/narray/gen/tmpl_bit/format.c index 8770f033..6d1126c2 100644 --- a/ext/numo/narray/gen/tmpl_bit/format.c +++ b/ext/numo/narray/gen/tmpl_bit/format.c @@ -45,7 +45,7 @@ static void Format elements into strings. @overload <%=name%> format @param [String] format - @return [Numo::RObject] array of formated strings. + @return [Numo::RObject] array of formatted strings. */ static VALUE <%=c_func(-1)%>(int argc, VALUE *argv, VALUE self) diff --git a/ext/numo/narray/gen/tmpl_bit/format_to_a.c b/ext/numo/narray/gen/tmpl_bit/format_to_a.c index c0740db5..6f401a74 100644 --- a/ext/numo/narray/gen/tmpl_bit/format_to_a.c +++ b/ext/numo/narray/gen/tmpl_bit/format_to_a.c @@ -33,7 +33,7 @@ static void Format elements into strings. @overload <%=name%> format @param [String] format - @return [Array] array of formated strings. + @return [Array] array of formatted strings. */ static VALUE <%=c_func(-1)%>(int argc, VALUE *argv, VALUE self) From 7e307420827aeb83925f2cf04d196482d1138382 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Thu, 29 May 2025 14:49:05 +0900 Subject: [PATCH 5/8] Fix typo: begining -> beginning --- ext/numo/narray/gen/tmpl/logseq.c | 2 +- ext/numo/narray/gen/tmpl/seq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/numo/narray/gen/tmpl/logseq.c b/ext/numo/narray/gen/tmpl/logseq.c index b3e13b6f..12bfc4fd 100644 --- a/ext/numo/narray/gen/tmpl/logseq.c +++ b/ext/numo/narray/gen/tmpl/logseq.c @@ -47,7 +47,7 @@ static void Applicable classes: DFloat, SFloat, DComplex, SCopmplex. @overload logseq(beg,step,[base]) - @param [Numeric] beg The begining of sequence. + @param [Numeric] beg The beginning of sequence. @param [Numeric] step The step of sequence. @param [Numeric] base The base of log space. (default=10) @return [Numo::<%=class_name%>] self. diff --git a/ext/numo/narray/gen/tmpl/seq.c b/ext/numo/narray/gen/tmpl/seq.c index 271db69a..0d8cf37e 100644 --- a/ext/numo/narray/gen/tmpl/seq.c +++ b/ext/numo/narray/gen/tmpl/seq.c @@ -55,7 +55,7 @@ static void beg+i*step where i is 1-dimensional index. @overload seq([beg,[step]]) - @param [Numeric] beg begining of sequence. (default=0) + @param [Numeric] beg beginning of sequence. (default=0) @param [Numeric] step step of sequence. (default=1) @return [Numo::<%=class_name%>] self. @example From 967f44f9e5f6a1f1164ef0f39262f60663ab7eae Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Thu, 29 May 2025 14:59:33 +0900 Subject: [PATCH 6/8] Fix typo: memroy -> memory --- ext/numo/narray/index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/numo/narray/index.c b/ext/numo/narray/index.c index 0e1bf539..ee3c18c9 100644 --- a/ext/numo/narray/index.c +++ b/ext/numo/narray/index.c @@ -16,7 +16,7 @@ #define cIndex numo_cInt32 #endif -// note: the memory refed by this pointer is not freed and causes memroy leak. +// note: the memory refed by this pointer is not freed and causes memory leak. typedef struct { size_t n; // the number of elements of the dimension size_t beg; // the starting point in the dimension From 96015dae7855a96c41350f25595adfb2f3d42516 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Thu, 29 May 2025 15:00:02 +0900 Subject: [PATCH 7/8] Fix typo: allowd -> allowed --- ext/numo/narray/index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/numo/narray/index.c b/ext/numo/narray/index.c index ee3c18c9..9482a587 100644 --- a/ext/numo/narray/index.c +++ b/ext/numo/narray/index.c @@ -864,7 +864,7 @@ check_index_count(int argc, int na_ndim, int count_new, int count_rest) argc,na_ndim); break; default: - rb_raise(rb_eIndexError,"multiple rest-dimension is not allowd"); + rb_raise(rb_eIndexError,"multiple rest-dimension is not allowed"); } return -1; } From 1dcdde83aec675f1382840303cbff16443314b4a Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Thu, 29 May 2025 15:00:12 +0900 Subject: [PATCH 8/8] Fix typo: resuts -> results --- ext/numo/narray/ndloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/numo/narray/ndloop.c b/ext/numo/narray/ndloop.c index 4d2f0d82..5cb3752d 100644 --- a/ext/numo/narray/ndloop.c +++ b/ext/numo/narray/ndloop.c @@ -1280,7 +1280,7 @@ ndloop_run(VALUE vlp) //} } - // setup objects in which resuts are stored + // setup objects in which results are stored ndfunc_set_user_loop(nf, lp); // setup buffering during loop