Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ToDo.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion doc/api.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ext/numo/narray/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion ext/numo/narray/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ext/numo/narray/gen/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
def_id "minlength" # for bincount
end

# Constatnts
# Constants

if is_bit
def_const "ELEMENT_BIT_SIZE", "INT2FIX(1)"
Expand Down
2 changes: 1 addition & 1 deletion ext/numo/narray/gen/tmpl/format.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ext/numo/narray/gen/tmpl/format_to_a.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ext/numo/narray/gen/tmpl/logseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion ext/numo/narray/gen/tmpl/seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ext/numo/narray/gen/tmpl_bit/format.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ext/numo/narray/gen/tmpl_bit/format_to_a.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions ext/numo/narray/index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions ext/numo/narray/ndloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ext/numo/narray/numo/ndloop.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/numo/narray/extra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down