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/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)" 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/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 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) diff --git a/ext/numo/narray/index.c b/ext/numo/narray/index.c index 9b19b9d5..9482a587 100644 --- a/ext/numo/narray/index.c +++ b/ext/numo/narray/index.c @@ -16,9 +16,9 @@ #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 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) { @@ -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; } diff --git a/ext/numo/narray/ndloop.c b/ext/numo/narray/ndloop.c index 6f0d91ac..5cb3752d 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 @@ -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 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; 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