Skip to content

Commit

Permalink
fix/176 Fix issues with slice method (#207)
Browse files Browse the repository at this point in the history
* Fix slice issues

* Increase slice test coverage

* Fix typo in slice benchmark

* Bump version

* Generate dist

* Generate docs

* Generate benchmarks
  • Loading branch information
mateogianolio authored Apr 18, 2021
1 parent 07b5a64 commit c5c9afe
Show file tree
Hide file tree
Showing 115 changed files with 45,809 additions and 33 deletions.
Binary file modified benchmarks/NDArray/copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added benchmarks/NDArray/slice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export declare class NDArray implements INDArray {
/**
* @name T
* @memberof NDArray.prototype
* @description Short for this.copy().transpose()
* @description Short for `this.transpose()`
* @type NDArray
*/
get T(): NDArray;
Expand Down
2 changes: 1 addition & 1 deletion dist/core/slice.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export declare const slice: (x: NDArray | ArrayLike<any>, begin?: number | undef
/**
* @function slice
* @memberof NDArray.prototype
* @description Slices the current array in the corresponding dimension
* @description Slices the current array along the leading dimension
* @param {Number} begin
* @param {Number} end
* @param {Number} step
Expand Down
8 changes: 4 additions & 4 deletions dist/index.browser.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.browser.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.js.map

Large diffs are not rendered by default.

12,042 changes: 12,042 additions & 0 deletions docs/vectorious/6.0.4/NDArray.html

Large diffs are not rendered by default.

1,088 changes: 1,088 additions & 0 deletions docs/vectorious/6.0.4/NDIter.html

Large diffs are not rendered by default.

701 changes: 701 additions & 0 deletions docs/vectorious/6.0.4/NDMultiIter.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_abs.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_acos.js.html

Large diffs are not rendered by default.

153 changes: 153 additions & 0 deletions docs/vectorious/6.0.4/core_acosh.js.html

Large diffs are not rendered by default.

183 changes: 183 additions & 0 deletions docs/vectorious/6.0.4/core_add.js.html

Large diffs are not rendered by default.

148 changes: 148 additions & 0 deletions docs/vectorious/6.0.4/core_angle.js.html

Large diffs are not rendered by default.

130 changes: 130 additions & 0 deletions docs/vectorious/6.0.4/core_array.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_asin.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_asinh.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_atan.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_atanh.js.html

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions docs/vectorious/6.0.4/core_augment.js.html

Large diffs are not rendered by default.

154 changes: 154 additions & 0 deletions docs/vectorious/6.0.4/core_binOp.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_cbrt.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_ceil.js.html

Large diffs are not rendered by default.

160 changes: 160 additions & 0 deletions docs/vectorious/6.0.4/core_check.js.html

Large diffs are not rendered by default.

169 changes: 169 additions & 0 deletions docs/vectorious/6.0.4/core_combine.js.html

Large diffs are not rendered by default.

154 changes: 154 additions & 0 deletions docs/vectorious/6.0.4/core_copy.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_cos.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_cosh.js.html

Large diffs are not rendered by default.

164 changes: 164 additions & 0 deletions docs/vectorious/6.0.4/core_cross.js.html

Large diffs are not rendered by default.

158 changes: 158 additions & 0 deletions docs/vectorious/6.0.4/core_det.js.html

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions docs/vectorious/6.0.4/core_diagonal.js.html

Large diffs are not rendered by default.

184 changes: 184 additions & 0 deletions docs/vectorious/6.0.4/core_dot.js.html

Large diffs are not rendered by default.

249 changes: 249 additions & 0 deletions docs/vectorious/6.0.4/core_eig.js.html

Large diffs are not rendered by default.

158 changes: 158 additions & 0 deletions docs/vectorious/6.0.4/core_equals.js.html

Large diffs are not rendered by default.

155 changes: 155 additions & 0 deletions docs/vectorious/6.0.4/core_equidimensional.js.html

Large diffs are not rendered by default.

155 changes: 155 additions & 0 deletions docs/vectorious/6.0.4/core_equilateral.js.html

Large diffs are not rendered by default.

156 changes: 156 additions & 0 deletions docs/vectorious/6.0.4/core_exp.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_expm1.js.html

Large diffs are not rendered by default.

138 changes: 138 additions & 0 deletions docs/vectorious/6.0.4/core_eye.js.html

Large diffs are not rendered by default.

153 changes: 153 additions & 0 deletions docs/vectorious/6.0.4/core_fill.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_floor.js.html

Large diffs are not rendered by default.

157 changes: 157 additions & 0 deletions docs/vectorious/6.0.4/core_forEach.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_fround.js.html

Large diffs are not rendered by default.

241 changes: 241 additions & 0 deletions docs/vectorious/6.0.4/core_gauss.js.html

Large diffs are not rendered by default.

160 changes: 160 additions & 0 deletions docs/vectorious/6.0.4/core_get.js.html

Large diffs are not rendered by default.

598 changes: 598 additions & 0 deletions docs/vectorious/6.0.4/core_index.js.html

Large diffs are not rendered by default.

205 changes: 205 additions & 0 deletions docs/vectorious/6.0.4/core_inv.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_log.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_log10.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_log1p.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_log2.js.html

Large diffs are not rendered by default.

166 changes: 166 additions & 0 deletions docs/vectorious/6.0.4/core_lu.js.html

Large diffs are not rendered by default.

211 changes: 211 additions & 0 deletions docs/vectorious/6.0.4/core_lu_factor.js.html

Large diffs are not rendered by default.

146 changes: 146 additions & 0 deletions docs/vectorious/6.0.4/core_magic.js.html

Large diffs are not rendered by default.

154 changes: 154 additions & 0 deletions docs/vectorious/6.0.4/core_map.js.html

Large diffs are not rendered by default.

131 changes: 131 additions & 0 deletions docs/vectorious/6.0.4/core_matrix.js.html

Large diffs are not rendered by default.

184 changes: 184 additions & 0 deletions docs/vectorious/6.0.4/core_max.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_mean.js.html

Large diffs are not rendered by default.

155 changes: 155 additions & 0 deletions docs/vectorious/6.0.4/core_min.js.html

Large diffs are not rendered by default.

196 changes: 196 additions & 0 deletions docs/vectorious/6.0.4/core_multiply.js.html

Large diffs are not rendered by default.

178 changes: 178 additions & 0 deletions docs/vectorious/6.0.4/core_norm.js.html

Large diffs are not rendered by default.

145 changes: 145 additions & 0 deletions docs/vectorious/6.0.4/core_normalize.js.html

Large diffs are not rendered by default.

130 changes: 130 additions & 0 deletions docs/vectorious/6.0.4/core_ones.js.html

Large diffs are not rendered by default.

154 changes: 154 additions & 0 deletions docs/vectorious/6.0.4/core_pow.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_prod.js.html

Large diffs are not rendered by default.

153 changes: 153 additions & 0 deletions docs/vectorious/6.0.4/core_product.js.html

Large diffs are not rendered by default.

146 changes: 146 additions & 0 deletions docs/vectorious/6.0.4/core_project.js.html

Large diffs are not rendered by default.

159 changes: 159 additions & 0 deletions docs/vectorious/6.0.4/core_push.js.html

Large diffs are not rendered by default.

130 changes: 130 additions & 0 deletions docs/vectorious/6.0.4/core_random.js.html

Large diffs are not rendered by default.

179 changes: 179 additions & 0 deletions docs/vectorious/6.0.4/core_range.js.html

Large diffs are not rendered by default.

159 changes: 159 additions & 0 deletions docs/vectorious/6.0.4/core_rank.js.html

Large diffs are not rendered by default.

151 changes: 151 additions & 0 deletions docs/vectorious/6.0.4/core_reciprocal.js.html

Large diffs are not rendered by default.

167 changes: 167 additions & 0 deletions docs/vectorious/6.0.4/core_reduce.js.html

Large diffs are not rendered by default.

154 changes: 154 additions & 0 deletions docs/vectorious/6.0.4/core_reshape.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_round.js.html

Large diffs are not rendered by default.

159 changes: 159 additions & 0 deletions docs/vectorious/6.0.4/core_row_add.js.html

Large diffs are not rendered by default.

182 changes: 182 additions & 0 deletions docs/vectorious/6.0.4/core_scale.js.html

Large diffs are not rendered by default.

159 changes: 159 additions & 0 deletions docs/vectorious/6.0.4/core_set.js.html

Large diffs are not rendered by default.

156 changes: 156 additions & 0 deletions docs/vectorious/6.0.4/core_sign.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_sin.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_sinh.js.html

Large diffs are not rendered by default.

175 changes: 175 additions & 0 deletions docs/vectorious/6.0.4/core_slice.js.html

Large diffs are not rendered by default.

203 changes: 203 additions & 0 deletions docs/vectorious/6.0.4/core_solve.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_sqrt.js.html

Large diffs are not rendered by default.

151 changes: 151 additions & 0 deletions docs/vectorious/6.0.4/core_square.js.html

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions docs/vectorious/6.0.4/core_subtract.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_sum.js.html

Large diffs are not rendered by default.

156 changes: 156 additions & 0 deletions docs/vectorious/6.0.4/core_swap.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_tan.js.html

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions docs/vectorious/6.0.4/core_tanh.js.html

Large diffs are not rendered by default.

163 changes: 163 additions & 0 deletions docs/vectorious/6.0.4/core_toArray.js.html

Large diffs are not rendered by default.

146 changes: 146 additions & 0 deletions docs/vectorious/6.0.4/core_toString.js.html

Large diffs are not rendered by default.

153 changes: 153 additions & 0 deletions docs/vectorious/6.0.4/core_trace.js.html

Large diffs are not rendered by default.

154 changes: 154 additions & 0 deletions docs/vectorious/6.0.4/core_transpose.js.html

Large diffs are not rendered by default.

156 changes: 156 additions & 0 deletions docs/vectorious/6.0.4/core_trunc.js.html

Large diffs are not rendered by default.

130 changes: 130 additions & 0 deletions docs/vectorious/6.0.4/core_zeros.js.html

Large diffs are not rendered by default.

209 changes: 209 additions & 0 deletions docs/vectorious/6.0.4/index.html

Large diffs are not rendered by default.

129 changes: 129 additions & 0 deletions docs/vectorious/6.0.4/index.js.html

Large diffs are not rendered by default.

435 changes: 435 additions & 0 deletions docs/vectorious/6.0.4/iterator_index.js.html

Large diffs are not rendered by default.

14,509 changes: 14,509 additions & 0 deletions docs/vectorious/6.0.4/module-Globals.html

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions docs/vectorious/6.0.4/scripts/prism-linenumbers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
(function() {

if (typeof self === 'undefined' || !self.Prism || !self.document) {
return;
}

Prism.hooks.add('complete', function (env) {
if (!env.code) {
return;
}

// works only for <code> wrapped inside <pre> (not inline)
var pre = env.element.parentNode;
var clsReg = /\s*\bline-numbers\b\s*/;
if (
!pre || !/pre/i.test(pre.nodeName) ||
// Abort only if nor the <pre> nor the <code> have the class
(!clsReg.test(pre.className) && !clsReg.test(env.element.className))
) {
return;
}

if (env.element.querySelector(".line-numbers-rows")) {
// Abort if line numbers already exists
return;
}

if (clsReg.test(env.element.className)) {
// Remove the class "line-numbers" from the <code>
env.element.className = env.element.className.replace(clsReg, '');
}
if (!clsReg.test(pre.className)) {
// Add the class "line-numbers" to the <pre>
pre.className += ' line-numbers';
}

var match = env.code.match(/\n(?!$)/g);
var linesNum = match ? match.length + 1 : 1;
var lineNumbersWrapper;

var lines = new Array(linesNum + 1);
lines = lines.join('<span></span>');

lineNumbersWrapper = document.createElement('span');
lineNumbersWrapper.setAttribute('aria-hidden', 'true');
lineNumbersWrapper.className = 'line-numbers-rows';
lineNumbersWrapper.innerHTML = lines;

if (pre.hasAttribute('data-start')) {
pre.style.counterReset = 'linenumber ' + (parseInt(pre.getAttribute('data-start'), 10) - 1);
}

env.element.appendChild(lineNumbersWrapper);

});

}());
Loading

0 comments on commit c5c9afe

Please sign in to comment.