From 07b5a648a6b49b9654dc1534ccf0aa3475448371 Mon Sep 17 00:00:00 2001 From: Mateo Gianolio Date: Sat, 17 Apr 2021 19:16:31 +0200 Subject: [PATCH] [skip ci] Update docs --- .npmignore | 1 + docs.tmpl | 4 +- docs/vectorious/6.0.3/NDArray.html | 12042 +++++++++++++ docs/vectorious/6.0.3/NDIter.html | 1088 ++ docs/vectorious/6.0.3/NDMultiIter.html | 701 + docs/vectorious/6.0.3/core_abs.js.html | 152 + docs/vectorious/6.0.3/core_acos.js.html | 152 + docs/vectorious/6.0.3/core_acosh.js.html | 153 + docs/vectorious/6.0.3/core_add.js.html | 183 + docs/vectorious/6.0.3/core_angle.js.html | 148 + docs/vectorious/6.0.3/core_array.js.html | 130 + docs/vectorious/6.0.3/core_asin.js.html | 152 + docs/vectorious/6.0.3/core_asinh.js.html | 152 + docs/vectorious/6.0.3/core_atan.js.html | 152 + docs/vectorious/6.0.3/core_atanh.js.html | 152 + docs/vectorious/6.0.3/core_augment.js.html | 172 + docs/vectorious/6.0.3/core_binOp.js.html | 154 + docs/vectorious/6.0.3/core_cbrt.js.html | 152 + docs/vectorious/6.0.3/core_ceil.js.html | 152 + docs/vectorious/6.0.3/core_check.js.html | 160 + docs/vectorious/6.0.3/core_combine.js.html | 169 + docs/vectorious/6.0.3/core_copy.js.html | 154 + docs/vectorious/6.0.3/core_cos.js.html | 152 + docs/vectorious/6.0.3/core_cosh.js.html | 152 + docs/vectorious/6.0.3/core_cross.js.html | 164 + docs/vectorious/6.0.3/core_det.js.html | 158 + docs/vectorious/6.0.3/core_diagonal.js.html | 149 + docs/vectorious/6.0.3/core_dot.js.html | 184 + docs/vectorious/6.0.3/core_eig.js.html | 249 + docs/vectorious/6.0.3/core_equals.js.html | 158 + .../6.0.3/core_equidimensional.js.html | 155 + .../vectorious/6.0.3/core_equilateral.js.html | 155 + docs/vectorious/6.0.3/core_exp.js.html | 156 + docs/vectorious/6.0.3/core_expm1.js.html | 152 + docs/vectorious/6.0.3/core_eye.js.html | 138 + docs/vectorious/6.0.3/core_fill.js.html | 153 + docs/vectorious/6.0.3/core_floor.js.html | 152 + docs/vectorious/6.0.3/core_forEach.js.html | 157 + docs/vectorious/6.0.3/core_fround.js.html | 152 + docs/vectorious/6.0.3/core_gauss.js.html | 241 + docs/vectorious/6.0.3/core_get.js.html | 160 + docs/vectorious/6.0.3/core_index.js.html | 598 + docs/vectorious/6.0.3/core_inv.js.html | 205 + docs/vectorious/6.0.3/core_log.js.html | 152 + docs/vectorious/6.0.3/core_log10.js.html | 152 + docs/vectorious/6.0.3/core_log1p.js.html | 152 + docs/vectorious/6.0.3/core_log2.js.html | 152 + docs/vectorious/6.0.3/core_lu.js.html | 166 + docs/vectorious/6.0.3/core_lu_factor.js.html | 211 + docs/vectorious/6.0.3/core_magic.js.html | 146 + docs/vectorious/6.0.3/core_map.js.html | 154 + docs/vectorious/6.0.3/core_matrix.js.html | 131 + docs/vectorious/6.0.3/core_max.js.html | 184 + docs/vectorious/6.0.3/core_mean.js.html | 152 + docs/vectorious/6.0.3/core_min.js.html | 155 + docs/vectorious/6.0.3/core_multiply.js.html | 196 + docs/vectorious/6.0.3/core_norm.js.html | 178 + docs/vectorious/6.0.3/core_normalize.js.html | 145 + docs/vectorious/6.0.3/core_ones.js.html | 130 + docs/vectorious/6.0.3/core_pow.js.html | 154 + docs/vectorious/6.0.3/core_prod.js.html | 152 + docs/vectorious/6.0.3/core_product.js.html | 153 + docs/vectorious/6.0.3/core_project.js.html | 146 + docs/vectorious/6.0.3/core_push.js.html | 159 + docs/vectorious/6.0.3/core_random.js.html | 130 + docs/vectorious/6.0.3/core_range.js.html | 179 + docs/vectorious/6.0.3/core_rank.js.html | 159 + docs/vectorious/6.0.3/core_reciprocal.js.html | 151 + docs/vectorious/6.0.3/core_reduce.js.html | 167 + docs/vectorious/6.0.3/core_reshape.js.html | 154 + docs/vectorious/6.0.3/core_round.js.html | 152 + docs/vectorious/6.0.3/core_row_add.js.html | 159 + docs/vectorious/6.0.3/core_scale.js.html | 182 + docs/vectorious/6.0.3/core_set.js.html | 159 + docs/vectorious/6.0.3/core_sign.js.html | 156 + docs/vectorious/6.0.3/core_sin.js.html | 152 + docs/vectorious/6.0.3/core_sinh.js.html | 152 + docs/vectorious/6.0.3/core_slice.js.html | 166 + docs/vectorious/6.0.3/core_solve.js.html | 203 + docs/vectorious/6.0.3/core_sqrt.js.html | 152 + docs/vectorious/6.0.3/core_square.js.html | 151 + docs/vectorious/6.0.3/core_subtract.js.html | 149 + docs/vectorious/6.0.3/core_sum.js.html | 152 + docs/vectorious/6.0.3/core_swap.js.html | 156 + docs/vectorious/6.0.3/core_tan.js.html | 152 + docs/vectorious/6.0.3/core_tanh.js.html | 152 + docs/vectorious/6.0.3/core_toArray.js.html | 163 + docs/vectorious/6.0.3/core_toString.js.html | 146 + docs/vectorious/6.0.3/core_trace.js.html | 153 + docs/vectorious/6.0.3/core_transpose.js.html | 154 + docs/vectorious/6.0.3/core_trunc.js.html | 156 + docs/vectorious/6.0.3/core_zeros.js.html | 130 + docs/vectorious/6.0.3/index.html | 209 + docs/vectorious/6.0.3/index.js.html | 129 + docs/vectorious/6.0.3/index.ts.html | 85 + docs/vectorious/6.0.3/iterator_index.js.html | 435 + docs/vectorious/6.0.3/module-Globals.html | 14509 ++++++++++++++++ .../6.0.3/scripts/prism-linenumbers.js | 57 + docs/vectorious/6.0.3/scripts/prism.dev.js | 1115 ++ docs/vectorious/6.0.3/scripts/prism.js | 9 + docs/vectorious/6.0.3/scripts/prism.min.js | 11 + docs/vectorious/6.0.3/styles/styles.css | 415 + .../6.0.3/styles/vendor/prism-custom.css | 142 + .../6.0.3/styles/vendor/prism-default.css | 142 + .../6.0.3/styles/vendor/prism-okaidia.css | 217 + .../styles/vendor/prism-tomorrow-night.css | 217 + jsdoc.json | 14 +- package.json | 2 +- src/core/index.ts | 2 +- 109 files changed, 45825 insertions(+), 7 deletions(-) create mode 100644 docs/vectorious/6.0.3/NDArray.html create mode 100644 docs/vectorious/6.0.3/NDIter.html create mode 100644 docs/vectorious/6.0.3/NDMultiIter.html create mode 100644 docs/vectorious/6.0.3/core_abs.js.html create mode 100644 docs/vectorious/6.0.3/core_acos.js.html create mode 100644 docs/vectorious/6.0.3/core_acosh.js.html create mode 100644 docs/vectorious/6.0.3/core_add.js.html create mode 100644 docs/vectorious/6.0.3/core_angle.js.html create mode 100644 docs/vectorious/6.0.3/core_array.js.html create mode 100644 docs/vectorious/6.0.3/core_asin.js.html create mode 100644 docs/vectorious/6.0.3/core_asinh.js.html create mode 100644 docs/vectorious/6.0.3/core_atan.js.html create mode 100644 docs/vectorious/6.0.3/core_atanh.js.html create mode 100644 docs/vectorious/6.0.3/core_augment.js.html create mode 100644 docs/vectorious/6.0.3/core_binOp.js.html create mode 100644 docs/vectorious/6.0.3/core_cbrt.js.html create mode 100644 docs/vectorious/6.0.3/core_ceil.js.html create mode 100644 docs/vectorious/6.0.3/core_check.js.html create mode 100644 docs/vectorious/6.0.3/core_combine.js.html create mode 100644 docs/vectorious/6.0.3/core_copy.js.html create mode 100644 docs/vectorious/6.0.3/core_cos.js.html create mode 100644 docs/vectorious/6.0.3/core_cosh.js.html create mode 100644 docs/vectorious/6.0.3/core_cross.js.html create mode 100644 docs/vectorious/6.0.3/core_det.js.html create mode 100644 docs/vectorious/6.0.3/core_diagonal.js.html create mode 100644 docs/vectorious/6.0.3/core_dot.js.html create mode 100644 docs/vectorious/6.0.3/core_eig.js.html create mode 100644 docs/vectorious/6.0.3/core_equals.js.html create mode 100644 docs/vectorious/6.0.3/core_equidimensional.js.html create mode 100644 docs/vectorious/6.0.3/core_equilateral.js.html create mode 100644 docs/vectorious/6.0.3/core_exp.js.html create mode 100644 docs/vectorious/6.0.3/core_expm1.js.html create mode 100644 docs/vectorious/6.0.3/core_eye.js.html create mode 100644 docs/vectorious/6.0.3/core_fill.js.html create mode 100644 docs/vectorious/6.0.3/core_floor.js.html create mode 100644 docs/vectorious/6.0.3/core_forEach.js.html create mode 100644 docs/vectorious/6.0.3/core_fround.js.html create mode 100644 docs/vectorious/6.0.3/core_gauss.js.html create mode 100644 docs/vectorious/6.0.3/core_get.js.html create mode 100644 docs/vectorious/6.0.3/core_index.js.html create mode 100644 docs/vectorious/6.0.3/core_inv.js.html create mode 100644 docs/vectorious/6.0.3/core_log.js.html create mode 100644 docs/vectorious/6.0.3/core_log10.js.html create mode 100644 docs/vectorious/6.0.3/core_log1p.js.html create mode 100644 docs/vectorious/6.0.3/core_log2.js.html create mode 100644 docs/vectorious/6.0.3/core_lu.js.html create mode 100644 docs/vectorious/6.0.3/core_lu_factor.js.html create mode 100644 docs/vectorious/6.0.3/core_magic.js.html create mode 100644 docs/vectorious/6.0.3/core_map.js.html create mode 100644 docs/vectorious/6.0.3/core_matrix.js.html create mode 100644 docs/vectorious/6.0.3/core_max.js.html create mode 100644 docs/vectorious/6.0.3/core_mean.js.html create mode 100644 docs/vectorious/6.0.3/core_min.js.html create mode 100644 docs/vectorious/6.0.3/core_multiply.js.html create mode 100644 docs/vectorious/6.0.3/core_norm.js.html create mode 100644 docs/vectorious/6.0.3/core_normalize.js.html create mode 100644 docs/vectorious/6.0.3/core_ones.js.html create mode 100644 docs/vectorious/6.0.3/core_pow.js.html create mode 100644 docs/vectorious/6.0.3/core_prod.js.html create mode 100644 docs/vectorious/6.0.3/core_product.js.html create mode 100644 docs/vectorious/6.0.3/core_project.js.html create mode 100644 docs/vectorious/6.0.3/core_push.js.html create mode 100644 docs/vectorious/6.0.3/core_random.js.html create mode 100644 docs/vectorious/6.0.3/core_range.js.html create mode 100644 docs/vectorious/6.0.3/core_rank.js.html create mode 100644 docs/vectorious/6.0.3/core_reciprocal.js.html create mode 100644 docs/vectorious/6.0.3/core_reduce.js.html create mode 100644 docs/vectorious/6.0.3/core_reshape.js.html create mode 100644 docs/vectorious/6.0.3/core_round.js.html create mode 100644 docs/vectorious/6.0.3/core_row_add.js.html create mode 100644 docs/vectorious/6.0.3/core_scale.js.html create mode 100644 docs/vectorious/6.0.3/core_set.js.html create mode 100644 docs/vectorious/6.0.3/core_sign.js.html create mode 100644 docs/vectorious/6.0.3/core_sin.js.html create mode 100644 docs/vectorious/6.0.3/core_sinh.js.html create mode 100644 docs/vectorious/6.0.3/core_slice.js.html create mode 100644 docs/vectorious/6.0.3/core_solve.js.html create mode 100644 docs/vectorious/6.0.3/core_sqrt.js.html create mode 100644 docs/vectorious/6.0.3/core_square.js.html create mode 100644 docs/vectorious/6.0.3/core_subtract.js.html create mode 100644 docs/vectorious/6.0.3/core_sum.js.html create mode 100644 docs/vectorious/6.0.3/core_swap.js.html create mode 100644 docs/vectorious/6.0.3/core_tan.js.html create mode 100644 docs/vectorious/6.0.3/core_tanh.js.html create mode 100644 docs/vectorious/6.0.3/core_toArray.js.html create mode 100644 docs/vectorious/6.0.3/core_toString.js.html create mode 100644 docs/vectorious/6.0.3/core_trace.js.html create mode 100644 docs/vectorious/6.0.3/core_transpose.js.html create mode 100644 docs/vectorious/6.0.3/core_trunc.js.html create mode 100644 docs/vectorious/6.0.3/core_zeros.js.html create mode 100644 docs/vectorious/6.0.3/index.html create mode 100644 docs/vectorious/6.0.3/index.js.html create mode 100644 docs/vectorious/6.0.3/index.ts.html create mode 100644 docs/vectorious/6.0.3/iterator_index.js.html create mode 100644 docs/vectorious/6.0.3/module-Globals.html create mode 100644 docs/vectorious/6.0.3/scripts/prism-linenumbers.js create mode 100644 docs/vectorious/6.0.3/scripts/prism.dev.js create mode 100644 docs/vectorious/6.0.3/scripts/prism.js create mode 100644 docs/vectorious/6.0.3/scripts/prism.min.js create mode 100644 docs/vectorious/6.0.3/styles/styles.css create mode 100644 docs/vectorious/6.0.3/styles/vendor/prism-custom.css create mode 100644 docs/vectorious/6.0.3/styles/vendor/prism-default.css create mode 100644 docs/vectorious/6.0.3/styles/vendor/prism-okaidia.css create mode 100644 docs/vectorious/6.0.3/styles/vendor/prism-tomorrow-night.css diff --git a/.npmignore b/.npmignore index cb06fd35..465765f3 100644 --- a/.npmignore +++ b/.npmignore @@ -3,6 +3,7 @@ node_modules coverage .DS_Store +built src examples docs diff --git a/docs.tmpl b/docs.tmpl index 952d19b6..3f1ca4b8 100644 --- a/docs.tmpl +++ b/docs.tmpl @@ -3,6 +3,7 @@ <?js= env.conf.metadata.title ?>: <?js= title ?> + @@ -62,8 +63,5 @@ - - - diff --git a/docs/vectorious/6.0.3/NDArray.html b/docs/vectorious/6.0.3/NDArray.html new file mode 100644 index 00000000..a12704b1 --- /dev/null +++ b/docs/vectorious/6.0.3/NDArray.html @@ -0,0 +1,12042 @@ + + + + + Vectorious: NDArray + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

Class

+

NDArray

+ + + + + +
+ + +
+ + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ +

new NDArray(data, optionsopt) +

+ + + + + +
+ +

Constructs or copies an NDArray instance.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + data + + + + + + + + + + + + + + + + +
    + +
  • + + + +
  • + + options + + + + + + + + Object + + + + + + + + + <optional>
    + + + + + +
    + + + + +
    + +

    Properties

    + + +
      + + +
    • + + shape + + + + + + + + Array.<Number> + + + + + + + + + <optional>
      + + + + + +
      + + + + +
      + +
    • + + + +
    • + + length + + + + + + + + Number + + + + + + + + + <optional>
      + + + + + +
      + + + + +
      + +
    • + + + +
    • + + strides + + + + + + + + Array.<Number> + + + + + + + + + <optional>
      + + + + + +
      + + + + +
      + +
    • + + + +
    • + + dtype + + + + + + + + string + + + + + + + + + <optional>
      + + + + + +
      + + + + +
      + +
    • + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +

Example

+ +
import { NDArray } from 'vectorious';
+
+new NDArray() // => array([], dtype=float64)
+new NDArray([]) // => array([], dtype=float64)
+new NDArray([1, 2, 3]) // => array([1, 2, 3], dtype=float64)
+new NDArray([[1, 2], [3, 4]]) // => array([ [ 1, 2 ], [ 3, 4 ] ], dtype=float64)
+new NDArray(new Int32Array([1, 2, 3])) // => array([ 1, 2, 3 ], dtype=int32)
+new NDArray([1, 2, 3, 4], {
+  shape: [2, 2],
+  dtype: 'uint32'
+}) // => array([ [ 1, 2 ], [ 3, 4 ] ], dtype=uint32)
+ + + + + + + + + + + + + + +

Source

+ + + + + +
+ + + + + + + + + + + + + +

Members

+ + + + +
+
+ +
+

dataTypedArray

+ + + + + + +

Type

+
    +
  • + + + + + TypedArray + + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +

Default Value

+
    +
  • + new Float64Array(0) +
  • +
+ + + + + + + +
+ + + + + + + +

Source

+ + + +
+ + + +
+
+ +
+

dtypeString

+ + + + + + +

Type

+
    +
  • + + + + + String + + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +

Default Value

+
    +
  • + 'float64' +
  • +
+ + + + + + + +
+ + + + + + + +

Source

+ + + +
+ + + +
+
+ +
+

lengthNumber

+ + + + + + +

Type

+
    +
  • + + + + + Number + + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +

Default Value

+
    +
  • + 0 +
  • +
+ + + + + + + +
+ + + + + + + +

Source

+ + + +
+ + + +
+
+ +
+

shapeArray.<Number>

+ + + + + + +

Type

+
    +
  • + + + + + Array.<Number> + + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +

Default Value

+
    +
  • + [0] +
  • +
+ + + + + + + +
+ + + + + + + +

Source

+ + + +
+ + + +
+
+ +
+

stridesArray.<Number>

+ + + + + + +

Type

+
    +
  • + + + + + Array.<Number> + + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +

Default Value

+
    +
  • + [0] +
  • +
+ + + + + + + +
+ + + + + + + +

Source

+ + + +
+ + + +
+
+ +
+

TNDArray

+ + + + +
+

Short for this.transpose()

+
+ + + +

Type

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +

Source

+ + + +
+ + + +
+
+ +
+

wNumber

+ + + + +
+

Gets or sets the value at index 3

+
+ + + +

Type

+
    +
  • + + + + + Number + + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +

Source

+ + + +
+ + + +
+
+ +
+

xNumber

+ + + + +
+

Gets or sets the value at index 0

+
+ + + +

Type

+
    +
  • + + + + + Number + + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +

Source

+ + + +
+ + + +
+
+ +
+

yNumber

+ + + + +
+

Gets or sets the value at index 1

+
+ + + +

Type

+
    +
  • + + + + + Number + + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +

Source

+ + + +
+ + + +
+
+ +
+

zNumber

+ + + + +
+

Gets or sets the value at index 2

+
+ + + +

Type

+
    +
  • + + + + + Number + + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +

Source

+ + + +
+ + + + +

Methods

+ + + + + +
+ + + + + + + + + +
+ +
+ +

abs() → {this} +

+ + + + + +
+ +

Returns the absolute value of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([-1, -2, -3]).abs() // <=> array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

acos() → {this} +

+ + + + + +
+ +

Returns the arccosine of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([-1, 0, 1]).acos(); // <=> array([3.141592653589793, 1.5707963267948966, 0])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

acosh(x) → {this} +

+ + + + + +
+ +

Returns the hyperbolic arccosine of each element of current array.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).acosh(); // <=> array([0, 1.316957950592041, 1.7627471685409546])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

add(x) → {NDArray} +

+ + + + + +
+ +

Adds x multiplied by alpha to the current array. +Accelerated with BLAS ?axpy.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).add([4, 5, 6]); // <=> array([5, 7, 9])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

angle(x) → {number} +

+ + + + + +
+ +

Determines the angle between the current vector and x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).angle([4, 5, 6]); // <=> 0.22572622788897287
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

asin() → {this} +

+ + + + + +
+ +

Returns the arcsine of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([-1, 0, 1]).asin() // <=> array([-1.5707963705062866, 0, 1.5707963705062866])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

asinh() → {this} +

+ + + + + +
+ +

Returns the hyperbolic arcsine of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([0, 1, 2]).asinh() // <=> array([0, 0.8813735842704773, 1.4436354637145996])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

atan() → {this} +

+ + + + + +
+ +

Returns the arctangent of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).atan() // <=> array([0.7853981852531433, 1.1071487665176392, 1.249045729637146])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

atanh() → {this} +

+ + + + + +
+ +

Returns the hyperbolic arctangent of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([0, -0.5]).atanh(); // <=> array([0, -0.5493061542510986])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

augment(x) → {this} +

+ + + + + +
+ +

Augments x with current matrix.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[1, 2], [3, 4]]).augment(array([[1], [2]])); // <=> array([[1, 2, 1], [3, 4, 2]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

binOp(x) → {this} +

+ + + + + +
+ +

Perform binary operation f on x in the current array.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).binOp([4, 5, 6], (a, b) => a + b); // => array([[5, 7, 9])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

cbrt() → {this} +

+ + + + + +
+ +

Returns the cube root of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { cbrt } from 'vectorious/core/cbrt';
+
+cbrt([1, 8, 27]); // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

ceil() → {NDArray} +

+ + + + + +
+ +

Returns smallest integer greater than or equal to of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([0.5, 1.5, 2.5]).ceil(); // <=> array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

check() +

+ + + + + +
+ +

Asserts if indices i, j, ..., n are within the bounds of current array

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + ...indices + + + + + + + + Array.<Number> + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([0.5, 1.5, 2.5]).check(3); // Error: index out of bounds
+ + + + + + + + + + + + +

Throws

+ + + +
+
+
+

index out of bounds

+
+
+
+
+
+
+ Type +
+
+ + + + + Error + + + +
+
+
+
+
+ + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

combine(x) → {this} +

+ + + + + +
+ +

Combines the current vector with x

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).combine([4, 5, 6]); // => array([1, 2, 3, 4, 5, 6])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

copy() → {NDArray} +

+ + + + + +
+ +

Makes a copy of the class and underlying data

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).copy(); // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

cos() → {this} +

+ + + + + +
+ +

Returns the cosine of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([0, Math.PI / 2, Math.PI]).cos(); // => array([1, 0, -1])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

cosh() → {this} +

+ + + + + +
+ +

Returns the hyperbolic cosine of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([0, 1, 2]).cosh(); // => array([1, 1.5430806875228882, 3.762195587158203])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

cross(x) → {this} +

+ + + + + +
+ +

Computes the cross product of the current vector and the vector x +This operation can only calculated for vectors with three components. +Otherwise it throws an exception.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).cross([4, 5, 6]); // <=> array([-3, 6, -3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

det() → {Number} +

+ + + + + +
+ +

Gets the determinant of current matrix using LU factorization.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[0, 1], [2, 3]]).det(); // => -2
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

diagonal() → {this} +

+ + + + + +
+ +

Gets the diagonal of current matrix.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).diagonal(); // => array([1, 4])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

dot(x) → {Number} +

+ + + + + +
+ +

Performs dot multiplication with x and current array +Accelerated with BLAS ?dot.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).dot([4, 5, 6]); // => 32
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

eig() → {Array.<NDArray>} +

+ + + + + +
+ +

Gets eigenvalues and eigenvectors of the current matrix using the Jacobi method. +Accelerated with LAPACK ?geev.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Array.<NDArray> + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[1, 0, 0], [0, 2, 0], [0, 0, 3]]).eig(); // => [array([1, 2, 3]), array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])]
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

equals(x, tolerance) → {Boolean} +

+ + + + + +
+ +

Checks if current array and x are equal.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + tolerance + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Boolean + + +
  • + +
+ + + + +

Example

+ +
import { equals } from 'vectorious/core/equals';
+
+array([1, 2, 3]).equals([1, 2, 3]); // => true
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

equidimensional(x) +

+ + + + + +
+ +

Asserts if current array and x have the same shape

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + +

Deprecated

+ +
  • Yes
+ + + + + + + + + + + + + + + + +
+ + + + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).equidimensional([1, 2]); // Error: shapes 3 and 2 do not match
+ + + + + + + + + + + + +

Throws

+ + + +
+
+
+

shapes x and y do not match

+
+
+
+
+
+
+ Type +
+
+ + + + + Error + + + +
+
+
+
+
+ + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

equilateral(x) +

+ + + + + +
+ +

Asserts if current array and x have the same length

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + +

Deprecated

+ +
  • Yes
+ + + + + + + + + + + + + + + + +
+ + + + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).equilateral([1, 2]); // Error: lengths 3 and 2 do not match
+ + + + + + + + + + + + +

Throws

+ + + +
+
+
+

lengths x and y do not match

+
+
+
+
+
+
+ Type +
+
+ + + + + Error + + + +
+
+
+
+
+ + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

exp() → {this} +

+ + + + + +
+ +

Returns e^x of each element of current array, where x is the argument, +and e is Euler's constant (2.718…), the base of the natural logarithm.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).exp(); // <=> array([2.7182817459106445, 7.389056205749512, 20.08553695678711])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

expm1() → {this} +

+ + + + + +
+ +

Returns subtracting 1 from exp(x) of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).expm1(); // <=> array([1.7182817459106445, 6.389056205749512, 19.08553695678711])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

fill(value) → {this} +

+ + + + + +
+ +

Fills the current array with a scalar value

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + value + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).fill(0); // <=> array([0, 0, 0])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

floor() → {this} +

+ + + + + +
+ +

Returns the largest integer less than or equal to a number of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1.5, 2.5, 3.5]).floor(); // <=> array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

forEach(f) +

+ + + + + +
+ +

Equivalent to TypedArray.prototype.forEach.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + f + + + + + + + + function + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).forEach(console.log);
+// 1 0 [ 1, 2, 3 ]
+// 2 1 [ 1, 2, 3 ]
+// 3 2 [ 1, 2, 3 ]
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

fround() → {this} +

+ + + + + +
+ +

Returns the nearest single precision float representation of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([-5.05, 5.05]).fround(); // <=> array([-5.050000190734863, 5.050000190734863])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

gauss() → {NDArray} +

+ + + + + +
+ +

Gauss-Jordan elimination (i.e. returns the reduced row echelon form) of the current matrix. +Accelerated with LAPACK ?getrf.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[1, 2, 3], [4, 5, 6]]).gauss(); // <=> array([[1, 0, -1], [-0, 1, 2]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

get() → {Number} +

+ + + + + +
+ +

Gets the element at i, j, ..., n from current vector.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + ...indices + + + + + + + + Array.<Number> + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).get(2); // 3
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

inv() → {this} +

+ + + + + +
+ +

Determines the inverse of current matrix using Gaussian elimination. +Accelerated with LAPACK ?getri.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[2, -1, 0], [-1, 2, -1], [0, -1, 2]]).inv(); // <=> array([[0.75, 0.5, 0.25], [0.5, 1, 0.5], [0.25, 0.5, 0.75]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

log() → {this} +

+ + + + + +
+ +

Returns the natural logarithm (log_e, also ln) of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).log(); // <=> array([0, 0.6931471824645996, 1.0986123085021973])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

log1p() → {this} +

+ + + + + +
+ +

Returns the natural logarithm (log_e, also ln) of 1 + x for each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]); // <=> array([0.6931471824645996, 1.0986123085021973, 1.3862943649291992])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

log2() → {this} +

+ + + + + +
+ +

Returns the base 2 logarithm of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 4]).log2(); // => array([0, 1, 2])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

log10() → {this} +

+ + + + + +
+ +

Returns the base 10 logarithm of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([10, 100, 1000]).log10(); // <=> array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

lu() → {Array.<(NDArray|Int32Array)>} +

+ + + + + +
+ +

Performs full LU decomposition on current matrix. +Accelerated with LAPACK ?getrf.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Array.<(NDArray|Int32Array)> + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[1, 3, 5], [2, 4, 7], [1, 1, 0]]).lu(); // => [array([[1, 0, 0], [0.5, 1, 0], [0.5, -1, 1]]), array([[2, 4, 7], [0, 1, 1.5], [0, 0, -2]]), Int32Array([2, 2, 3])]
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

lu_factor() → {Array.<(NDArray|Int32Array)>} +

+ + + + + +
+ +

Performs LU factorization on current matrix. +Accelerated with LAPACK ?getrf.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Array.<(NDArray|Int32Array)> + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[1, 3, 5], [2, 4, 7], [1, 1, 0]]).lu_factor(); // <=> [array([[2, 4, 7], [0.5, 1, 1.5], [0.5, -1, -2]]), Int32Array([2, 2, 3])]
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

map() → {this} +

+ + + + + +
+ +

Equivalent to TypedArray.prototype.map.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).map(value => -value); // => array([-1, -2, -3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

max() → {Number} +

+ + + + + +
+ +

Gets the maximum value (smallest) element of current array. +Accelerated with BLAS i?amax.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).max(); // => 3
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

mean() → {Number} +

+ + + + + +
+ +

Gets the arithmetic mean of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).mean(); // => 2
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

min() → {Number} +

+ + + + + +
+ +

Gets the minimum value (smallest) element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).min(); // 1
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

multiply(x) → {NDArray} +

+ + + + + +
+ +

Multiplies current matrix with x. +Accelerated with BLAS ?gemm.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[1, 2]]).multiply([[1], [2]]); // <=> array([[5]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

norm() → {Number} +

+ + + + + +
+ +

Calculates the norm of current array (also called L2 norm or Euclidean length). +Accelerated with BLAS ?nrm2.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).norm(); // => 3.7416574954986572
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

normalize() → {this} +

+ + + + + +
+ +

Normalizes current vector.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).normalize(); // => array([0.26726123690605164, 0.5345224738121033, 0.8017836809158325])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

pow(exponent) → {this} +

+ + + + + +
+ +

Returns each element of current array to the exponent power, that is, element^exponent.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + exponent + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).pow(2); // <=> array([1, 4, 9])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

prod() → {Number} +

+ + + + + +
+ +

Product of all elements of current array

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).prod(); // => 6
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

product() → {NDArray} +

+ + + + + +
+ +

Hadamard product of current matrix and x

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).product([4, 5, 6]); // <=> array([4, 10, 18])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

project() → {NDArray} +

+ + + + + +
+ +

Projects the current vector onto x using the projection formula (y * (x * y / y * y)).

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).project([4, 5, 6]); // <=> array([1.6623376607894897, 2.0779221057891846, 2.49350643157959])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

push(value) → {this} +

+ + + + + +
+ +

Pushes a new value into current vector.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + value + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).push(4); // => array([1, 2, 3, 4])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

rank(tolerance) → {Number} +

+ + + + + +
+ +

Finds the rank of current matrix using gaussian elimination.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + tolerance + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

To Do

+
    +
  • Switch to SVD algorithm
  • +
+ +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[1, 1, 1], [2, 2, 2], [3, 3, 3]]).rank(); // => 1
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

reciprocal() → {this} +

+ + + + + +
+ +

Gets the element-wise reciprocal of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]); // => array([1, 0.5, 0.3333333432674408])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

reduce(f, initialValue) → {Number} +

+ + + + + +
+ +

Equivalent to TypedArray.prototype.reduce.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + f + + + + + + + + function + + + + + + + + + +
    + +
  • + + + +
  • + + initialValue + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).reduce((a, b) => a + b, 0); // => 6
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

reshape() → {this} +

+ + + + + +
+ +

Reshapes current array

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + ...shape + + + + + + + + Array.<Number> + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3, 4]).reshape(2, 2); // <=> array([[1, 2], [3, 4]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

round() → {this} +

+ + + + + +
+ +

Returns the value of each element of current array rounded to the nearest integer.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1.2, 2.8, 3.5]).round(); // <=> array([1, 3, 4])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

row_add(dest, source, scalar) → {this} +

+ + + + + +
+ +

Adds a multiple of one row multiplied by scalar to another inside current matrix.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + dest + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + source + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + scalar + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[1, 2], [3, 4]]).row_add(1, 0, 2); // <=> array([[1, 2], [5, 8]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

scale(scalar) → {this} +

+ + + + + +
+ +

Multiplies all elements of current array with a specified scalar. +Accelerated with BLAS ?scal.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + scalar + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).scale(2); // <=> array([2, 4, 6])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

set(value) → {this} +

+ + + + + +
+ +

Sets the element at i, j, ..., n to value.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + ...indices + + + + + + + + Array.<Number> + + + + + + + + + +
    + +
  • + + + +
  • + + value + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).set(1, 0); // <=> array([1, 0, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

sign() → {this} +

+ + + + + +
+ +

Returns the sign of each element of current array, indicating +whether it is positive, negative or zero.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).sign(); // <=> array([1, 1, 1])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

sin() → {this} +

+ + + + + +
+ +

Returns the sine of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([0, Math.PI / 2, Math.PI]).sin(); // <=> array([0, 1, 0])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

sinh() → {this} +

+ + + + + +
+ +

Returns the hyperbolic sine of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).sinh(); // <=> array([1.175201177597046, 3.6268603801727295, 10.017874717712402])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

slice(begin, end, step) → {this} +

+ + + + + +
+ +

Slices the current array in the corresponding dimension

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + begin + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + end + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + step + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3, 4]).slice(0, 4, 2); // => array([1, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

solve(x) → {NDArray} +

+ + + + + +
+ +

Solves the equation AX = B (where A is current matrix and B is x). +Accelerated with LAPACK ?gesv.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[1, 3, 5], [2, 4, 7], [1, 1, 0]]).solve([[1], [3], [5]]); // => array([[3.25], [1.75], [-1.5]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

sqrt() → {this} +

+ + + + + +
+ +

Returns the positive square root of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 4, 9]); // <=> array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

square() +

+ + + + + +
+ +

Asserts if current matrix is square.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).square(); // Error: matrix is not square
+ + + + + + + + + + + + +

Throws

+ + + +
+
+
+

matrix is not square

+
+
+
+
+
+
+ Type +
+
+ + + + + Error + + + +
+
+
+
+
+ + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

subtract() → {this} +

+ + + + + +
+ +

Subtracts x from the current array. +Accelerated with BLAS ?axpy.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).subtract([1, 1, 1]); // <=> array([0, 1, 2])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

sum() → {Number} +

+ + + + + +
+ +

Sum of array elements

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).sum(); // => 6
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

swap(i, j) → {this} +

+ + + + + +
+ +

Swaps two rows i and j in current matrix

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + i + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + j + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[1, 2], [3, 4]]); // <=> array([[3, 4], [1, 2]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

tan() → {this} +

+ + + + + +
+ +

Returns the tangent of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).tan(); // <=> array([1.5574077367782593, -2.185039758682251, -0.14254654943943024])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

tanh() → {this} +

+ + + + + +
+ +

Returns the hyperbolic tangent of each element of current array.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).tanh(); // <=> array([0.7615941762924194, 0.9640275835990906, 0.9950547814369202])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

toArray(index, dim) → {Array} +

+ + + + + +
+ +

Converts current vector into a JavaScript array.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + index + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + dim + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Array + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).toArray(); // => [1, 2, 3]
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

toString() → {String} +

+ + + + + +
+ +

Converts current vector into a readable formatted string.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + String + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).toString(); // => '1,2,3'
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

trace() → {Number} +

+ + + + + +
+ +

Gets the trace of the matrix (the sum of all diagonal elements).

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]).trace(); // => 5
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

transpose() → {this} +

+ + + + + +
+ +

Transposes current matrix (mirror across the diagonal).

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]); // <=> array([[1, 4, 7], [2, 5, 8], [3, 6, 9]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

trunc() → {this} +

+ + + + + +
+ +

Returns the integer part of each element of current array, +removing any fractional digits.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + this + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1.2, 2.8, 3.5]).trunc(); // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + + + \ No newline at end of file diff --git a/docs/vectorious/6.0.3/NDIter.html b/docs/vectorious/6.0.3/NDIter.html new file mode 100644 index 00000000..6fc24d2e --- /dev/null +++ b/docs/vectorious/6.0.3/NDIter.html @@ -0,0 +1,1088 @@ + + + + + Vectorious: NDIter + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

Class

+

NDIter

+ + + + + +
+ + +
+ + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ +

new NDIter(x) +

+ + + + + +
+ +

Constructs an NDIter instance.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +

Source

+ + + + + +
+ + + + + + + + + + + + + + + +

Methods

+ + + + + +
+ + + + + + + + + +
+ +
+ +

current() → {Object|Number|Boolean} +

+ + + + + +
+ +

Returns the current element of the iterator

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Object + + +

    current

    + +
  • + +
  • + + Number + + +

    [current.value]

    + +
  • + +
  • + + Boolean + + +

    current.done

    + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+import { NDIter } from 'vectorious/iterator';
+
+const iter = new NDIter(array([1, 2, 3]));
+iter.current(); // { value: 1, done: false }
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

done() → {Boolean} +

+ + + + + +
+ +

Returns true if the iterator is done, false otherwise

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Boolean + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+import { NDIter } from 'vectorious/iterator';
+
+const iter = new NDIter(array([1, 2, 3]));
+iter.done(); // false
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

next() → {Object} +

+ + + + + +
+ +

Steps to the next position in the iterator. +Returns the current index of the iterator, or undefined if done.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Object + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+import { NDIter } from 'vectorious/iterator';
+
+const iter = new NDIter(array([1, 2, 3]));
+iter.next(); // { value: 2, done: false }
+iter.next(); // { value: 3, done: false }
+iter.next(); // { done: true }
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

next1d() +

+ + + + + +
+ +

Steps to the next position in the iterator, assuming it is 1 dimensional.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

next2d() +

+ + + + + +
+ +

Steps to the next position in the iterator, assuming it is 2 dimensional.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

next2d() +

+ + + + + +
+ +

Steps to the next position in the iterator

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +

nextcontiguous() +

+ + + + + +
+ +

Steps to the next position in the iterator, assuming its data is contiguous.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + + + \ No newline at end of file diff --git a/docs/vectorious/6.0.3/NDMultiIter.html b/docs/vectorious/6.0.3/NDMultiIter.html new file mode 100644 index 00000000..ec713034 --- /dev/null +++ b/docs/vectorious/6.0.3/NDMultiIter.html @@ -0,0 +1,701 @@ + + + + + Vectorious: NDMultiIter + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

Class

+

NDMultiIter

+ + + + + +
+ + +
+ + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ +

new NDMultiIter() +

+ + + + + +
+ +

Constructs an NDMultiIter instance.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + ...args + + + + + + + + Array.<NDArray> + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +

Source

+ + + + + +
+ + + + + + + + + + + + + + + +

Methods

+ + + + + +
+ + + + + + + + + +
+ static +
+ +

current() → {Object|Array.<Number>|Boolean} +

+ + + + + +
+ +

Returns the current indices of the iterators

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Object + + +

    current

    + +
  • + +
  • + + Array.<Number> + + +

    [current.value]

    + +
  • + +
  • + + Boolean + + +

    current.done

    + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+import { NDMultiIter } from 'vectorious/iterator';
+
+const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6]));
+iter.current(); // { value: [0, 0], done: false }
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

done() → {Boolean} +

+ + + + + +
+ +

Returns true if the iterator is done, false otherwise

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Boolean + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+import { NDMultiIter } from 'vectorious/iterator';
+
+const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6]));
+iter.done(); // false
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

next() → {Object|Array.<Number>|Boolean} +

+ + + + + +
+ +

Steps to the next position in the iterator. +Returns the current indices of the iterators, or undefined if done.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Object + + +

    current

    + +
  • + +
  • + + Array.<Number> + + +

    [current.value]

    + +
  • + +
  • + + Boolean + + +

    current.done

    + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+import { NDMultiIter } from 'vectorious/iterator';
+
+const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6]));
+iter.next(); // { value: [0, 0], done: false }
+iter.next(); // { value: [1, 1], done: false }
+iter.next(); // { value: [2, 2], done: false },
+iter.next(); // { value: undefined, done: true },
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + + + \ No newline at end of file diff --git a/docs/vectorious/6.0.3/core_abs.js.html b/docs/vectorious/6.0.3/core_abs.js.html new file mode 100644 index 00000000..04b9784f --- /dev/null +++ b/docs/vectorious/6.0.3/core_abs.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/abs.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/abs.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.abs = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { abs: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function abs
+ * @description Returns the absolute value of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { abs } from 'vectorious/core/abs';
+ *
+ * abs([-1, -2, -3]) // => array([1, 2, 3])
+ */
+const abs = (x) => array_1.array(x).abs();
+exports.abs = abs;
+/**
+ * @function abs
+ * @memberof NDArray.prototype
+ * @description Returns the absolute value of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([-1, -2, -3]).abs() // <=> array([1, 2, 3])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_acos.js.html b/docs/vectorious/6.0.3/core_acos.js.html new file mode 100644 index 00000000..238f0bed --- /dev/null +++ b/docs/vectorious/6.0.3/core_acos.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/acos.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/acos.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.acos = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { acos: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function acos
+ * @description Returns the arccosine of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { acos } from 'vectorious/core/acos';
+ *
+ * acos([-1, 0, 1]); // => array([3.141592653589793, 1.5707963267948966, 0])
+ */
+const acos = (x) => array_1.array(x).acos();
+exports.acos = acos;
+/**
+ * @function acos
+ * @memberof NDArray.prototype
+ * @description Returns the arccosine of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([-1, 0, 1]).acos(); // <=> array([3.141592653589793, 1.5707963267948966, 0])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_acosh.js.html b/docs/vectorious/6.0.3/core_acosh.js.html new file mode 100644 index 00000000..482a7d58 --- /dev/null +++ b/docs/vectorious/6.0.3/core_acosh.js.html @@ -0,0 +1,153 @@ + + + + + Vectorious: core/acosh.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/acosh.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.acosh = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { acosh: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function acosh
+ * @description Returns the hyperbolic arccosine of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { acosh } from 'vectorious/core/acosh';
+ *
+ * acosh([1, 2, 3]); // => array([0, 1.316957950592041, 1.7627471685409546])
+ */
+const acosh = (x) => array_1.array(x).acosh();
+exports.acosh = acosh;
+/**
+ * @function acosh
+ * @memberof NDArray.prototype
+ * @description Returns the hyperbolic arccosine of each element of current array.
+ * @param {NDArray} x
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).acosh(); // <=> array([0, 1.316957950592041, 1.7627471685409546])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_add.js.html b/docs/vectorious/6.0.3/core_add.js.html new file mode 100644 index 00000000..bbbd6bef --- /dev/null +++ b/docs/vectorious/6.0.3/core_add.js.html @@ -0,0 +1,183 @@ + + + + + Vectorious: core/add.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/add.js

+ + + + + + +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.add = void 0;
+const iterator_1 = require("../iterator");
+const array_1 = require("./array");
+const blas = __importStar(require("../blas"));
+/**
+ * @static
+ * @memberof module:Globals
+ * @function add
+ * @description
+ * Adds `y` multiplied by `alpha` to `x`.
+ * Accelerated with BLAS `?axpy`.
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @returns {NDArray}
+ * @example
+ * import { add } from 'vectorious/core/add';
+ *
+ * add([1, 2, 3], [4, 5, 6]); // => array([5, 7, 9])
+ */
+const add = (x, y, alpha = 1) => array_1.array(x).add(array_1.array(y), alpha);
+exports.add = add;
+/**
+ * @function add
+ * @memberof NDArray.prototype
+ * @description
+ * Adds `x` multiplied by `alpha` to the current array.
+ * Accelerated with BLAS `?axpy`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).add([4, 5, 6]); // <=> array([5, 7, 9])
+ */
+function default_1(x, alpha = 1) {
+    const { data: d1, length: l1, dtype } = this;
+    const { data: d2 } = array_1.array(x);
+    try {
+        blas.axpy(dtype, l1, alpha, d2, 1, d1, 1);
+    }
+    catch (err) {
+        const iter = new iterator_1.NDMultiIter(this, x);
+        for (const [i, j] of iter) {
+            d1[i] += alpha * d2[j];
+        }
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_angle.js.html b/docs/vectorious/6.0.3/core_angle.js.html new file mode 100644 index 00000000..106df4c2 --- /dev/null +++ b/docs/vectorious/6.0.3/core_angle.js.html @@ -0,0 +1,148 @@ + + + + + Vectorious: core/angle.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/angle.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.angle = void 0;
+const array_1 = require("./array");
+const { acos: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function angle
+ * @description Determines the angle between the `x` and `y`
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @returns {number}
+ * @example
+ * import { angle } from 'vectorious/core/angle';
+ *
+ * angle([1, 2, 3], [4, 5, 6]); // => 0.22572622788897287
+ */
+const angle = (x, y) => array_1.array(x).angle(array_1.array(y));
+exports.angle = angle;
+/**
+ * @function angle
+ * @memberof NDArray.prototype
+ * @description Determines the angle between the current vector and `x`.
+ * @param {NDArray} x
+ * @returns {number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).angle([4, 5, 6]); // <=> 0.22572622788897287
+ */
+function default_1(x) {
+    return f(this.dot(array_1.array(x)) / this.norm() / array_1.array(x).norm());
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_array.js.html b/docs/vectorious/6.0.3/core_array.js.html new file mode 100644 index 00000000..51daac40 --- /dev/null +++ b/docs/vectorious/6.0.3/core_array.js.html @@ -0,0 +1,130 @@ + + + + + Vectorious: core/array.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/array.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.array = void 0;
+const _1 = require("./");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function array
+ * @description `array(...args)` is an alias for `new v(...args)`
+ * @param {} ...args
+ * @returns {NDArray}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]); // => array([1, 2, 3])
+ */
+const array = (...args) => new _1.NDArray(...args);
+exports.array = array;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_asin.js.html b/docs/vectorious/6.0.3/core_asin.js.html new file mode 100644 index 00000000..8cb7c1ed --- /dev/null +++ b/docs/vectorious/6.0.3/core_asin.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/asin.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/asin.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.asin = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { asin: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function asin
+ * @description Returns the arcsine of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { asin } from 'vectorious/core/asin';
+ *
+ * asin([-1, 0, 1]) // => array([-1.5707963705062866, 0, 1.5707963705062866])
+ */
+const asin = (x) => array_1.array(x).asin();
+exports.asin = asin;
+/**
+ * @function asin
+ * @memberof NDArray.prototype
+ * @description Returns the arcsine of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([-1, 0, 1]).asin() // <=> array([-1.5707963705062866, 0, 1.5707963705062866])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_asinh.js.html b/docs/vectorious/6.0.3/core_asinh.js.html new file mode 100644 index 00000000..b9ae6aa3 --- /dev/null +++ b/docs/vectorious/6.0.3/core_asinh.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/asinh.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/asinh.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.asinh = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { asinh: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function asinh
+ * @description Returns the hyperbolic arcsine of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { asinh } from 'vectorious/core/asinh';
+ *
+ * asinh([0, 1, 2]) // => array([0, 0.8813735842704773, 1.4436354637145996])
+ */
+const asinh = (x) => array_1.array(x).asinh();
+exports.asinh = asinh;
+/**
+ * @function asinh
+ * @memberof NDArray.prototype
+ * @description Returns the hyperbolic arcsine of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([0, 1, 2]).asinh() // <=> array([0, 0.8813735842704773, 1.4436354637145996])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_atan.js.html b/docs/vectorious/6.0.3/core_atan.js.html new file mode 100644 index 00000000..bcb130fd --- /dev/null +++ b/docs/vectorious/6.0.3/core_atan.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/atan.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/atan.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.atan = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { atan: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function atan
+ * @description Returns the arctangent of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { atan } from 'vectorious/core/atan';
+ *
+ * atan([1, 2, 3]); // => array([0.7853981852531433, 1.1071487665176392, 1.249045729637146])
+ */
+const atan = (x) => array_1.array(x).atan();
+exports.atan = atan;
+/**
+ * @function atan
+ * @memberof NDArray.prototype
+ * @description Returns the arctangent of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).atan() // <=> array([0.7853981852531433, 1.1071487665176392, 1.249045729637146])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_atanh.js.html b/docs/vectorious/6.0.3/core_atanh.js.html new file mode 100644 index 00000000..c8a2094b --- /dev/null +++ b/docs/vectorious/6.0.3/core_atanh.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/atanh.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/atanh.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.atanh = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { atanh: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function atanh
+ * @description Returns the hyperbolic arctangent of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { atanh } from 'vectorious/core/atanh';
+ *
+ * atanh([0, -0.5]); // => array([0, -0.5493061542510986])
+ */
+const atanh = (x) => array_1.array(x).atanh();
+exports.atanh = atanh;
+/**
+ * @function atanh
+ * @memberof NDArray.prototype
+ * @description Returns the hyperbolic arctangent of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([0, -0.5]).atanh(); // <=> array([0, -0.5493061542510986])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_augment.js.html b/docs/vectorious/6.0.3/core_augment.js.html new file mode 100644 index 00000000..56e6304a --- /dev/null +++ b/docs/vectorious/6.0.3/core_augment.js.html @@ -0,0 +1,172 @@ + + + + + Vectorious: core/augment.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/augment.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.augment = void 0;
+const array_1 = require("./array");
+const zeros_1 = require("./zeros");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function augment
+ * @description Augments `x` and `y`.
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @returns {NDArray}
+ * @example
+ * import { augment } from 'vectorious/core/augment';
+ *
+ * augment([[1, 2], [3, 4]], [[1], [2]]); // => array([[1, 2, 1], [3, 4, 2]])
+ */
+const augment = (x, y) => array_1.array(x).augment(array_1.array(y));
+exports.augment = augment;
+/**
+ * @function augment
+ * @memberof NDArray.prototype
+ * @description Augments `x` with current matrix.
+ * @param {NDArray} x
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[1, 2], [3, 4]]).augment(array([[1], [2]])); // <=> array([[1, 2, 1], [3, 4, 2]])
+ */
+function default_1(x) {
+    const [r1, c1] = this.shape;
+    const [r2, c2] = array_1.array(x).shape;
+    const { data: d1 } = this;
+    const { data: d2 } = array_1.array(x);
+    if (r2 === 0 || c2 === 0) {
+        return this;
+    }
+    if (r1 !== r2) {
+        throw new Error('rows do not match');
+    }
+    const y = zeros_1.zeros(r1, c1 + c2);
+    const { data: d3 } = y;
+    let i;
+    let j;
+    for (i = 0; i < r1; i += 1) {
+        for (j = 0; j < c1; j += 1) {
+            d3[i * (c1 + c2) + j] = d1[i * c1 + j];
+        }
+    }
+    for (i = 0; i < r2; i += 1) {
+        for (j = 0; j < c2; j += 1) {
+            d3[i * (c1 + c2) + (j + c1)] = d2[i * c2 + j];
+        }
+    }
+    return y;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_binOp.js.html b/docs/vectorious/6.0.3/core_binOp.js.html new file mode 100644 index 00000000..3e4be7e6 --- /dev/null +++ b/docs/vectorious/6.0.3/core_binOp.js.html @@ -0,0 +1,154 @@ + + + + + Vectorious: core/binOp.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/binOp.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.binOp = void 0;
+const iterator_1 = require("../iterator");
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function binOp
+ * @description Perform binary operation `f` on `y` in `x`.
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @returns {NDArray}
+ * @example
+ * import { binOp } from 'vectorious/core/binOp';
+ *
+ * binOp([1, 2, 3], [4, 5, 6], (a, b) => a + b); // => array([[5, 7, 9])
+ */
+const binOp = (x, y, f) => array_1.array(x).binOp(array_1.array(y), f);
+exports.binOp = binOp;
+/**
+ * @function binOp
+ * @memberof NDArray.prototype
+ * @description Perform binary operation `f` on `x` in the current array.
+ * @param {NDArray} x
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).binOp([4, 5, 6], (a, b) => a + b); // => array([[5, 7, 9])
+ */
+function default_1(x, f) {
+    const { data: d1 } = this;
+    const { data: d2 } = array_1.array(x);
+    const iter = new iterator_1.NDMultiIter(this, x);
+    for (const [i, j] of iter) {
+        d1[i] = f(d1[i], d2[j], i);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_cbrt.js.html b/docs/vectorious/6.0.3/core_cbrt.js.html new file mode 100644 index 00000000..8c411b92 --- /dev/null +++ b/docs/vectorious/6.0.3/core_cbrt.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/cbrt.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/cbrt.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.cbrt = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { cbrt: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function cbrt
+ * @description Returns the cube root of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { cbrt } from 'vectorious/core/cbrt';
+ *
+ * cbrt([1, 8, 27]); // => array([1, 2, 3])
+ */
+const cbrt = (x) => array_1.array(x).cbrt();
+exports.cbrt = cbrt;
+/**
+ * @function cbrt
+ * @memberof NDArray.prototype
+ * @description Returns the cube root of each element of current array.
+ * @returns {this}
+ * @example
+ * import { cbrt } from 'vectorious/core/cbrt';
+ *
+ * cbrt([1, 8, 27]); // => array([1, 2, 3])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_ceil.js.html b/docs/vectorious/6.0.3/core_ceil.js.html new file mode 100644 index 00000000..852d4b5d --- /dev/null +++ b/docs/vectorious/6.0.3/core_ceil.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/ceil.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/ceil.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ceil = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { ceil: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function ceil
+ * @description Returns smallest integer greater than or equal to of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { ceil } from 'vectorious/core/ceil';
+ *
+ * ceil([0.5, 1.5, 2.5]); // => array([1, 2, 3])
+ */
+const ceil = (x) => array_1.array(x).ceil();
+exports.ceil = ceil;
+/**
+ * @function ceil
+ * @memberof NDArray.prototype
+ * @description Returns smallest integer greater than or equal to of each element of current array.
+ * @returns {NDArray}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([0.5, 1.5, 2.5]).ceil(); // <=> array([1, 2, 3])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_check.js.html b/docs/vectorious/6.0.3/core_check.js.html new file mode 100644 index 00000000..aaf6970e --- /dev/null +++ b/docs/vectorious/6.0.3/core_check.js.html @@ -0,0 +1,160 @@ + + + + + Vectorious: core/check.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/check.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.check = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function check
+ * @description Asserts if indices `i, j, ..., n` are within the bounds of `x`
+ * @param {NDArray} x
+ * @param {Number[]} ...indices
+ * @throws {Error} index out of bounds
+ * @example
+ * import { check } from 'vectorious/core/check';
+ *
+ * check([0.5, 1.5, 2.5], 3); // Error: index out of bounds
+ */
+const check = (x, ...indices) => {
+    array_1.array(x).check(...indices);
+};
+exports.check = check;
+/**
+ * @function check
+ * @memberof NDArray.prototype
+ * @description Asserts if indices `i, j, ..., n` are within the bounds of current array
+ * @param {Number[]} ...indices
+ * @throws {Error} index out of bounds
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([0.5, 1.5, 2.5]).check(3); // Error: index out of bounds
+ */
+function default_1(...indices) {
+    const { shape: s1, length: l1 } = this;
+    if (indices.length === 1) {
+        const [i] = indices;
+        if (i < 0 || i > l1 - 1 || !Number.isFinite(i)) {
+            throw new Error('index out of bounds');
+        }
+    }
+    else if (!s1.every((dim, i) => dim > indices[i]
+        && Number.isFinite(indices[i])
+        && indices[i] >= 0)) {
+        throw new Error('index out of bounds');
+    }
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_combine.js.html b/docs/vectorious/6.0.3/core_combine.js.html new file mode 100644 index 00000000..a78fb99a --- /dev/null +++ b/docs/vectorious/6.0.3/core_combine.js.html @@ -0,0 +1,169 @@ + + + + + Vectorious: core/combine.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/combine.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.combine = void 0;
+const util_1 = require("../util");
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function combine
+ * @description Combines the vector `x` with `y`
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @returns {NDArray}
+ * @example
+ * import { combine } from 'vectorious/core/combine';
+ *
+ * combine([1, 2, 3], [4, 5, 6]); // => array([1, 2, 3, 4, 5, 6])
+ */
+const combine = (x, y) => array_1.array(x).combine(array_1.array(y));
+exports.combine = combine;
+/**
+ * @function combine
+ * @memberof NDArray.prototype
+ * @description Combines the current vector with `x`
+ * @param {NDArray} x
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).combine([4, 5, 6]); // => array([1, 2, 3, 4, 5, 6])
+ */
+function default_1(x) {
+    if (this.shape.length !== 1 && x.shape.length !== 1) {
+        throw new Error('combine operation not permitted for multidimensional arrays');
+    }
+    const { length: l1, data: d1 } = this;
+    const { length: l2, data: d2 } = x;
+    if (l2 === 0) {
+        return this;
+    }
+    if (l1 === 0) {
+        this.data = new (util_1.get_type(x.dtype))(d2);
+        this.length = l2;
+        this.dtype = x.dtype;
+        return this;
+    }
+    const l3 = l1 + l2;
+    const d3 = new (util_1.get_type(this.dtype))(l3);
+    d3.set(d1);
+    d3.set(d2, l1);
+    this.data = d3;
+    this.length = l3;
+    this.shape = [l3];
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_copy.js.html b/docs/vectorious/6.0.3/core_copy.js.html new file mode 100644 index 00000000..75e7d9d0 --- /dev/null +++ b/docs/vectorious/6.0.3/core_copy.js.html @@ -0,0 +1,154 @@ + + + + + Vectorious: core/copy.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/copy.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.copy = void 0;
+const array_1 = require("./array");
+const zeros_1 = require("./zeros");
+const iterator_1 = require("../iterator");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function copy
+ * @description Makes a copy of `x`
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { copy } from 'vectorious/core/copy';
+ *
+ * copy([1, 2, 3]); // => array([1, 2, 3])
+ */
+const copy = (x) => array_1.array(x).copy();
+exports.copy = copy;
+/**
+ * @function copy
+ * @memberof NDArray.prototype
+ * @description Makes a copy of the class and underlying data
+ * @returns {NDArray}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).copy(); // => array([1, 2, 3])
+ */
+function default_1() {
+    const x = zeros_1.zeros(...this.shape);
+    const { data: d1 } = this;
+    const { data: d2 } = x;
+    const iter = new iterator_1.NDMultiIter(this, x);
+    for (const [i, j] of iter) {
+        d2[j] = d1[i];
+    }
+    return x;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_cos.js.html b/docs/vectorious/6.0.3/core_cos.js.html new file mode 100644 index 00000000..ce1256b4 --- /dev/null +++ b/docs/vectorious/6.0.3/core_cos.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/cos.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/cos.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.cos = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { cos: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function cos
+ * @description Returns the cosine of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { cos } from 'vectorious/core/cos';
+ *
+ * cos([0, Math.PI / 2, Math.PI]); // => array([1, 0, -1])
+ */
+const cos = (x) => array_1.array(x).cos();
+exports.cos = cos;
+/**
+ * @function cos
+ * @memberof NDArray.prototype
+ * @description Returns the cosine of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([0, Math.PI / 2, Math.PI]).cos(); // => array([1, 0, -1])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_cosh.js.html b/docs/vectorious/6.0.3/core_cosh.js.html new file mode 100644 index 00000000..bbeb0cd3 --- /dev/null +++ b/docs/vectorious/6.0.3/core_cosh.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/cosh.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/cosh.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.cosh = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { cosh: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function cosh
+ * @description Returns the hyperbolic cosine of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { cosh } from 'vectorious/core/cosh';
+ *
+ * cosh([0, 1, 2]); // => array([1, 1.5430806875228882, 3.762195587158203])
+ */
+const cosh = (x) => array_1.array(x).cosh();
+exports.cosh = cosh;
+/**
+ * @function cosh
+ * @memberof NDArray.prototype
+ * @description Returns the hyperbolic cosine of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([0, 1, 2]).cosh(); // => array([1, 1.5430806875228882, 3.762195587158203])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_cross.js.html b/docs/vectorious/6.0.3/core_cross.js.html new file mode 100644 index 00000000..d063c785 --- /dev/null +++ b/docs/vectorious/6.0.3/core_cross.js.html @@ -0,0 +1,164 @@ + + + + + Vectorious: core/cross.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/cross.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.cross = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function cross
+ * @description
+ * Computes the cross product of the `x` and the vector `y`
+ * This operation can only calculated for vectors with three components.
+ * Otherwise it throws an exception.
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @returns {NDArray}
+ * @example
+ * import { cross } from 'vectorious/core/cross';
+ *
+ * cross([1, 2, 3], [4, 5, 6]); // => array([-3, 6, -3])
+ */
+const cross = (x, y) => array_1.array(x).cross(array_1.array(y));
+exports.cross = cross;
+/**
+ * @function cross
+ * @memberof NDArray.prototype
+ * @description
+ * Computes the cross product of the current vector and the vector `x`
+ * This operation can only calculated for vectors with three components.
+ * Otherwise it throws an exception.
+ * @param {NDArray} x
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).cross([4, 5, 6]); // <=> array([-3, 6, -3])
+ */
+function default_1(x) {
+    const { length: l1 } = this;
+    const { length: l2 } = x;
+    if (l1 !== 3 || l2 !== 3) {
+        throw new Error('vectors must have three components');
+    }
+    const c1 = this.y * x.z - this.z * x.y;
+    const c2 = this.z * x.x - this.x * x.z;
+    const c3 = this.x * x.y - this.y * x.x;
+    this.x = c1;
+    this.y = c2;
+    this.z = c3;
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_det.js.html b/docs/vectorious/6.0.3/core_det.js.html new file mode 100644 index 00000000..312c36bd --- /dev/null +++ b/docs/vectorious/6.0.3/core_det.js.html @@ -0,0 +1,158 @@ + + + + + Vectorious: core/det.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/det.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.det = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function det
+ * @description Gets the determinant of `x`.
+ * @param {NDArray} x
+ * @returns {Number}
+ * @example
+ * import { det } from 'vectorious/core/det';
+ *
+ * det([[0, 1], [2, 3]]); // => -2
+ */
+const det = (x) => array_1.array(x).det();
+exports.det = det;
+/**
+ * @function det
+ * @memberof NDArray.prototype
+ * @description Gets the determinant of current matrix using LU factorization.
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[0, 1], [2, 3]]).det(); // => -2
+ */
+function default_1() {
+    this.square();
+    const [n] = this.shape;
+    const [LU, ipiv] = this.copy().lu_factor();
+    const { data: d1 } = LU;
+    let product = 1;
+    let sign = 1;
+    let i;
+    for (i = 0; i < n; i += 1) {
+        product *= d1[i * n + i];
+        if (i !== ipiv[i] - 1) {
+            sign *= -1;
+        }
+    }
+    return sign * product;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_diagonal.js.html b/docs/vectorious/6.0.3/core_diagonal.js.html new file mode 100644 index 00000000..e100d46a --- /dev/null +++ b/docs/vectorious/6.0.3/core_diagonal.js.html @@ -0,0 +1,149 @@ + + + + + Vectorious: core/diagonal.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/diagonal.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.diagonal = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function diagonal
+ * @description Gets the diagonal of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { diagonal } from 'vectorious/core/diagonal';
+ *
+ * diagonal([[1, 2], [3, 4]]); // => array([1, 4])
+ */
+const diagonal = (x) => array_1.array(x).diagonal();
+exports.diagonal = diagonal;
+/**
+ * @function diagonal
+ * @memberof NDArray.prototype
+ * @description Gets the diagonal of current matrix.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).diagonal(); // => array([1, 4])
+ */
+function default_1() {
+    this.square();
+    const { length: l1 } = this;
+    const [r, c] = this.shape;
+    const l2 = Math.min(r, c);
+    return this.reshape(l1).slice(0, l1, l2 + 1);
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_dot.js.html b/docs/vectorious/6.0.3/core_dot.js.html new file mode 100644 index 00000000..be7d1888 --- /dev/null +++ b/docs/vectorious/6.0.3/core_dot.js.html @@ -0,0 +1,184 @@ + + + + + Vectorious: core/dot.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/dot.js

+ + + + + + +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.dot = void 0;
+const iterator_1 = require("../iterator");
+const array_1 = require("./array");
+const blas = __importStar(require("../blas"));
+/**
+ * @static
+ * @memberof module:Globals
+ * @function dot
+ * @description
+ * Performs dot multiplication with `x` and `y`.
+ * Accelerated with BLAS `?dot`.
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @returns {Number}
+ * @example
+ * import { dot } from 'vectorious/core/dot';
+ *
+ * dot([1, 2, 3], [4, 5, 6]); // => 32
+ */
+const dot = (x, y) => array_1.array(x).dot(array_1.array(y));
+exports.dot = dot;
+/**
+ * @function dot
+ * @memberof NDArray.prototype
+ * @description
+ * Performs dot multiplication with `x` and current array
+ * Accelerated with BLAS `?dot`.
+ * @param {NDArray} x
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).dot([4, 5, 6]); // => 32
+ */
+function default_1(x) {
+    const { data: d1, length: l1, dtype } = this;
+    const { data: d2 } = x;
+    let result = 0;
+    try {
+        result = blas.dot(dtype, l1, d2, 1, d1, 1);
+    }
+    catch (err) {
+        const iter = new iterator_1.NDMultiIter(this, x);
+        for (const [i, j] of iter) {
+            result += d1[i] * d2[j];
+        }
+    }
+    return result;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_eig.js.html b/docs/vectorious/6.0.3/core_eig.js.html new file mode 100644 index 00000000..10cdeede --- /dev/null +++ b/docs/vectorious/6.0.3/core_eig.js.html @@ -0,0 +1,249 @@ + + + + + Vectorious: core/eig.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/eig.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.eig = void 0;
+const util_1 = require("../util");
+const array_1 = require("./array");
+const zeros_1 = require("./zeros");
+const eye_1 = require("./eye");
+let nlapack;
+try {
+    nlapack = require('nlapack');
+}
+catch (err) { }
+/**
+ * @ignore
+ *  ┌   ┐    ┌     ┐┌   ┐
+ *  │Skl│    │c  −s││Skl│
+ *  │   │ := │     ││   │
+ *  │Sij│    │s   c││Sij│
+ *  └   ┘    └     ┘└   ┘
+ */
+const rotate = (x, c, s, k, l, i, j) => {
+    const [n] = x.shape;
+    const { data: d1 } = x;
+    const temp = d1[k * n + l];
+    const tau = 1 / (c + s);
+    d1[k * n + l] = temp - s * (d1[i * n + j] + tau * temp);
+    d1[i * n + j] += s * (temp - tau * d1[i * n + j]);
+};
+/**
+ * @static
+ * @memberof module:Globals
+ * @function eig
+ * @description
+ * Gets eigenvalues and eigenvectors of `x` using the Jacobi method.
+ * Accelerated with LAPACK `?geev`.
+ * @param {NDArray} x
+ * @returns {Array<NDArray>}
+ * @example
+ * import { eig } from 'vectorious/core/eig';
+ *
+ * eig([[1, 0, 0], [0, 2, 0], [0, 0, 3]]); // => [array([1, 2, 3]), array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])]
+ */
+const eig = (x) => array_1.array(x).eig();
+exports.eig = eig;
+/**
+ * @function eig
+ * @memberof NDArray.prototype
+ * @description
+ * Gets eigenvalues and eigenvectors of the current matrix using the Jacobi method.
+ * Accelerated with LAPACK `?geev`.
+ * @returns {Array<NDArray>}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[1, 0, 0], [0, 2, 0], [0, 0, 3]]).eig(); // => [array([1, 2, 3]), array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])]
+ */
+function default_1() {
+    this.square();
+    const [n] = this.shape;
+    try {
+        if (!['float32', 'float64'].includes(this.dtype)) {
+            this.dtype = 'float32';
+            this.data = util_1.get_type(this.dtype).from(this.data);
+        }
+        const jobvl = nlapack.NoEigenvector;
+        const jobvr = nlapack.Eigenvector;
+        const wr = zeros_1.zeros(n);
+        const wi = zeros_1.zeros(n);
+        const vl = zeros_1.zeros(n, n);
+        const vr = zeros_1.zeros(n, n);
+        const { data: d1 } = this;
+        const { data: d2 } = wr;
+        const { data: d3 } = wi;
+        const { data: d4 } = vl;
+        const { data: d5 } = vr;
+        if (this.dtype === 'float64') {
+            nlapack.dgeev(jobvl, jobvr, n, d1, n, d2, d3, d4, n, d5, n);
+        }
+        if (this.dtype === 'float32') {
+            nlapack.sgeev(jobvl, jobvr, n, d1, n, d2, d3, d4, n, d5, n);
+        }
+        return [wr, vr];
+    }
+    catch (err) {
+        const { data: d1 } = this;
+        const p = eye_1.eye(n);
+        let max = 0;
+        let i = 0;
+        let j = 0;
+        let k = 0;
+        let l = 0;
+        do {
+            // Find maximum off-diagonal element
+            for (i = 0; i < n; i += 1) {
+                for (j = i + 1; j < n; j += 1) {
+                    if (Math.abs(d1[i * n + j]) >= max) {
+                        max = Math.abs(d1[i * n + j]);
+                        k = i;
+                        l = j;
+                    }
+                }
+            }
+            // Find c and s
+            let t;
+            if (Math.abs(d1[k * n + l]) < Math.abs(d1[l * n + l]) * 1e-36) {
+                t = d1[k * n + l] / d1[l * n + l];
+            }
+            else {
+                const phi = d1[l * n + l] / 2 * d1[k * n + l];
+                t = 1 / (Math.abs(phi) + Math.sqrt(phi * phi + 1));
+            }
+            const c = 1 / Math.sqrt(t * t + 1);
+            const s = t * c;
+            const e = d1[k * n + l];
+            d1[k * n + l] = 0;
+            d1[k * n + k] -= t * e;
+            d1[l * n + l] += t * e;
+            // Rotate rows and columns k and l
+            for (i = 0; i < k; i += 1) {
+                rotate(this, c, s, i, k, i, l);
+            }
+            for (i = k + 1; i < l; i += 1) {
+                rotate(this, c, s, k, i, i, l);
+            }
+            for (i = l + 1; i < n; i += 1) {
+                rotate(this, c, s, k, i, l, i);
+            }
+            // Rotate eigenvectors
+            for (i = 0; i < n; i += 1) {
+                rotate(p, c, s, i, k, i, l);
+            }
+        } while (max >= 1e-9);
+        return [this.diagonal(), p];
+    }
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_equals.js.html b/docs/vectorious/6.0.3/core_equals.js.html new file mode 100644 index 00000000..2cc22ba5 --- /dev/null +++ b/docs/vectorious/6.0.3/core_equals.js.html @@ -0,0 +1,158 @@ + + + + + Vectorious: core/equals.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/equals.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.equals = void 0;
+const iterator_1 = require("../iterator");
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function equals
+ * @description Checks if `x` and `y` are equal.
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @param {Number} tolerance
+ * @returns {Boolean}
+ * @example
+ * import { equals } from 'vectorious/core/equals';
+ *
+ * equals([1, 2, 3], [1, 2, 3]); // => true
+ */
+const equals = (x, y, tolerance = 1e-6) => array_1.array(x).equals(array_1.array(y), tolerance);
+exports.equals = equals;
+/**
+ * @function equals
+ * @memberof NDArray.prototype
+ * @description Checks if current array and `x` are equal.
+ * @param {NDArray} x
+ * @param {Number} tolerance
+ * @returns {Boolean}
+ * @example
+ * import { equals } from 'vectorious/core/equals';
+ *
+ * array([1, 2, 3]).equals([1, 2, 3]); // => true
+ */
+function default_1(x, tolerance = 1e-6) {
+    const { data: d1 } = this;
+    const { data: d2 } = x;
+    const iter = new iterator_1.NDMultiIter(this, x);
+    for (const [i, j] of iter) {
+        if (Math.abs(d1[i] - d2[j]) > tolerance) {
+            return false;
+        }
+    }
+    return true;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_equidimensional.js.html b/docs/vectorious/6.0.3/core_equidimensional.js.html new file mode 100644 index 00000000..61ea326c --- /dev/null +++ b/docs/vectorious/6.0.3/core_equidimensional.js.html @@ -0,0 +1,155 @@ + + + + + Vectorious: core/equidimensional.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/equidimensional.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.equidimensional = void 0;
+const array_1 = require("./array");
+/**
+ * @deprecated
+ * @static
+ * @memberof module:Globals
+ * @function equidimensional
+ * @description Asserts if `x` and `y` have the same shape
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @throws {Error} shapes x and y do not match
+ * @example
+ * import { equidimensional } from 'vectorious/core/equidimensional';
+ *
+ * equidimensional([1, 2, 3], [1, 2]); // Error: shapes 3 and 2 do not match
+ */
+const equidimensional = (x, y) => {
+    array_1.array(x).equidimensional(array_1.array(y));
+};
+exports.equidimensional = equidimensional;
+/**
+ * @deprecated
+ * @function equidimensional
+ * @memberof NDArray.prototype
+ * @description Asserts if current array and `x` have the same shape
+ * @param {NDArray} x
+ * @throws {Error} shapes x and y do not match
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).equidimensional([1, 2]); // Error: shapes 3 and 2 do not match
+ */
+function default_1(x) {
+    const { shape: s1 } = this;
+    const { shape: s2 } = x;
+    if (!s1.every((dim, i) => dim === s2[i])) {
+        throw new Error(`shapes ${s1} and ${s2} do not match`);
+    }
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_equilateral.js.html b/docs/vectorious/6.0.3/core_equilateral.js.html new file mode 100644 index 00000000..cb88b1c8 --- /dev/null +++ b/docs/vectorious/6.0.3/core_equilateral.js.html @@ -0,0 +1,155 @@ + + + + + Vectorious: core/equilateral.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/equilateral.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.equilateral = void 0;
+const array_1 = require("./array");
+/**
+ * @deprecated
+ * @static
+ * @memberof module:Globals
+ * @function equilateral
+ * @description Asserts if `x` and `y` have the same length
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @throws {Error} lengths x and y do not match
+ * @example
+ * import { equilateral } from 'vectorious/core/equilateral';
+ *
+ * equilateral([1, 2, 3], [1, 2]); // Error: lengths 3 and 2 do not match
+ */
+const equilateral = (x, y) => {
+    array_1.array(x).equilateral(array_1.array(y));
+};
+exports.equilateral = equilateral;
+/**
+ * @deprecated
+ * @function equilateral
+ * @memberof NDArray.prototype
+ * @description Asserts if current array and `x` have the same length
+ * @param {NDArray} x
+ * @throws {Error} lengths x and y do not match
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).equilateral([1, 2]); // Error: lengths 3 and 2 do not match
+ */
+function default_1(x) {
+    const { length: l1 } = this;
+    const { length: l2 } = x;
+    if (l1 !== l2) {
+        throw new Error(`lengths ${l1} and ${l2} do not match`);
+    }
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_exp.js.html b/docs/vectorious/6.0.3/core_exp.js.html new file mode 100644 index 00000000..5cba3c6a --- /dev/null +++ b/docs/vectorious/6.0.3/core_exp.js.html @@ -0,0 +1,156 @@ + + + + + Vectorious: core/exp.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/exp.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.exp = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { exp: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function exp
+ * @description
+ * Returns e^x of each element of `x`, where x is the argument,
+ * and e is Euler's constant (2.718…), the base of the natural logarithm.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { exp } from 'vectorious/core/exp';
+ *
+ * exp([1, 2, 3]); // => array([2.7182817459106445, 7.389056205749512, 20.08553695678711])
+ */
+const exp = (x) => array_1.array(x).exp();
+exports.exp = exp;
+/**
+ * @function exp
+ * @memberof NDArray.prototype
+ * @description
+ * Returns e^x of each element of current array, where x is the argument,
+ * and e is Euler's constant (2.718…), the base of the natural logarithm.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).exp(); // <=> array([2.7182817459106445, 7.389056205749512, 20.08553695678711])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_expm1.js.html b/docs/vectorious/6.0.3/core_expm1.js.html new file mode 100644 index 00000000..ce82fd3a --- /dev/null +++ b/docs/vectorious/6.0.3/core_expm1.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/expm1.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/expm1.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.expm1 = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { expm1: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function expm1
+ * @description Returns subtracting 1 from exp(x) of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { expm1 } from 'vectorious/core/expm1';
+ *
+ * expm1([1, 2, 3]); // => array([1.7182817459106445, 6.389056205749512, 19.08553695678711])
+ */
+const expm1 = (x) => array_1.array(x).expm1();
+exports.expm1 = expm1;
+/**
+ * @function expm1
+ * @memberof NDArray.prototype
+ * @description Returns subtracting 1 from exp(x) of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).expm1(); // <=> array([1.7182817459106445, 6.389056205749512, 19.08553695678711])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_eye.js.html b/docs/vectorious/6.0.3/core_eye.js.html new file mode 100644 index 00000000..7c3904c8 --- /dev/null +++ b/docs/vectorious/6.0.3/core_eye.js.html @@ -0,0 +1,138 @@ + + + + + Vectorious: core/eye.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/eye.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.eye = void 0;
+const _1 = require("./");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function eye
+ * @description Creates an identity matrix of size `n` and type `type`.
+ * @param {Number} n
+ * @returns {NDArray}
+ * @example
+ * import { eye } from 'vectorious/core/eye';
+ *
+ * eye(2); // => array([[1, 0], [0, 1]])
+ */
+const eye = (n) => {
+    const x = new _1.NDArray(new Float64Array(n * n), { shape: [n, n] });
+    const { data: d1 } = x;
+    let i;
+    for (i = 0; i < n; i += 1) {
+        d1[i * n + i] = 1;
+    }
+    return x;
+};
+exports.eye = eye;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_fill.js.html b/docs/vectorious/6.0.3/core_fill.js.html new file mode 100644 index 00000000..2ea5bfb1 --- /dev/null +++ b/docs/vectorious/6.0.3/core_fill.js.html @@ -0,0 +1,153 @@ + + + + + Vectorious: core/fill.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/fill.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.fill = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function fill
+ * @description Fills `x` with a scalar value
+ * @param {NDArray} x
+ * @param {Number} value
+ * @returns {NDArray}
+ * @example
+ * import { fill } from 'vectorious/core/fill';
+ *
+ * fill([1, 2, 3], 0); // => array([0, 0, 0])
+ */
+const fill = (x, value = 0) => array_1.array(x).fill(value);
+exports.fill = fill;
+/**
+ * @function fill
+ * @memberof NDArray.prototype
+ * @description Fills the current array with a scalar value
+ * @param {Number} value
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).fill(0); // <=> array([0, 0, 0])
+ */
+function default_1(value = 0) {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = value instanceof Function ? value(iter.pos) : value;
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_floor.js.html b/docs/vectorious/6.0.3/core_floor.js.html new file mode 100644 index 00000000..c182e39b --- /dev/null +++ b/docs/vectorious/6.0.3/core_floor.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/floor.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/floor.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.floor = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { floor: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function floor
+ * @description Returns the largest integer less than or equal to a number of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { floor } from 'vectorious/core/floor';
+ *
+ * floor([1.5, 2.5, 3.5]); // => array([1, 2, 3])
+ */
+const floor = (x) => array_1.array(x).floor();
+exports.floor = floor;
+/**
+ * @function floor
+ * @memberof NDArray.prototype
+ * @description Returns the largest integer less than or equal to a number of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1.5, 2.5, 3.5]).floor(); // <=> array([1, 2, 3])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_forEach.js.html b/docs/vectorious/6.0.3/core_forEach.js.html new file mode 100644 index 00000000..5f79603b --- /dev/null +++ b/docs/vectorious/6.0.3/core_forEach.js.html @@ -0,0 +1,157 @@ + + + + + Vectorious: core/forEach.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/forEach.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.forEach = void 0;
+const iterator_1 = require("../iterator");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function forEach
+ * @description Equivalent to `TypedArray.prototype.forEach`.
+ * @param {NDArray} x
+ * @param {Function} f
+ * @example
+ * import { forEach } from 'vectorious/core/forEach';
+ *
+ * forEach([1, 2, 3], console.log);
+ * // 1 0 [ 1, 2, 3 ]
+ * // 2 1 [ 1, 2, 3 ]
+ * // 3 2 [ 1, 2, 3 ]
+ */
+const forEach = (x, f) => {
+    x.forEach(f);
+};
+exports.forEach = forEach;
+/**
+ * @function forEach
+ * @memberof NDArray.prototype
+ * @description Equivalent to `TypedArray.prototype.forEach`.
+ * @param {Function} f
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).forEach(console.log);
+ * // 1 0 [ 1, 2, 3 ]
+ * // 2 1 [ 1, 2, 3 ]
+ * // 3 2 [ 1, 2, 3 ]
+ */
+function default_1(f) {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        f.call(this, d1[i], i, d1);
+    }
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_fround.js.html b/docs/vectorious/6.0.3/core_fround.js.html new file mode 100644 index 00000000..234db327 --- /dev/null +++ b/docs/vectorious/6.0.3/core_fround.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/fround.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/fround.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.fround = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { fround: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function fround
+ * @description Returns the nearest single precision float representation of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { fround } from 'vectorious/core/fround';
+ *
+ * fround([-5.05, 5.05]); // => array([-5.050000190734863, 5.050000190734863])
+ */
+const fround = (x) => array_1.array(x).fround();
+exports.fround = fround;
+/**
+ * @function fround
+ * @memberof NDArray.prototype
+ * @description Returns the nearest single precision float representation of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([-5.05, 5.05]).fround(); // <=> array([-5.050000190734863, 5.050000190734863])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_gauss.js.html b/docs/vectorious/6.0.3/core_gauss.js.html new file mode 100644 index 00000000..7797def8 --- /dev/null +++ b/docs/vectorious/6.0.3/core_gauss.js.html @@ -0,0 +1,241 @@ + + + + + Vectorious: core/gauss.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/gauss.js

+ + + + + + +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.gauss = void 0;
+const iterator_1 = require("../iterator");
+const array_1 = require("./array");
+// import { diagonal } from './diagonal';
+const lapack = __importStar(require("../lapack"));
+/**
+ * @static
+ * @memberof module:Globals
+ * @function gauss
+ * @description
+ * Gauss-Jordan elimination (i.e. returns the reduced row echelon form) of `x`.
+ * Accelerated with LAPACK `?getrf`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { gauss } from 'vectorious/core/gauss';
+ *
+ * gauss([[1, 2, 3], [4, 5, 6]]); // => array([[1, 0, -1], [-0, 1, 2]])
+ */
+const gauss = (x) => array_1.array(x).gauss();
+exports.gauss = gauss;
+/**
+ * @function gauss
+ * @memberof NDArray.prototype
+ * @description
+ * Gauss-Jordan elimination (i.e. returns the reduced row echelon form) of the current matrix.
+ * Accelerated with LAPACK `?getrf`.
+ * @returns {NDArray}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[1, 2, 3], [4, 5, 6]]).gauss(); // <=> array([[1, 0, -1], [-0, 1, 2]])
+ */
+function default_1() {
+    const { shape: [r, c], data: d1, dtype } = this;
+    try {
+        const { data: d1 } = this;
+        const ipiv = new Int32Array(Math.min(r, c));
+        lapack.getrf(dtype, r, c, d1, c, ipiv);
+        const iter = new iterator_1.NDIter(this);
+        // Zero out lower triangular part of matrix
+        let [ci, cj] = iter.coords;
+        for (const i of iter) {
+            if (cj < ci) {
+                d1[i] = 0;
+            }
+            [ci, cj] = iter.coords;
+        }
+    }
+    catch (err) {
+        let lead = 0;
+        let leadValue;
+        let pivot;
+        let i;
+        let j;
+        let k;
+        for (i = 0; i < r; i += 1) {
+            if (c <= lead) {
+                return this;
+            }
+            j = i;
+            while (d1[j * c + lead] === 0) {
+                j += 1;
+                if (r === j) {
+                    j = i;
+                    lead += 1;
+                    if (c === lead) {
+                        return this;
+                    }
+                }
+            }
+            if (i !== j) {
+                this.swap(i, j);
+            }
+            pivot = d1[i * c + lead];
+            if (pivot !== 0) {
+                for (k = 0; k < c; k += 1) {
+                    d1[i * c + k] /= pivot;
+                }
+            }
+            for (j = 0; j < r; j += 1) {
+                leadValue = d1[j * c + lead];
+                if (j !== i) {
+                    for (k = 0; k < c; k += 1) {
+                        d1[j * c + k] -= d1[i * c + k] * leadValue;
+                    }
+                }
+            }
+            lead += 1;
+        }
+        for (i = 0; i < r; i += 1) {
+            pivot = 0;
+            for (j = 0; j < c; j += 1) {
+                if (pivot === 0) {
+                    pivot = d1[i * c + j];
+                }
+            }
+            if (pivot === 0) {
+                for (k = 0; k < c; k += 1) {
+                    d1[i * c + k] /= pivot;
+                }
+            }
+        }
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_get.js.html b/docs/vectorious/6.0.3/core_get.js.html new file mode 100644 index 00000000..b8c30a9c --- /dev/null +++ b/docs/vectorious/6.0.3/core_get.js.html @@ -0,0 +1,160 @@ + + + + + Vectorious: core/get.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/get.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.get = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function get
+ * @description Gets the element at `i, j, ..., n` from `x`
+ * @param {NDArray} x
+ * @param {Number[]} ...indices
+ * @returns {Number}
+ * @example
+ * import { get } from 'vectorious/core/get';
+ *
+ * get([1, 2, 3], 2); // 3
+ */
+const get = (x, ...indices) => array_1.array(x).get(...indices);
+exports.get = get;
+/**
+ * @function get
+ * @memberof NDArray.prototype
+ * @description Gets the element at `i, j, ..., n` from current vector.
+ * @param {Number[]} ...indices
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).get(2); // 3
+ */
+function default_1(...indices) {
+    this.check(...indices);
+    const { data: d1, shape: s1 } = this;
+    const { length: ndim } = s1;
+    let index = indices[ndim - 1];
+    let i;
+    let j;
+    for (i = 0; i < ndim - 1; i += 1) {
+        let p = 1;
+        for (j = i + 1; j < ndim; j += 1) {
+            p *= s1[j];
+        }
+        index += indices[i] * p;
+    }
+    return d1[index];
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_index.js.html b/docs/vectorious/6.0.3/core_index.js.html new file mode 100644 index 00000000..edeb0608 --- /dev/null +++ b/docs/vectorious/6.0.3/core_index.js.html @@ -0,0 +1,598 @@ + + + + + Vectorious: core/index.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/index.js

+ + + + + + +
+
+
"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+    return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+var _a;
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.min = exports.mean = exports.max = exports.matrix = exports.map = exports.magic = exports.lu_factor = exports.lu = exports.log2 = exports.log1p = exports.log10 = exports.log = exports.inv = exports.get = exports.gauss = exports.fround = exports.forEach = exports.floor = exports.fill = exports.eye = exports.expm1 = exports.exp = exports.equilateral = exports.equidimensional = exports.equals = exports.eig = exports.dot = exports.diagonal = exports.det = exports.cross = exports.cosh = exports.cos = exports.copy = exports.combine = exports.check = exports.ceil = exports.cbrt = exports.binOp = exports.augment = exports.atanh = exports.atan = exports.asinh = exports.asin = exports.array = exports.angle = exports.add = exports.acosh = exports.acos = exports.abs = exports.NDArray = void 0;
+exports.zeros = exports.trunc = exports.transpose = exports.trace = exports.toString = exports.toArray = exports.tanh = exports.tan = exports.swap = exports.sum = exports.subtract = exports.square = exports.sqrt = exports.solve = exports.slice = exports.sinh = exports.sin = exports.sign = exports.set = exports.scale = exports.row_add = exports.round = exports.reshape = exports.reduce = exports.reciprocal = exports.rank = exports.range = exports.random = exports.push = exports.project = exports.product = exports.prod = exports.pow = exports.ones = exports.normalize = exports.norm = exports.multiply = void 0;
+const util_1 = require("../util");
+const iterator_1 = require("../iterator");
+const abs_1 = __importDefault(require("./abs"));
+const acos_1 = __importDefault(require("./acos"));
+const acosh_1 = __importDefault(require("./acosh"));
+const add_1 = __importDefault(require("./add"));
+const angle_1 = __importDefault(require("./angle"));
+const asin_1 = __importDefault(require("./asin"));
+const asinh_1 = __importDefault(require("./asinh"));
+const atan_1 = __importDefault(require("./atan"));
+const atanh_1 = __importDefault(require("./atanh"));
+const augment_1 = __importDefault(require("./augment"));
+const binOp_1 = __importDefault(require("./binOp"));
+const cbrt_1 = __importDefault(require("./cbrt"));
+const ceil_1 = __importDefault(require("./ceil"));
+const check_1 = __importDefault(require("./check"));
+const combine_1 = __importDefault(require("./combine"));
+const copy_1 = __importDefault(require("./copy"));
+const cos_1 = __importDefault(require("./cos"));
+const cosh_1 = __importDefault(require("./cosh"));
+const cross_1 = __importDefault(require("./cross"));
+const det_1 = __importDefault(require("./det"));
+const diagonal_1 = __importDefault(require("./diagonal"));
+const dot_1 = __importDefault(require("./dot"));
+const eig_1 = __importDefault(require("./eig"));
+const equals_1 = __importDefault(require("./equals"));
+const equidimensional_1 = __importDefault(require("./equidimensional"));
+const equilateral_1 = __importDefault(require("./equilateral"));
+const exp_1 = __importDefault(require("./exp"));
+const expm1_1 = __importDefault(require("./expm1"));
+const fill_1 = __importDefault(require("./fill"));
+const floor_1 = __importDefault(require("./floor"));
+const forEach_1 = __importDefault(require("./forEach"));
+const fround_1 = __importDefault(require("./fround"));
+const gauss_1 = __importDefault(require("./gauss"));
+const get_1 = __importDefault(require("./get"));
+const inv_1 = __importDefault(require("./inv"));
+const log_1 = __importDefault(require("./log"));
+const log10_1 = __importDefault(require("./log10"));
+const log1p_1 = __importDefault(require("./log1p"));
+const log2_1 = __importDefault(require("./log2"));
+const lu_1 = __importDefault(require("./lu"));
+const lu_factor_1 = __importDefault(require("./lu_factor"));
+const map_1 = __importDefault(require("./map"));
+const max_1 = __importDefault(require("./max"));
+const mean_1 = __importDefault(require("./mean"));
+const min_1 = __importDefault(require("./min"));
+const multiply_1 = __importDefault(require("./multiply"));
+const norm_1 = __importDefault(require("./norm"));
+const normalize_1 = __importDefault(require("./normalize"));
+const pow_1 = __importDefault(require("./pow"));
+const prod_1 = __importDefault(require("./prod"));
+const product_1 = __importDefault(require("./product"));
+const project_1 = __importDefault(require("./project"));
+const push_1 = __importDefault(require("./push"));
+const rank_1 = __importDefault(require("./rank"));
+const reciprocal_1 = __importDefault(require("./reciprocal"));
+const reduce_1 = __importDefault(require("./reduce"));
+const reshape_1 = __importDefault(require("./reshape"));
+const round_1 = __importDefault(require("./round"));
+const row_add_1 = __importDefault(require("./row_add"));
+const scale_1 = __importDefault(require("./scale"));
+const set_1 = __importDefault(require("./set"));
+const sign_1 = __importDefault(require("./sign"));
+const sin_1 = __importDefault(require("./sin"));
+const sinh_1 = __importDefault(require("./sinh"));
+const slice_1 = __importDefault(require("./slice"));
+const solve_1 = __importDefault(require("./solve"));
+const sqrt_1 = __importDefault(require("./sqrt"));
+const square_1 = __importDefault(require("./square"));
+const subtract_1 = __importDefault(require("./subtract"));
+const sum_1 = __importDefault(require("./sum"));
+const swap_1 = __importDefault(require("./swap"));
+const tan_1 = __importDefault(require("./tan"));
+const tanh_1 = __importDefault(require("./tanh"));
+const toArray_1 = __importDefault(require("./toArray"));
+const toString_1 = __importDefault(require("./toString"));
+const trace_1 = __importDefault(require("./trace"));
+const transpose_1 = __importDefault(require("./transpose"));
+const trunc_1 = __importDefault(require("./trunc"));
+const inspectSymbol = Symbol.for('nodejs.util.inspect.custom');
+/**
+ * @class NDArray
+ * @description Constructs or copies an NDArray instance.
+ * @param data
+ * @param {Object} [options]
+ * @param {Number[]} [options.shape]
+ * @param {Number} [options.length]
+ * @param {Number[]} [options.strides]
+ * @param {string} [options.dtype]
+ * @example
+ * import { NDArray } from 'vectorious';
+ *
+ * new NDArray() // => array([], dtype=float64)
+ * new NDArray([]) // => array([], dtype=float64)
+ * new NDArray([1, 2, 3]) // => array([1, 2, 3], dtype=float64)
+ * new NDArray([[1, 2], [3, 4]]) // => array([ [ 1, 2 ], [ 3, 4 ] ], dtype=float64)
+ * new NDArray(new Int32Array([1, 2, 3])) // => array([ 1, 2, 3 ], dtype=int32)
+ * new NDArray([1, 2, 3, 4], {
+ *   shape: [2, 2],
+ *   dtype: 'uint32'
+ * }) // => array([ [ 1, 2 ], [ 3, 4 ] ], dtype=uint32)
+ */
+class NDArray {
+    constructor(data, options) {
+        /**
+         * @name data
+         * @memberof NDArray.prototype
+         * @type TypedArray
+         * @default new Float64Array(0)
+         */
+        this.data = new Float64Array(0);
+        /**
+         * @name dtype
+         * @memberof NDArray.prototype
+         * @type String
+         * @default 'float64'
+         */
+        this.dtype = 'float64';
+        /**
+         * @name length
+         * @memberof NDArray.prototype
+         * @type Number
+         * @default 0
+         */
+        this.length = 0;
+        /**
+         * @name shape
+         * @memberof NDArray.prototype
+         * @type Number[]
+         * @default [0]
+         */
+        this.shape = [0];
+        /**
+         * @name strides
+         * @memberof NDArray.prototype
+         * @type Number[]
+         * @default [0]
+         */
+        this.strides = [0];
+        this[_a] = toString_1.default;
+        this.abs = abs_1.default;
+        this.acos = acos_1.default;
+        this.acosh = acosh_1.default;
+        this.add = add_1.default;
+        this.angle = angle_1.default;
+        this.asin = asin_1.default;
+        this.asinh = asinh_1.default;
+        this.atan = atan_1.default;
+        this.atanh = atanh_1.default;
+        this.augment = augment_1.default;
+        this.binOp = binOp_1.default;
+        this.cbrt = cbrt_1.default;
+        this.ceil = ceil_1.default;
+        this.check = check_1.default;
+        this.combine = combine_1.default;
+        this.copy = copy_1.default;
+        this.cos = cos_1.default;
+        this.cosh = cosh_1.default;
+        this.cross = cross_1.default;
+        this.det = det_1.default;
+        this.diagonal = diagonal_1.default;
+        this.dot = dot_1.default;
+        this.eig = eig_1.default;
+        this.equals = equals_1.default;
+        this.equidimensional = equidimensional_1.default;
+        this.equilateral = equilateral_1.default;
+        this.exp = exp_1.default;
+        this.expm1 = expm1_1.default;
+        this.fill = fill_1.default;
+        this.floor = floor_1.default;
+        this.forEach = forEach_1.default;
+        this.fround = fround_1.default;
+        this.gauss = gauss_1.default;
+        this.get = get_1.default;
+        this.inv = inv_1.default;
+        this.log = log_1.default;
+        this.log10 = log10_1.default;
+        this.log1p = log1p_1.default;
+        this.log2 = log2_1.default;
+        this.lu = lu_1.default;
+        this.lu_factor = lu_factor_1.default;
+        this.map = map_1.default;
+        this.max = max_1.default;
+        this.mean = mean_1.default;
+        this.min = min_1.default;
+        this.multiply = multiply_1.default;
+        this.norm = norm_1.default;
+        this.normalize = normalize_1.default;
+        this.pow = pow_1.default;
+        this.prod = prod_1.default;
+        this.product = product_1.default;
+        this.project = project_1.default;
+        this.push = push_1.default;
+        this.rank = rank_1.default;
+        this.reciprocal = reciprocal_1.default;
+        this.reduce = reduce_1.default;
+        this.reshape = reshape_1.default;
+        this.round = round_1.default;
+        this.row_add = row_add_1.default;
+        this.scale = scale_1.default;
+        this.set = set_1.default;
+        this.sign = sign_1.default;
+        this.sin = sin_1.default;
+        this.sinh = sinh_1.default;
+        this.slice = slice_1.default;
+        this.solve = solve_1.default;
+        this.sqrt = sqrt_1.default;
+        this.square = square_1.default;
+        this.subtract = subtract_1.default;
+        this.sum = sum_1.default;
+        this.swap = swap_1.default;
+        this.tan = tan_1.default;
+        this.tanh = tanh_1.default;
+        this.toArray = toArray_1.default;
+        this.toString = toString_1.default;
+        this.trace = trace_1.default;
+        this.transpose = transpose_1.default;
+        this.trunc = trunc_1.default;
+        if (!data) {
+            return;
+        }
+        if (data instanceof NDArray) {
+            return data;
+        }
+        if (data instanceof iterator_1.NDIter) {
+            if (!options || !options.dtype) {
+                throw new Error('dtype is missing');
+            }
+            if (data.shape) {
+                options.shape = data.shape;
+            }
+            const length = data.length;
+            data = new (util_1.get_type(options.dtype))(length);
+        }
+        const { shape = util_1.get_shape(data), length = util_1.get_length(shape), strides = util_1.get_strides(shape), dtype = util_1.get_dtype(data), } = options || {};
+        this.data = util_1.is_typed_array(data) ? data : new (util_1.get_type(dtype))(util_1.flatten(data));
+        this.shape = shape;
+        this.length = length;
+        this.dtype = dtype;
+        this.strides = strides;
+    }
+    /**
+     * @name x
+     * @memberof NDArray.prototype
+     * @description Gets or sets the value at index 0
+     * @type Number
+     */
+    get x() {
+        return this.get(0);
+    }
+    set x(value) {
+        this.set(0, value);
+    }
+    /**
+     * @name y
+     * @memberof NDArray.prototype
+     * @description Gets or sets the value at index 1
+     * @type Number
+     */
+    get y() {
+        return this.get(1);
+    }
+    set y(value) {
+        this.set(1, value);
+    }
+    /**
+     * @name z
+     * @memberof NDArray.prototype
+     * @description Gets or sets the value at index 2
+     * @type Number
+     */
+    get z() {
+        return this.get(2);
+    }
+    set z(value) {
+        this.set(2, value);
+    }
+    /**
+     * @name w
+     * @memberof NDArray.prototype
+     * @description Gets or sets the value at index 3
+     * @type Number
+     */
+    get w() {
+        return this.get(3);
+    }
+    set w(value) {
+        this.set(3, value);
+    }
+    /**
+     * @name T
+     * @memberof NDArray.prototype
+     * @description Short for `this.transpose()`
+     * @type NDArray
+     */
+    get T() {
+        return this.transpose();
+    }
+}
+exports.NDArray = NDArray;
+_a = inspectSymbol;
+var abs_2 = require("./abs");
+Object.defineProperty(exports, "abs", { enumerable: true, get: function () { return abs_2.abs; } });
+var acos_2 = require("./acos");
+Object.defineProperty(exports, "acos", { enumerable: true, get: function () { return acos_2.acos; } });
+var acosh_2 = require("./acosh");
+Object.defineProperty(exports, "acosh", { enumerable: true, get: function () { return acosh_2.acosh; } });
+var add_2 = require("./add");
+Object.defineProperty(exports, "add", { enumerable: true, get: function () { return add_2.add; } });
+var angle_2 = require("./angle");
+Object.defineProperty(exports, "angle", { enumerable: true, get: function () { return angle_2.angle; } });
+var array_1 = require("./array");
+Object.defineProperty(exports, "array", { enumerable: true, get: function () { return array_1.array; } });
+var asin_2 = require("./asin");
+Object.defineProperty(exports, "asin", { enumerable: true, get: function () { return asin_2.asin; } });
+var asinh_2 = require("./asinh");
+Object.defineProperty(exports, "asinh", { enumerable: true, get: function () { return asinh_2.asinh; } });
+var atan_2 = require("./atan");
+Object.defineProperty(exports, "atan", { enumerable: true, get: function () { return atan_2.atan; } });
+var atanh_2 = require("./atanh");
+Object.defineProperty(exports, "atanh", { enumerable: true, get: function () { return atanh_2.atanh; } });
+var augment_2 = require("./augment");
+Object.defineProperty(exports, "augment", { enumerable: true, get: function () { return augment_2.augment; } });
+var binOp_2 = require("./binOp");
+Object.defineProperty(exports, "binOp", { enumerable: true, get: function () { return binOp_2.binOp; } });
+var cbrt_2 = require("./cbrt");
+Object.defineProperty(exports, "cbrt", { enumerable: true, get: function () { return cbrt_2.cbrt; } });
+var ceil_2 = require("./ceil");
+Object.defineProperty(exports, "ceil", { enumerable: true, get: function () { return ceil_2.ceil; } });
+var check_2 = require("./check");
+Object.defineProperty(exports, "check", { enumerable: true, get: function () { return check_2.check; } });
+var combine_2 = require("./combine");
+Object.defineProperty(exports, "combine", { enumerable: true, get: function () { return combine_2.combine; } });
+var copy_2 = require("./copy");
+Object.defineProperty(exports, "copy", { enumerable: true, get: function () { return copy_2.copy; } });
+var cos_2 = require("./cos");
+Object.defineProperty(exports, "cos", { enumerable: true, get: function () { return cos_2.cos; } });
+var cosh_2 = require("./cosh");
+Object.defineProperty(exports, "cosh", { enumerable: true, get: function () { return cosh_2.cosh; } });
+var cross_2 = require("./cross");
+Object.defineProperty(exports, "cross", { enumerable: true, get: function () { return cross_2.cross; } });
+var det_2 = require("./det");
+Object.defineProperty(exports, "det", { enumerable: true, get: function () { return det_2.det; } });
+var diagonal_2 = require("./diagonal");
+Object.defineProperty(exports, "diagonal", { enumerable: true, get: function () { return diagonal_2.diagonal; } });
+var dot_2 = require("./dot");
+Object.defineProperty(exports, "dot", { enumerable: true, get: function () { return dot_2.dot; } });
+var eig_2 = require("./eig");
+Object.defineProperty(exports, "eig", { enumerable: true, get: function () { return eig_2.eig; } });
+var equals_2 = require("./equals");
+Object.defineProperty(exports, "equals", { enumerable: true, get: function () { return equals_2.equals; } });
+var equidimensional_2 = require("./equidimensional");
+Object.defineProperty(exports, "equidimensional", { enumerable: true, get: function () { return equidimensional_2.equidimensional; } });
+var equilateral_2 = require("./equilateral");
+Object.defineProperty(exports, "equilateral", { enumerable: true, get: function () { return equilateral_2.equilateral; } });
+var exp_2 = require("./exp");
+Object.defineProperty(exports, "exp", { enumerable: true, get: function () { return exp_2.exp; } });
+var expm1_2 = require("./expm1");
+Object.defineProperty(exports, "expm1", { enumerable: true, get: function () { return expm1_2.expm1; } });
+var eye_1 = require("./eye");
+Object.defineProperty(exports, "eye", { enumerable: true, get: function () { return eye_1.eye; } });
+var fill_2 = require("./fill");
+Object.defineProperty(exports, "fill", { enumerable: true, get: function () { return fill_2.fill; } });
+var floor_2 = require("./floor");
+Object.defineProperty(exports, "floor", { enumerable: true, get: function () { return floor_2.floor; } });
+var forEach_2 = require("./forEach");
+Object.defineProperty(exports, "forEach", { enumerable: true, get: function () { return forEach_2.forEach; } });
+var fround_2 = require("./fround");
+Object.defineProperty(exports, "fround", { enumerable: true, get: function () { return fround_2.fround; } });
+var gauss_2 = require("./gauss");
+Object.defineProperty(exports, "gauss", { enumerable: true, get: function () { return gauss_2.gauss; } });
+var get_2 = require("./get");
+Object.defineProperty(exports, "get", { enumerable: true, get: function () { return get_2.get; } });
+var inv_2 = require("./inv");
+Object.defineProperty(exports, "inv", { enumerable: true, get: function () { return inv_2.inv; } });
+var log_2 = require("./log");
+Object.defineProperty(exports, "log", { enumerable: true, get: function () { return log_2.log; } });
+var log10_2 = require("./log10");
+Object.defineProperty(exports, "log10", { enumerable: true, get: function () { return log10_2.log10; } });
+var log1p_2 = require("./log1p");
+Object.defineProperty(exports, "log1p", { enumerable: true, get: function () { return log1p_2.log1p; } });
+var log2_2 = require("./log2");
+Object.defineProperty(exports, "log2", { enumerable: true, get: function () { return log2_2.log2; } });
+var lu_2 = require("./lu");
+Object.defineProperty(exports, "lu", { enumerable: true, get: function () { return lu_2.lu; } });
+var lu_factor_2 = require("./lu_factor");
+Object.defineProperty(exports, "lu_factor", { enumerable: true, get: function () { return lu_factor_2.lu_factor; } });
+var magic_1 = require("./magic");
+Object.defineProperty(exports, "magic", { enumerable: true, get: function () { return magic_1.magic; } });
+var map_2 = require("./map");
+Object.defineProperty(exports, "map", { enumerable: true, get: function () { return map_2.map; } });
+var matrix_1 = require("./matrix");
+Object.defineProperty(exports, "matrix", { enumerable: true, get: function () { return matrix_1.matrix; } });
+var max_2 = require("./max");
+Object.defineProperty(exports, "max", { enumerable: true, get: function () { return max_2.max; } });
+var mean_2 = require("./mean");
+Object.defineProperty(exports, "mean", { enumerable: true, get: function () { return mean_2.mean; } });
+var min_2 = require("./min");
+Object.defineProperty(exports, "min", { enumerable: true, get: function () { return min_2.min; } });
+var multiply_2 = require("./multiply");
+Object.defineProperty(exports, "multiply", { enumerable: true, get: function () { return multiply_2.multiply; } });
+var norm_2 = require("./norm");
+Object.defineProperty(exports, "norm", { enumerable: true, get: function () { return norm_2.norm; } });
+var normalize_2 = require("./normalize");
+Object.defineProperty(exports, "normalize", { enumerable: true, get: function () { return normalize_2.normalize; } });
+var ones_1 = require("./ones");
+Object.defineProperty(exports, "ones", { enumerable: true, get: function () { return ones_1.ones; } });
+var pow_2 = require("./pow");
+Object.defineProperty(exports, "pow", { enumerable: true, get: function () { return pow_2.pow; } });
+var prod_2 = require("./prod");
+Object.defineProperty(exports, "prod", { enumerable: true, get: function () { return prod_2.prod; } });
+var product_2 = require("./product");
+Object.defineProperty(exports, "product", { enumerable: true, get: function () { return product_2.product; } });
+var project_2 = require("./project");
+Object.defineProperty(exports, "project", { enumerable: true, get: function () { return project_2.project; } });
+var push_2 = require("./push");
+Object.defineProperty(exports, "push", { enumerable: true, get: function () { return push_2.push; } });
+var random_1 = require("./random");
+Object.defineProperty(exports, "random", { enumerable: true, get: function () { return random_1.random; } });
+var range_1 = require("./range");
+Object.defineProperty(exports, "range", { enumerable: true, get: function () { return range_1.range; } });
+var rank_2 = require("./rank");
+Object.defineProperty(exports, "rank", { enumerable: true, get: function () { return rank_2.rank; } });
+var reciprocal_2 = require("./reciprocal");
+Object.defineProperty(exports, "reciprocal", { enumerable: true, get: function () { return reciprocal_2.reciprocal; } });
+var reduce_2 = require("./reduce");
+Object.defineProperty(exports, "reduce", { enumerable: true, get: function () { return reduce_2.reduce; } });
+var reshape_2 = require("./reshape");
+Object.defineProperty(exports, "reshape", { enumerable: true, get: function () { return reshape_2.reshape; } });
+var round_2 = require("./round");
+Object.defineProperty(exports, "round", { enumerable: true, get: function () { return round_2.round; } });
+var row_add_2 = require("./row_add");
+Object.defineProperty(exports, "row_add", { enumerable: true, get: function () { return row_add_2.row_add; } });
+var scale_2 = require("./scale");
+Object.defineProperty(exports, "scale", { enumerable: true, get: function () { return scale_2.scale; } });
+var set_2 = require("./set");
+Object.defineProperty(exports, "set", { enumerable: true, get: function () { return set_2.set; } });
+var sign_2 = require("./sign");
+Object.defineProperty(exports, "sign", { enumerable: true, get: function () { return sign_2.sign; } });
+var sin_2 = require("./sin");
+Object.defineProperty(exports, "sin", { enumerable: true, get: function () { return sin_2.sin; } });
+var sinh_2 = require("./sinh");
+Object.defineProperty(exports, "sinh", { enumerable: true, get: function () { return sinh_2.sinh; } });
+var slice_2 = require("./slice");
+Object.defineProperty(exports, "slice", { enumerable: true, get: function () { return slice_2.slice; } });
+var solve_2 = require("./solve");
+Object.defineProperty(exports, "solve", { enumerable: true, get: function () { return solve_2.solve; } });
+var sqrt_2 = require("./sqrt");
+Object.defineProperty(exports, "sqrt", { enumerable: true, get: function () { return sqrt_2.sqrt; } });
+var square_2 = require("./square");
+Object.defineProperty(exports, "square", { enumerable: true, get: function () { return square_2.square; } });
+var subtract_2 = require("./subtract");
+Object.defineProperty(exports, "subtract", { enumerable: true, get: function () { return subtract_2.subtract; } });
+var sum_2 = require("./sum");
+Object.defineProperty(exports, "sum", { enumerable: true, get: function () { return sum_2.sum; } });
+var swap_2 = require("./swap");
+Object.defineProperty(exports, "swap", { enumerable: true, get: function () { return swap_2.swap; } });
+var tan_2 = require("./tan");
+Object.defineProperty(exports, "tan", { enumerable: true, get: function () { return tan_2.tan; } });
+var tanh_2 = require("./tanh");
+Object.defineProperty(exports, "tanh", { enumerable: true, get: function () { return tanh_2.tanh; } });
+var toArray_2 = require("./toArray");
+Object.defineProperty(exports, "toArray", { enumerable: true, get: function () { return toArray_2.toArray; } });
+var toString_2 = require("./toString");
+Object.defineProperty(exports, "toString", { enumerable: true, get: function () { return toString_2.toString; } });
+var trace_2 = require("./trace");
+Object.defineProperty(exports, "trace", { enumerable: true, get: function () { return trace_2.trace; } });
+var transpose_2 = require("./transpose");
+Object.defineProperty(exports, "transpose", { enumerable: true, get: function () { return transpose_2.transpose; } });
+var trunc_2 = require("./trunc");
+Object.defineProperty(exports, "trunc", { enumerable: true, get: function () { return trunc_2.trunc; } });
+var zeros_1 = require("./zeros");
+Object.defineProperty(exports, "zeros", { enumerable: true, get: function () { return zeros_1.zeros; } });
+try {
+    window.v = NDArray;
+}
+catch (error) { }
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_inv.js.html b/docs/vectorious/6.0.3/core_inv.js.html new file mode 100644 index 00000000..a5f9e121 --- /dev/null +++ b/docs/vectorious/6.0.3/core_inv.js.html @@ -0,0 +1,205 @@ + + + + + Vectorious: core/inv.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/inv.js

+ + + + + + +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.inv = void 0;
+const iterator_1 = require("../iterator");
+const array_1 = require("./array");
+const eye_1 = require("./eye");
+const augment_1 = require("./augment");
+const zeros_1 = require("./zeros");
+const lapack = __importStar(require("../lapack"));
+/**
+ * @static
+ * @memberof module:Globals
+ * @function inv
+ * @description
+ * Determines the inverse of `x`.
+ * Accelerated with LAPACK `?getrf` and `?getri`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { inv } from 'vectorious/core/inv';
+ *
+ * inv([[2, -1, 0], [-1, 2, -1], [0, -1, 2]]); // => array([[0.75, 0.5, 0.25], [0.5, 1, 0.5], [0.25, 0.5, 0.75]])
+ */
+const inv = (x) => array_1.array(x).inv();
+exports.inv = inv;
+/**
+ * @function inv
+ * @memberof NDArray.prototype
+ * @description
+ * Determines the inverse of current matrix using Gaussian elimination.
+ * Accelerated with LAPACK `?getri`.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[2, -1, 0], [-1, 2, -1], [0, -1, 2]]).inv(); // <=> array([[0.75, 0.5, 0.25], [0.5, 1, 0.5], [0.25, 0.5, 0.75]])
+ */
+function default_1() {
+    this.square();
+    const { shape: [n], dtype } = this;
+    try {
+        const { data: d1 } = this;
+        const ipiv = new Int32Array(n);
+        lapack.getrf(dtype, n, n, d1, n, ipiv);
+        lapack.getri(dtype, n, d1, n, ipiv);
+        return this;
+    }
+    catch (err) {
+        const identity = eye_1.eye(n);
+        const rref = augment_1.augment(this, identity).gauss();
+        const left = zeros_1.zeros(n, n);
+        const right = zeros_1.zeros(n, n);
+        const { data: d1 } = rref;
+        const { data: d2 } = left;
+        const { data: d3 } = right;
+        const iter = new iterator_1.NDIter(rref);
+        let [ci, cj] = iter.coords;
+        for (const i of iter) {
+            if (cj < n) {
+                d2[ci * n + cj] = d1[i];
+            }
+            else {
+                d3[ci * n + (cj - n)] = d1[i];
+            }
+            [ci, cj] = iter.coords;
+        }
+        if (!left.equals(identity)) {
+            throw new Error('matrix is not invertible');
+        }
+        return right;
+    }
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_log.js.html b/docs/vectorious/6.0.3/core_log.js.html new file mode 100644 index 00000000..8ba2e415 --- /dev/null +++ b/docs/vectorious/6.0.3/core_log.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/log.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/log.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.log = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { log: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function log
+ * @description Returns the natural logarithm (log_e, also ln) of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { log } from 'vectorious/core/log';
+ *
+ * log([1, 2, 3]); // => array([0, 0.6931471824645996, 1.0986123085021973])
+ */
+const log = (x) => array_1.array(x).log();
+exports.log = log;
+/**
+ * @function log
+ * @memberof NDArray.prototype
+ * @description Returns the natural logarithm (log_e, also ln) of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).log(); // <=> array([0, 0.6931471824645996, 1.0986123085021973])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_log10.js.html b/docs/vectorious/6.0.3/core_log10.js.html new file mode 100644 index 00000000..173f8c23 --- /dev/null +++ b/docs/vectorious/6.0.3/core_log10.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/log10.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/log10.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.log10 = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { log10: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function log10
+ * @description Returns the base 10 logarithm of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { log10 } from 'vectorious/core/log10';
+ *
+ * log10([10, 100, 1000]); // => array([1, 2, 3])
+ */
+const log10 = (x) => array_1.array(x).log10();
+exports.log10 = log10;
+/**
+ * @function log10
+ * @memberof NDArray.prototype
+ * @description Returns the base 10 logarithm of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([10, 100, 1000]).log10(); // <=> array([1, 2, 3])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_log1p.js.html b/docs/vectorious/6.0.3/core_log1p.js.html new file mode 100644 index 00000000..19d84665 --- /dev/null +++ b/docs/vectorious/6.0.3/core_log1p.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/log1p.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/log1p.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.log1p = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { log1p: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function log1p
+ * @description Returns the natural logarithm (log_e, also ln) of 1 + x for each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { log1p } from 'vectorious/core/log1p';
+ *
+ * log1p([1, 2, 3]); // => array([0.6931471824645996, 1.0986123085021973, 1.3862943649291992])
+ */
+const log1p = (x) => array_1.array(x).log1p();
+exports.log1p = log1p;
+/**
+ * @function log1p
+ * @memberof NDArray.prototype
+ * @description Returns the natural logarithm (log_e, also ln) of 1 + x for each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]); // <=> array([0.6931471824645996, 1.0986123085021973, 1.3862943649291992])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_log2.js.html b/docs/vectorious/6.0.3/core_log2.js.html new file mode 100644 index 00000000..87999b51 --- /dev/null +++ b/docs/vectorious/6.0.3/core_log2.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/log2.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/log2.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.log2 = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { log2: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function log2
+ * @description Returns the base 2 logarithm of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { log2 } from 'vectorious/core/log2';
+ *
+ * log2([1, 2, 4]); // => array([0, 1, 2])
+ */
+const log2 = (x) => array_1.array(x).log2();
+exports.log2 = log2;
+/**
+ * @function log2
+ * @memberof NDArray.prototype
+ * @description Returns the base 2 logarithm of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 4]).log2(); // => array([0, 1, 2])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_lu.js.html b/docs/vectorious/6.0.3/core_lu.js.html new file mode 100644 index 00000000..37de1a2d --- /dev/null +++ b/docs/vectorious/6.0.3/core_lu.js.html @@ -0,0 +1,166 @@ + + + + + Vectorious: core/lu.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/lu.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.lu = void 0;
+const iterator_1 = require("../iterator");
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function lu
+ * @description
+ * Performs full LU decomposition on `x`.
+ * Accelerated with LAPACK `?getrf`.
+ * @param {NDArray} x
+ * @returns {Array<NDArray, Int32Array>}
+ * @example
+ * import { lu } from 'vectorious/core/lu';
+ *
+ * lu([[1, 3, 5], [2, 4, 7], [1, 1, 0]]); // => [array([[1, 0, 0], [0.5, 1, 0], [0.5, -1, 1]]), array([[2, 4, 7], [0, 1, 1.5], [0, 0, -2]]), Int32Array([2, 2, 3])]
+ */
+const lu = (x) => array_1.array(x).lu();
+exports.lu = lu;
+/**
+ * @function lu
+ * @memberof NDArray.prototype
+ * @description
+ * Performs full LU decomposition on current matrix.
+ * Accelerated with LAPACK `?getrf`.
+ * @returns {Array<NDArray|Int32Array>}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[1, 3, 5], [2, 4, 7], [1, 1, 0]]).lu(); // => [array([[1, 0, 0], [0.5, 1, 0], [0.5, -1, 1]]), array([[2, 4, 7], [0, 1, 1.5], [0, 0, -2]]), Int32Array([2, 2, 3])]
+ */
+function default_1() {
+    const [LU, ipiv] = this.copy().lu_factor();
+    const L = LU.copy();
+    const U = LU.copy();
+    const { data: d1 } = L;
+    const { data: d2 } = U;
+    const iter = new iterator_1.NDIter(LU);
+    let [ci, cj] = iter.coords;
+    for (const i of iter) {
+        if (cj < ci) {
+            d2[i] = 0;
+        }
+        else {
+            d1[i] = ci === cj ? 1 : 0;
+        }
+        [ci, cj] = iter.coords;
+    }
+    return [L, U, ipiv];
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_lu_factor.js.html b/docs/vectorious/6.0.3/core_lu_factor.js.html new file mode 100644 index 00000000..1e6c8627 --- /dev/null +++ b/docs/vectorious/6.0.3/core_lu_factor.js.html @@ -0,0 +1,211 @@ + + + + + Vectorious: core/lu_factor.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/lu_factor.js

+ + + + + + +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.lu_factor = void 0;
+const array_1 = require("./array");
+const lapack = __importStar(require("../lapack"));
+/**
+ * @static
+ * @memberof module:Globals
+ * @function lu_factor
+ * @description
+ * Performs LU factorization on `x`.
+ * Accelerated with LAPACK `?getrf`.
+ * @param {NDArray} x
+ * @returns {Array<NDArray|Int32Array>}
+ * @example
+ * import { lu_factor } from 'vectorious/core/lu_factor';
+ *
+ * lu_factor([[1, 3, 5], [2, 4, 7], [1, 1, 0]]); // => [array([[2, 4, 7], [0.5, 1, 1.5], [0.5, -1, -2]]), Int32Array([2, 2, 3])]
+ */
+const lu_factor = (x) => array_1.array(x).lu_factor();
+exports.lu_factor = lu_factor;
+/**
+ * @function lu_factor
+ * @memberof NDArray.prototype
+ * @description
+ * Performs LU factorization on current matrix.
+ * Accelerated with LAPACK `?getrf`.
+ * @returns {Array<NDArray|Int32Array>}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[1, 3, 5], [2, 4, 7], [1, 1, 0]]).lu_factor(); // <=> [array([[2, 4, 7], [0.5, 1, 1.5], [0.5, -1, -2]]), Int32Array([2, 2, 3])]
+ */
+function default_1() {
+    const { data: d1, shape: [n], dtype } = this;
+    const ipiv = new Int32Array(n);
+    try {
+        lapack.getrf(dtype, n, n, d1, n, ipiv);
+    }
+    catch (err) {
+        let max;
+        let abs;
+        let diag;
+        let p;
+        let i;
+        let j;
+        let k;
+        for (k = 0; k < n; k += 1) {
+            p = k;
+            max = Math.abs(d1[k * n + k]);
+            for (j = k + 1; j < n; j += 1) {
+                abs = Math.abs(d1[j * n + k]);
+                if (max < abs) {
+                    max = abs;
+                    p = j;
+                }
+            }
+            ipiv[k] = p + 1;
+            if (p !== k) {
+                this.swap(k, p);
+            }
+            diag = d1[k * n + k];
+            for (i = k + 1; i < n; i += 1) {
+                d1[i * n + k] /= diag;
+            }
+            for (i = k + 1; i < n; i += 1) {
+                for (j = k + 1; j < n - 1; j += 2) {
+                    d1[i * n + j] -= d1[i * n + k] * d1[k * n + j];
+                    d1[i * n + j + 1] -= d1[i * n + k] * d1[k * n + j + 1];
+                }
+                if (j === n - 1) {
+                    d1[i * n + j] -= d1[i * n + k] * d1[k * n + j];
+                }
+            }
+        }
+    }
+    return [this, ipiv];
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_magic.js.html b/docs/vectorious/6.0.3/core_magic.js.html new file mode 100644 index 00000000..dbef2405 --- /dev/null +++ b/docs/vectorious/6.0.3/core_magic.js.html @@ -0,0 +1,146 @@ + + + + + Vectorious: core/magic.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/magic.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.magic = void 0;
+const _1 = require("./");
+const iterator_1 = require("../iterator");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function magic
+ * @description Creates a magic square matrix of size `n`
+ * @param {Number} n
+ * @returns {NDArray}
+ * @example
+ * import { magic } from 'vectorious/core/magic';
+ *
+ * magic(3); // => array([[8, 1, 6], [3, 5, 7], [4, 9, 2]])
+ */
+const magic = (n) => {
+    if (n < 0) {
+        throw new Error('invalid n');
+    }
+    const d1 = new Float64Array(n * n);
+    const magic = new _1.NDArray(d1, { shape: [n, n] });
+    const iter = new iterator_1.NDIter(magic);
+    let [ci, cj] = iter.coords;
+    for (const i of iter) {
+        const a = n - ci - 1;
+        const b = n - cj - 1;
+        d1[i] = ((cj + a * 2 + 1) % n) * n + ((b + a * 2 + 1) % n) + 1;
+        [ci, cj] = iter.coords;
+    }
+    return magic;
+};
+exports.magic = magic;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_map.js.html b/docs/vectorious/6.0.3/core_map.js.html new file mode 100644 index 00000000..4faba572 --- /dev/null +++ b/docs/vectorious/6.0.3/core_map.js.html @@ -0,0 +1,154 @@ + + + + + Vectorious: core/map.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/map.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.map = void 0;
+const iterator_1 = require("../iterator");
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function map
+ * @description Equivalent to `TypedArray.prototype.map`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { map } from 'vectorious/core/map';
+ *
+ * map([1, 2, 3], value => -value); // => array([-1, -2, -3])
+ */
+const map = (x, f) => array_1.array(x).map(f);
+exports.map = map;
+/**
+ * @function map
+ * @memberof NDArray.prototype
+ * @description Equivalent to `TypedArray.prototype.map`.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).map(value => -value); // => array([-1, -2, -3])
+ */
+function default_1(f) {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    const map = f.bind(this);
+    const copy = this.copy();
+    const { data: d2 } = copy;
+    for (const i of iter) {
+        d2[i] = map(d1[i], i, d1);
+    }
+    return copy;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_matrix.js.html b/docs/vectorious/6.0.3/core_matrix.js.html new file mode 100644 index 00000000..6b430d7c --- /dev/null +++ b/docs/vectorious/6.0.3/core_matrix.js.html @@ -0,0 +1,131 @@ + + + + + Vectorious: core/matrix.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/matrix.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.matrix = void 0;
+const _1 = require("./");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function matrix
+ * @description Creates a matrix of `r` rows and `c` columns.
+ * @param {Number} r
+ * @param {Number} c
+ * @returns {NDArray}
+ * @example
+ * import { matrix } from 'vectorious/core/matrix';
+ *
+ * matrix(2, 2); // => array([[0, 0], [0, 0]])
+ */
+const matrix = (r, c) => new _1.NDArray(new Float64Array(r * c), { shape: [r, c] });
+exports.matrix = matrix;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_max.js.html b/docs/vectorious/6.0.3/core_max.js.html new file mode 100644 index 00000000..6a7a1ebb --- /dev/null +++ b/docs/vectorious/6.0.3/core_max.js.html @@ -0,0 +1,184 @@ + + + + + Vectorious: core/max.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/max.js

+ + + + + + +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.max = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const blas = __importStar(require("../blas"));
+/**
+ * @static
+ * @memberof module:Globals
+ * @function max
+ * @description
+ * Gets the maximum value (largest) element of `x`.
+ * Accelerated with BLAS `i?amax`.
+ * @param {NDArray} x
+ * @returns {Number}
+ * @example
+ * import { max } from 'vectorious/core/max';
+ *
+ * max([1, 2, 3]); // => 3
+ */
+const max = (x) => array_1.array(x).max();
+exports.max = max;
+/**
+ * @function max
+ * @memberof NDArray.prototype
+ * @description
+ * Gets the maximum value (smallest) element of current array.
+ * Accelerated with BLAS `i?amax`.
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).max(); // => 3
+ */
+function default_1() {
+    const { data: d1, length: l1, dtype } = this;
+    let max = Number.NEGATIVE_INFINITY;
+    try {
+        max = d1[blas.iamax(dtype, l1, d1, 1)];
+    }
+    catch (err) {
+        const iter = new iterator_1.NDIter(this);
+        for (const i of iter) {
+            const value = d1[i];
+            if (max < value) {
+                max = value;
+            }
+        }
+    }
+    return max;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_mean.js.html b/docs/vectorious/6.0.3/core_mean.js.html new file mode 100644 index 00000000..bdc96f42 --- /dev/null +++ b/docs/vectorious/6.0.3/core_mean.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/mean.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/mean.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.mean = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function mean
+ * @description Gets the arithmetic mean of `x`.
+ * @param {NDArray} x
+ * @returns {Number}
+ * @example
+ * import { mean } from 'vectorious/core/mean';
+ *
+ * mean([1, 2, 3]); // => 2
+ */
+const mean = (x) => array_1.array(x).mean();
+exports.mean = mean;
+/**
+ * @function mean
+ * @memberof NDArray.prototype
+ * @description Gets the arithmetic mean of current array.
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).mean(); // => 2
+ */
+function default_1() {
+    const { data: d1, length: l1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    let mean = 0;
+    for (const i of iter) {
+        mean += d1[i];
+    }
+    return mean / l1;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_min.js.html b/docs/vectorious/6.0.3/core_min.js.html new file mode 100644 index 00000000..40fb8449 --- /dev/null +++ b/docs/vectorious/6.0.3/core_min.js.html @@ -0,0 +1,155 @@ + + + + + Vectorious: core/min.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/min.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.min = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function min
+ * @description Gets the minimum value (smallest) element of `x`.
+ * @param {NDArray} x
+ * @returns {Number}
+ * @example
+ * import { min } from 'vectorious/core/min';
+ *
+ * min([1, 2, 3]); // => 1
+ */
+const min = (x) => array_1.array(x).min();
+exports.min = min;
+/**
+ * @function min
+ * @memberof NDArray.prototype
+ * @description Gets the minimum value (smallest) element of current array.
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).min(); // 1
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    let min = Number.POSITIVE_INFINITY;
+    for (const i of iter) {
+        const value = d1[i];
+        if (min > value) {
+            min = value;
+        }
+    }
+    return min;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_multiply.js.html b/docs/vectorious/6.0.3/core_multiply.js.html new file mode 100644 index 00000000..82ca237c --- /dev/null +++ b/docs/vectorious/6.0.3/core_multiply.js.html @@ -0,0 +1,196 @@ + + + + + Vectorious: core/multiply.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/multiply.js

+ + + + + + +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.multiply = void 0;
+const iterator_1 = require("../iterator");
+const array_1 = require("./array");
+const matrix_1 = require("./matrix");
+const blas = __importStar(require("../blas"));
+/**
+ * @static
+ * @memberof module:Globals
+ * @function multiply
+ * @description
+ * Multiplies two matrices `x` and `y` of matching dimensions.
+ * Accelerated with BLAS `?gemm`.
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @returns {NDArray}
+ * @example
+ * import { multiply } from 'vectorious/core/multiply';
+ *
+ * multiply([[1, 2]], [[1], [2]]); // => array([[5]])
+ */
+const multiply = (x, y) => array_1.array(x).multiply(array_1.array(y));
+exports.multiply = multiply;
+/**
+ * @function multiply
+ * @memberof NDArray.prototype
+ * @description
+ * Multiplies current matrix with `x`.
+ * Accelerated with BLAS `?gemm`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[1, 2]]).multiply([[1], [2]]); // <=> array([[5]])
+ */
+function default_1(x) {
+    const { shape: [r1, c1], data: d1, dtype } = this;
+    const { shape: [r2, c2], data: d2 } = x;
+    if (c1 !== r2) {
+        throw new Error('sizes do not match');
+    }
+    const y = matrix_1.matrix(r1, c2);
+    const { data: d3 } = y;
+    try {
+        blas.gemm(dtype, blas.NoTrans, blas.NoTrans, r1, c2, c1, 1, d1, c1, d2, c2, 0, d3, c2);
+    }
+    catch (err) {
+        const iter = new iterator_1.NDIter(y);
+        let k;
+        let [ci, cj] = iter.coords;
+        for (const i of iter) {
+            let sum = 0;
+            for (k = 0; k < c1; k += 1) {
+                sum += d1[ci * c1 + k] * d2[k * c2 + cj];
+            }
+            d3[i] = sum;
+            [ci, cj] = iter.coords;
+        }
+    }
+    return y;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_norm.js.html b/docs/vectorious/6.0.3/core_norm.js.html new file mode 100644 index 00000000..50a1ca34 --- /dev/null +++ b/docs/vectorious/6.0.3/core_norm.js.html @@ -0,0 +1,178 @@ + + + + + Vectorious: core/norm.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/norm.js

+ + + + + + +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.norm = void 0;
+const array_1 = require("./array");
+const blas = __importStar(require("../blas"));
+const { sqrt: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function norm
+ * @description
+ * Calculates the norm of current array (also called L2 norm or Euclidean length).
+ * Accelerated with BLAS `?nrm2`.
+ * @param {NDArray} x
+ * @returns {Number}
+ * @example
+ * import { norm } from 'vectorious/core/norm';
+ *
+ * norm([1, 2, 3]); // => 3.7416574954986572
+ */
+const norm = (x) => array_1.array(x).norm();
+exports.norm = norm;
+/**
+ * @function norm
+ * @memberof NDArray.prototype
+ * @description
+ * Calculates the norm of current array (also called L2 norm or Euclidean length).
+ * Accelerated with BLAS `?nrm2`.
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).norm(); // => 3.7416574954986572
+ */
+function default_1() {
+    const { data: d1, length: l1, dtype } = this;
+    let result = 0;
+    try {
+        result = blas.nrm2(dtype, l1, d1, 1);
+    }
+    catch (err) {
+        result = f(this.dot(this));
+    }
+    return result;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_normalize.js.html b/docs/vectorious/6.0.3/core_normalize.js.html new file mode 100644 index 00000000..a1a8e14e --- /dev/null +++ b/docs/vectorious/6.0.3/core_normalize.js.html @@ -0,0 +1,145 @@ + + + + + Vectorious: core/normalize.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/normalize.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.normalize = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function normalize
+ * @description Normalizes `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { normalize } from 'vectorious/core/normalize';
+ *
+ * normalize([1, 2, 3]); // => array([0.26726123690605164, 0.5345224738121033, 0.8017836809158325])
+ */
+const normalize = (x) => array_1.array(x).normalize();
+exports.normalize = normalize;
+/**
+ * @function normalize
+ * @memberof NDArray.prototype
+ * @description Normalizes current vector.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).normalize(); // => array([0.26726123690605164, 0.5345224738121033, 0.8017836809158325])
+ */
+function default_1() {
+    return this.scale(1 / this.norm());
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_ones.js.html b/docs/vectorious/6.0.3/core_ones.js.html new file mode 100644 index 00000000..e2145902 --- /dev/null +++ b/docs/vectorious/6.0.3/core_ones.js.html @@ -0,0 +1,130 @@ + + + + + Vectorious: core/ones.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/ones.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ones = void 0;
+const _1 = require("./");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function ones
+ * @description Creates an array containing ones (`1`) of shape `shape`
+ * @param {Number[]} ...shape
+ * @returns {NDArray}
+ * @example
+ * import { ones } from 'vectorious/core/ones';
+ *
+ * ones(3); // => array([1, 1, 1])
+ */
+const ones = (...shape) => new _1.NDArray(new Float64Array(shape.reduce((sum, dim) => sum * dim, 1)), { shape }).fill(1);
+exports.ones = ones;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_pow.js.html b/docs/vectorious/6.0.3/core_pow.js.html new file mode 100644 index 00000000..c83588fa --- /dev/null +++ b/docs/vectorious/6.0.3/core_pow.js.html @@ -0,0 +1,154 @@ + + + + + Vectorious: core/pow.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/pow.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.pow = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { pow: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function pow
+ * @description Returns each element of `x` to the exponent power, that is, element^exponent.
+ * @param {NDArray} x
+ * @param {Number} exponent
+ * @returns {NDArray}
+ * @example
+ * import { pow } from 'vectorious/core/pow';
+ *
+ * pow([1, 2, 3], 2); // => array([1, 4, 9])
+ */
+const pow = (x, exponent) => array_1.array(x).pow(exponent);
+exports.pow = pow;
+/**
+ * @function pow
+ * @memberof NDArray.prototype
+ * @description Returns each element of current array to the exponent power, that is, element^exponent.
+ * @param {Number} exponent
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).pow(2); // <=> array([1, 4, 9])
+ */
+function default_1(exponent) {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i], exponent);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_prod.js.html b/docs/vectorious/6.0.3/core_prod.js.html new file mode 100644 index 00000000..75fa7725 --- /dev/null +++ b/docs/vectorious/6.0.3/core_prod.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/prod.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/prod.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.prod = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function prod
+ * @description Product of all elements of `x`.
+ * @param {NDArray} x
+ * @returns {Number}
+ * @example
+ * import { prod } from 'vectorious/core/prod';
+ *
+ * prod([1, 2, 3]); // => 6
+ */
+const prod = (x) => array_1.array(x).prod();
+exports.prod = prod;
+/**
+ * @function prod
+ * @memberof NDArray.prototype
+ * @description Product of all elements of current array
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).prod(); // => 6
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    let prod = 1;
+    for (const i of iter) {
+        prod *= d1[i];
+    }
+    return prod;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_product.js.html b/docs/vectorious/6.0.3/core_product.js.html new file mode 100644 index 00000000..a1cfe2fc --- /dev/null +++ b/docs/vectorious/6.0.3/core_product.js.html @@ -0,0 +1,153 @@ + + + + + Vectorious: core/product.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/product.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.product = void 0;
+const iterator_1 = require("../iterator");
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function product
+ * @description Hadamard product of `x` and `y`
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @returns {NDArray}
+ * @example
+ * import { product } from 'vectorious/core/product';
+ *
+ * product([1, 2, 3], [4, 5, 6]); // => array([4, 10, 18])
+ */
+const product = (x, y) => array_1.array(x).product(array_1.array(y));
+exports.product = product;
+/**
+ * @function product
+ * @memberof NDArray.prototype
+ * @description Hadamard product of current matrix and `x`
+ * @returns {NDArray}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).product([4, 5, 6]); // <=> array([4, 10, 18])
+ */
+function default_1(x) {
+    const { data: d1 } = this;
+    const { data: d2 } = x;
+    const iter = new iterator_1.NDMultiIter(this, x);
+    for (const [i, j] of iter) {
+        d1[i] *= d2[j];
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_project.js.html b/docs/vectorious/6.0.3/core_project.js.html new file mode 100644 index 00000000..cb4f60d3 --- /dev/null +++ b/docs/vectorious/6.0.3/core_project.js.html @@ -0,0 +1,146 @@ + + + + + Vectorious: core/project.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/project.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.project = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function project
+ * @description Projects the `y` onto `x` using the projection formula `(y * (x * y / y * y))`.
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @returns {NDArray}
+ * @example
+ * import { project } from 'vectorious/core/project';
+ *
+ * project([1, 2, 3], [4, 5, 6]); // => array([1.6623376607894897, 2.0779221057891846, 2.49350643157959])
+ */
+const project = (x, y) => array_1.array(x).project(array_1.array(y));
+exports.project = project;
+/**
+ * @function project
+ * @memberof NDArray.prototype
+ * @description Projects the current vector onto `x` using the projection formula `(y * (x * y / y * y))`.
+ * @returns {NDArray}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).project([4, 5, 6]); // <=> array([1.6623376607894897, 2.0779221057891846, 2.49350643157959])
+ */
+function default_1(x) {
+    return x.scale(this.dot(x) / x.dot(x));
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_push.js.html b/docs/vectorious/6.0.3/core_push.js.html new file mode 100644 index 00000000..18bbb17c --- /dev/null +++ b/docs/vectorious/6.0.3/core_push.js.html @@ -0,0 +1,159 @@ + + + + + Vectorious: core/push.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/push.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.push = void 0;
+const util_1 = require("../util");
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function push
+ * @description Pushes a new `value` into `x`.
+ * @param {NDArray} x
+ * @param {Number} value
+ * @returns {NDArray}
+ * @example
+ * import { push } from 'vectorious/core/push';
+ *
+ * push([1, 2, 3], 4); // => array([1, 2, 3, 4])
+ */
+const push = (x, value) => array_1.array(x).push(value);
+exports.push = push;
+/**
+ * @function push
+ * @memberof NDArray.prototype
+ * @description Pushes a new `value` into current vector.
+ * @param {Number} value
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).push(4); // => array([1, 2, 3, 4])
+ */
+function default_1(value) {
+    if (this.shape.length !== 1) {
+        throw new Error('push operation not permitted for multidimensional arrays');
+    }
+    const { data: d1, length: l1 } = this;
+    const l2 = l1 + 1;
+    const d2 = new (util_1.get_type(this.dtype))(l2);
+    d2.set(d1);
+    d2[l1] = value;
+    this.data = d2;
+    this.length = l2;
+    this.shape = [l2];
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_random.js.html b/docs/vectorious/6.0.3/core_random.js.html new file mode 100644 index 00000000..bb325eb3 --- /dev/null +++ b/docs/vectorious/6.0.3/core_random.js.html @@ -0,0 +1,130 @@ + + + + + Vectorious: core/random.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/random.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.random = void 0;
+const _1 = require("./");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function random
+ * @description Creates a vector containing random samples from a uniform distribution over `[0, 1)` of shape `shape`
+ * @param {Number[]} ...shape
+ * @returns {NDArray}
+ * @example
+ * import { random } from 'vectorious/core/random';
+ *
+ * random(3); // => array([0.27496153116226196, 0.7581521272659302, 0.3682245910167694])
+ */
+const random = (...shape) => new _1.NDArray(new Float64Array(shape.reduce((sum, dim) => sum * dim, 1)), { shape }).map(() => Math.random());
+exports.random = random;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_range.js.html b/docs/vectorious/6.0.3/core_range.js.html new file mode 100644 index 00000000..7a2ab558 --- /dev/null +++ b/docs/vectorious/6.0.3/core_range.js.html @@ -0,0 +1,179 @@ + + + + + Vectorious: core/range.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/range.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.range = void 0;
+const _1 = require("./");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function range
+ * @description
+ * Creates an array containing a range (can be either ascending or descending)
+ * of numbers specified by the arguments provided (e.g. `NDArray.range(0, .5, 2)`
+ * gives an array containing all numbers in the interval `[0, 2)` separated by
+ * steps of `0.5`)
+ * @param {Number} start
+ * @param {Number} step
+ * @param {Number} stop
+ * @returns {NDArray}
+ * @example
+ * import { range } from 'vectorious/core/range';
+ *
+ * range(1, 2, 9); // => array([1, 3, 5, 7])
+ */
+const range = (...args) => {
+    const type = Float32Array;
+    let backwards = false;
+    let start;
+    let step;
+    let end;
+    switch (args.length) {
+        case 2:
+            end = args.pop();
+            step = 1;
+            start = args.pop();
+            break;
+        case 3:
+            end = args.pop();
+            step = args.pop();
+            start = args.pop();
+            break;
+        default:
+            throw new Error('invalid range');
+    }
+    if (end - start < 0) {
+        const copy = end;
+        end = start;
+        start = copy;
+        backwards = true;
+    }
+    if (step > end - start) {
+        throw new Error('invalid range');
+    }
+    const data = new type(Math.ceil((end - start) / step));
+    let i = start;
+    let j = 0;
+    if (backwards) {
+        for (; i < end; i += step, j += 1) {
+            data[j] = end - i + start;
+        }
+    }
+    else {
+        for (; i < end; i += step, j += 1) {
+            data[j] = i;
+        }
+    }
+    return new _1.NDArray(data);
+};
+exports.range = range;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_rank.js.html b/docs/vectorious/6.0.3/core_rank.js.html new file mode 100644 index 00000000..0143a39b --- /dev/null +++ b/docs/vectorious/6.0.3/core_rank.js.html @@ -0,0 +1,159 @@ + + + + + Vectorious: core/rank.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/rank.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.rank = void 0;
+const iterator_1 = require("../iterator");
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function rank
+ * @description Finds the rank of `x` using gaussian elimination.
+ * @param {NDArray} x
+ * @param {Number} tolerance
+ * @returns {Number}
+ * @example
+ * import { rank } from 'vectorious/core/rank';
+ *
+ * rank([[1, 1, 1], [2, 2, 2], [3, 3, 3]]); // => 1
+ */
+const rank = (x, tolerance = 1e-6) => array_1.array(x).rank(tolerance);
+exports.rank = rank;
+/**
+ * @function rank
+ * @memberof NDArray.prototype
+ * @description Finds the rank of current matrix using gaussian elimination.
+ * @param {Number} tolerance
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[1, 1, 1], [2, 2, 2], [3, 3, 3]]).rank(); // => 1
+ * @todo Switch to SVD algorithm
+ */
+function default_1(tolerance = 1e-6) {
+    const { data: d1 } = this.copy().gauss();
+    const iter = new iterator_1.NDIter(this);
+    let rk = 0;
+    let [ci, cj] = iter.coords;
+    for (const i of iter) {
+        if (rk <= ci && cj >= ci && d1[i] > tolerance) {
+            rk += 1;
+        }
+        [ci, cj] = iter.coords;
+    }
+    return rk;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_reciprocal.js.html b/docs/vectorious/6.0.3/core_reciprocal.js.html new file mode 100644 index 00000000..5a4b274e --- /dev/null +++ b/docs/vectorious/6.0.3/core_reciprocal.js.html @@ -0,0 +1,151 @@ + + + + + Vectorious: core/reciprocal.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/reciprocal.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.reciprocal = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function reciprocal
+ * @description Gets the element-wise reciprocal of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { reciprocal } from 'vectorious/core/reciprocal';
+ *
+ * reciprocal([1, 2, 3]); // => array([1, 0.5, 0.3333333432674408])
+ */
+const reciprocal = (x) => array_1.array(x).reciprocal();
+exports.reciprocal = reciprocal;
+/**
+ * @function reciprocal
+ * @memberof NDArray.prototype
+ * @description Gets the element-wise reciprocal of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]); // => array([1, 0.5, 0.3333333432674408])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = 1 / d1[i];
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_reduce.js.html b/docs/vectorious/6.0.3/core_reduce.js.html new file mode 100644 index 00000000..0279647f --- /dev/null +++ b/docs/vectorious/6.0.3/core_reduce.js.html @@ -0,0 +1,167 @@ + + + + + Vectorious: core/reduce.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/reduce.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.reduce = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function reduce
+ * @description Equivalent to `TypedArray.prototype.reduce`.
+ * @param {NDArray} x
+ * @param {Function} f
+ * @param {Number} initialValue
+ * @returns {Number}
+ * @example
+ * import { reduce } from 'vectorious/core/reduce';
+ *
+ * reduce([1, 2, 3], (a, b) => a + b, 0); // => 6
+ */
+const reduce = (x, f, initialValue) => array_1.array(x).reduce(f, initialValue);
+exports.reduce = reduce;
+/**
+ * @function reduce
+ * @memberof NDArray.prototype
+ * @description Equivalent to `TypedArray.prototype.reduce`.
+ * @param {Function} f
+ * @param {Number} initialValue
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).reduce((a, b) => a + b, 0); // => 6
+ */
+function default_1(f, initialValue) {
+    const { data: d1, length: l1 } = this;
+    if (l1 === 0 && typeof initialValue === 'undefined') {
+        throw new Error('Reduce of empty array with no initial value.');
+    }
+    const iter = new iterator_1.NDIter(this);
+    const reduce = f.bind(this);
+    let value;
+    if (typeof initialValue === 'undefined') {
+        value = d1[0];
+        iter.next();
+    }
+    else {
+        value = initialValue;
+    }
+    for (const i of iter) {
+        value = reduce(value, d1[i], i, d1);
+    }
+    return value;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_reshape.js.html b/docs/vectorious/6.0.3/core_reshape.js.html new file mode 100644 index 00000000..45795de8 --- /dev/null +++ b/docs/vectorious/6.0.3/core_reshape.js.html @@ -0,0 +1,154 @@ + + + + + Vectorious: core/reshape.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/reshape.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.reshape = void 0;
+const util_1 = require("../util");
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function reshape
+ * @description Reshapes `x`
+ * @param {NDArray} x
+ * @param {Number[]} ...shape
+ * @returns {NDArray}
+ * @example
+ * import { reshape } from 'vectorious/core/reshape';
+ *
+ * reshape([1, 2, 3, 4], 2, 2); // => array([[1, 2], [3, 4]])
+ */
+const reshape = (x, ...shape) => array_1.array(x).reshape(...shape);
+exports.reshape = reshape;
+/**
+ * @function reshape
+ * @memberof NDArray.prototype
+ * @description Reshapes current array
+ * @param {Number[]} ...shape
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3, 4]).reshape(2, 2); // <=> array([[1, 2], [3, 4]])
+ */
+function default_1(...shape) {
+    const { length } = this;
+    if (shape.reduce((sum, dim) => sum * dim, 1) !== length) {
+        throw new Error(`shape ${shape} does not match length ${length}`);
+    }
+    this.shape = shape;
+    this.strides = util_1.get_strides(shape);
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_round.js.html b/docs/vectorious/6.0.3/core_round.js.html new file mode 100644 index 00000000..9bf4fd74 --- /dev/null +++ b/docs/vectorious/6.0.3/core_round.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/round.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/round.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.round = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { round: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function round
+ * @description Returns the value of each element of `x` rounded to the nearest integer.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { round } from 'vectorious/core/round';
+ *
+ * round([1.2, 2.8, 3.5]); // => array([1, 3, 4])
+ */
+const round = (x) => array_1.array(x).round();
+exports.round = round;
+/**
+ * @function round
+ * @memberof NDArray.prototype
+ * @description Returns the value of each element of current array rounded to the nearest integer.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1.2, 2.8, 3.5]).round(); // <=> array([1, 3, 4])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_row_add.js.html b/docs/vectorious/6.0.3/core_row_add.js.html new file mode 100644 index 00000000..a0bb3c33 --- /dev/null +++ b/docs/vectorious/6.0.3/core_row_add.js.html @@ -0,0 +1,159 @@ + + + + + Vectorious: core/row_add.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/row_add.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.row_add = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function row_add
+ * @description Adds a multiple of one row multiplied by `scalar` to another inside `x`.
+ * @param {NDArray} x
+ * @param {Number} dest
+ * @param {Number} source
+ * @param {Number} scalar
+ * @returns {NDArray}
+ * @example
+ * import { row_add } from 'vectorious/core/row_add';
+ *
+ * row_add([[1, 2], [3, 4]], 1, 0, 2); // => array([[1, 2], [5, 8]])
+ */
+const row_add = (x, dest, source, scalar = 1) => array_1.array(x).row_add(dest, source, scalar);
+exports.row_add = row_add;
+/**
+ * @function row_add
+ * @memberof NDArray.prototype
+ * @description Adds a multiple of one row multiplied by `scalar` to another inside current matrix.
+ * @param {Number} dest
+ * @param {Number} source
+ * @param {Number} scalar
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[1, 2], [3, 4]]).row_add(1, 0, 2); // <=> array([[1, 2], [5, 8]])
+ */
+function default_1(dest, source, scalar = 1) {
+    this.check(dest, 0);
+    this.check(source, 0);
+    const [, c] = this.shape;
+    const { data: d1 } = this;
+    let j;
+    for (j = 0; j < c; j += 1) {
+        d1[dest * c + j] += d1[source * c + j] * scalar;
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_scale.js.html b/docs/vectorious/6.0.3/core_scale.js.html new file mode 100644 index 00000000..4173bc78 --- /dev/null +++ b/docs/vectorious/6.0.3/core_scale.js.html @@ -0,0 +1,182 @@ + + + + + Vectorious: core/scale.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/scale.js

+ + + + + + +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.scale = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const blas = __importStar(require("../blas"));
+/**
+ * @static
+ * @memberof module:Globals
+ * @function scale
+ * @description
+ * Multiplies all elements of `x` with a specified `scalar`.
+ * Accelerated with BLAS `?scal`.
+ * @param {NDArray} x
+ * @param {Number} scalar
+ * @returns {NDArray}
+ * @example
+ * import { scale } from 'vectorious/core/scale';
+ *
+ * scale([1, 2, 3], 2); // => array([2, 4, 6])
+ */
+const scale = (x, scalar) => array_1.array(x).scale(scalar);
+exports.scale = scale;
+/**
+ * @function scale
+ * @memberof NDArray.prototype
+ * @description
+ * Multiplies all elements of current array with a specified `scalar`.
+ * Accelerated with BLAS `?scal`.
+ * @param {Number} scalar
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).scale(2); // <=> array([2, 4, 6])
+ */
+function default_1(scalar) {
+    const { data: d1, length: l1, dtype } = this;
+    try {
+        blas.scal(dtype, l1, scalar, d1, 1);
+    }
+    catch (err) {
+        const iter = new iterator_1.NDIter(this);
+        for (const i of iter) {
+            d1[i] *= scalar;
+        }
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_set.js.html b/docs/vectorious/6.0.3/core_set.js.html new file mode 100644 index 00000000..8b1bd72d --- /dev/null +++ b/docs/vectorious/6.0.3/core_set.js.html @@ -0,0 +1,159 @@ + + + + + Vectorious: core/set.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/set.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.set = void 0;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function set
+ * @description Sets the element at `i, j, ..., n` to `value`.
+ * @param {NDArray} x
+ * @param {Number[]} ...indices
+ * @param {Number} value
+ * @returns {NDArray}
+ * @example
+ * import { set } from 'vectorious/core/set';
+ *
+ * set([1, 2, 3], 1, 0); // => array([1, 0, 3])
+ */
+const set = (x, ...args) => {
+    x.set(...args);
+};
+exports.set = set;
+/**
+ * @function set
+ * @memberof NDArray.prototype
+ * @description Sets the element at `i, j, ..., n` to `value`.
+ * @param {Number[]} ...indices
+ * @param {Number} value
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).set(1, 0); // <=> array([1, 0, 3])
+ */
+function default_1(...args) {
+    const indices = args.slice(0, -1);
+    const value = args[args.length - 1];
+    this.check(...indices);
+    const { shape: s1 } = this;
+    let index = indices[indices.length - 1];
+    let i;
+    for (i = 0; i < indices.length - 1; i += 1) {
+        index += indices[i] * s1[i + 1];
+    }
+    this.data[index] = value;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_sign.js.html b/docs/vectorious/6.0.3/core_sign.js.html new file mode 100644 index 00000000..c6069ea5 --- /dev/null +++ b/docs/vectorious/6.0.3/core_sign.js.html @@ -0,0 +1,156 @@ + + + + + Vectorious: core/sign.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/sign.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.sign = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { sign: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function sign
+ * @description
+ * Returns the sign of each element of `x`, indicating
+ * whether it is positive, negative or zero.
+ * @param {Number} x
+ * @returns {NDArray}
+ * @example
+ * import { sign } from 'vectorious/core/sign';
+ *
+ * sign([1, 2, 3]); // => array([1, 1, 1])
+ */
+const sign = (x) => array_1.array(x).sign();
+exports.sign = sign;
+/**
+ * @function sign
+ * @memberof NDArray.prototype
+ * @description
+ * Returns the sign of each element of current array, indicating
+ * whether it is positive, negative or zero.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).sign(); // <=> array([1, 1, 1])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_sin.js.html b/docs/vectorious/6.0.3/core_sin.js.html new file mode 100644 index 00000000..edb2789a --- /dev/null +++ b/docs/vectorious/6.0.3/core_sin.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/sin.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/sin.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.sin = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { sin: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function sin
+ * @description Returns the sine of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { sin } from 'vectorious/core/sin';
+ *
+ * sin([0, Math.PI / 2, Math.PI]); // => array([0, 1, 0])
+ */
+const sin = (x) => array_1.array(x).sin();
+exports.sin = sin;
+/**
+ * @function sin
+ * @memberof NDArray.prototype
+ * @description Returns the sine of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([0, Math.PI / 2, Math.PI]).sin(); // <=> array([0, 1, 0])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_sinh.js.html b/docs/vectorious/6.0.3/core_sinh.js.html new file mode 100644 index 00000000..522692a4 --- /dev/null +++ b/docs/vectorious/6.0.3/core_sinh.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/sinh.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/sinh.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.sinh = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { sinh: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function sinh
+ * @description Returns the hyperbolic sine of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { sinh } from 'vectorious/core/sinh';
+ *
+ * sinh([1, 2, 3]); // => array([1.175201177597046, 3.6268603801727295, 10.017874717712402])
+ */
+const sinh = (x) => array_1.array(x).sinh();
+exports.sinh = sinh;
+/**
+ * @function sinh
+ * @memberof NDArray.prototype
+ * @description Returns the hyperbolic sine of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).sinh(); // <=> array([1.175201177597046, 3.6268603801727295, 10.017874717712402])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_slice.js.html b/docs/vectorious/6.0.3/core_slice.js.html new file mode 100644 index 00000000..cf963bb1 --- /dev/null +++ b/docs/vectorious/6.0.3/core_slice.js.html @@ -0,0 +1,166 @@ + + + + + Vectorious: core/slice.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/slice.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.slice = void 0;
+const util_1 = require("../util");
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function slice
+ * @description Slices `x` in the corresponding dimension
+ * @param {NDArray} x
+ * @param {Number} begin
+ * @param {Number} end
+ * @param {Number} step
+ * @returns {NDArray}
+ * @example
+ * import { slice } from 'vectorious/core/slice';
+ *
+ * slice([1, 2, 3, 4], 0, 4, 2); // => array([1, 3])
+ */
+const slice = (x, begin, end, step) => array_1.array(x).slice(begin, end, step);
+exports.slice = slice;
+/**
+ * @function slice
+ * @memberof NDArray.prototype
+ * @description Slices the current array in the corresponding dimension
+ * @param {Number} begin
+ * @param {Number} end
+ * @param {Number} step
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3, 4]).slice(0, 4, 2); // => array([1, 3])
+ */
+function default_1(begin = 0, end = this.shape[0], step = 1) {
+    const { shape: s1 } = this;
+    const nd = s1.length;
+    if (begin < 0 || end < 0) {
+        return this.slice(begin < 0 ? nd + begin : begin, end < 0 ? nd + end : end);
+    }
+    if (step === 0) {
+        throw new Error('step argument cannot be 0');
+    }
+    const s2 = [Math.ceil((end - begin) / step), ...s1.slice(1)];
+    const l2 = s2.reduce((sum, dim) => sum * dim, 1);
+    const st2 = util_1.get_strides(s2);
+    this.shape = s2;
+    this.length = l2;
+    this.strides = st2;
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_solve.js.html b/docs/vectorious/6.0.3/core_solve.js.html new file mode 100644 index 00000000..27fa823f --- /dev/null +++ b/docs/vectorious/6.0.3/core_solve.js.html @@ -0,0 +1,203 @@ + + + + + Vectorious: core/solve.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/solve.js

+ + + + + + +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.solve = void 0;
+const array_1 = require("./array");
+const lapack = __importStar(require("../lapack"));
+/**
+ * @static
+ * @memberof module:Globals
+ * @function solve
+ * @description
+ * Solves the equation AX = B (where A is `x` and B is `y`).
+ * Accelerated with LAPACK `?gesv`.
+ * @param {NDArray} x
+ * @param {NDArray} y
+ * @returns {NDArray}
+ * @example
+ * import { solve } from 'vectorious/core/solve';
+ *
+ * solve([[1, 3, 5], [2, 4, 7], [1, 1, 0]], [[1], [3], [5]]); // => array([[3.25], [1.75], [-1.5]])
+ */
+const solve = (x, y) => array_1.array(x).solve(array_1.array(y));
+exports.solve = solve;
+/**
+ * @function solve
+ * @memberof NDArray.prototype
+ * @description
+ * Solves the equation AX = B (where A is current matrix and B is `x`).
+ * Accelerated with LAPACK `?gesv`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[1, 3, 5], [2, 4, 7], [1, 1, 0]]).solve([[1], [3], [5]]); // => array([[3.25], [1.75], [-1.5]])
+ */
+function default_1(x) {
+    const { data: d1, dtype } = this;
+    const { data: d2, shape: [n, nrhs] } = x;
+    try {
+        const ipiv = new Int32Array(n);
+        lapack.gesv(dtype, n, nrhs, d1, n, ipiv, d2, nrhs);
+    }
+    catch (err) {
+        const [LU, ipiv] = this.lu_factor();
+        const { data: d1 } = LU;
+        const { data: d2 } = x;
+        let i;
+        let j;
+        let k;
+        for (i = 0; i < ipiv.length; i += 1) {
+            if (i !== ipiv[i] - 1) {
+                x.swap(i, ipiv[i] - 1);
+            }
+        }
+        for (k = 0; k < nrhs; k += 1) {
+            for (i = 0; i < n; i += 1) {
+                for (j = 0; j < i; j += 1) {
+                    d2[i * nrhs + k] -= d1[i * n + j] * d2[j * nrhs + k];
+                }
+            }
+            for (i = n - 1; i >= 0; i -= 1) {
+                for (j = i + 1; j < n; j += 1) {
+                    d2[i * nrhs + k] -= d1[i * n + j] * d2[j * nrhs + k];
+                }
+                d2[i * nrhs + k] /= d1[i * n + i];
+            }
+        }
+    }
+    return x;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_sqrt.js.html b/docs/vectorious/6.0.3/core_sqrt.js.html new file mode 100644 index 00000000..99111b81 --- /dev/null +++ b/docs/vectorious/6.0.3/core_sqrt.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/sqrt.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/sqrt.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.sqrt = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { sqrt: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function sqrt
+ * @description Returns the positive square root of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { sqrt } from 'vectorious/core/sqrt';
+ *
+ * sqrt([1, 4, 9]); // => array([1, 2, 3])
+ */
+const sqrt = (x) => array_1.array(x).sqrt();
+exports.sqrt = sqrt;
+/**
+ * @function sqrt
+ * @memberof NDArray.prototype
+ * @description Returns the positive square root of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 4, 9]); // <=> array([1, 2, 3])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_square.js.html b/docs/vectorious/6.0.3/core_square.js.html new file mode 100644 index 00000000..e447d128 --- /dev/null +++ b/docs/vectorious/6.0.3/core_square.js.html @@ -0,0 +1,151 @@ + + + + + Vectorious: core/square.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/square.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.square = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function square
+ * @description Asserts if `x` is square.
+ * @param {NDArray} x
+ * @throws {Error} matrix is not square
+ * @example
+ * import { square } from 'vectorious/core/square';
+ *
+ * square([1, 2, 3]); // Error: matrix is not square
+ */
+const square = (x) => {
+    array_1.array(x).square();
+};
+exports.square = square;
+/**
+ * @function square
+ * @memberof NDArray.prototype
+ * @description Asserts if current matrix is square.
+ * @throws {Error} matrix is not square
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).square(); // Error: matrix is not square
+ */
+function default_1() {
+    const { length } = this.shape;
+    const [r, c] = this.shape;
+    if (length !== 2 || r !== c) {
+        throw new Error('matrix is not square');
+    }
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_subtract.js.html b/docs/vectorious/6.0.3/core_subtract.js.html new file mode 100644 index 00000000..deefac69 --- /dev/null +++ b/docs/vectorious/6.0.3/core_subtract.js.html @@ -0,0 +1,149 @@ + + + + + Vectorious: core/subtract.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/subtract.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.subtract = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function subtract
+ * @description
+ * Subtracts `y` from `x`.
+ * Accelerated with BLAS `?axpy`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { subtract } from 'vectorious/core/subtract';
+ *
+ * subtract([1, 2, 3], [1, 1, 1]); // => array([0, 1, 2])
+ */
+const subtract = (x, y) => array_1.array(x).subtract(array_1.array(y));
+exports.subtract = subtract;
+/**
+ * @function subtract
+ * @memberof NDArray.prototype
+ * @description
+ * Subtracts `x` from the current array.
+ * Accelerated with BLAS `?axpy`.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).subtract([1, 1, 1]); // <=> array([0, 1, 2])
+ */
+function default_1(x) {
+    return this.add(x, -1);
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_sum.js.html b/docs/vectorious/6.0.3/core_sum.js.html new file mode 100644 index 00000000..07e07356 --- /dev/null +++ b/docs/vectorious/6.0.3/core_sum.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/sum.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/sum.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.sum = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function sum
+ * @description Sum of `x`
+ * @param {NDArray} x
+ * @returns {Number}
+ * @example
+ * import { sum } from 'vectorious/core/sum';
+ *
+ * sum([1, 2, 3]); // => 6
+ */
+const sum = (x) => array_1.array(x).sum();
+exports.sum = sum;
+/**
+ * @function sum
+ * @memberof NDArray.prototype
+ * @description Sum of array elements
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).sum(); // => 6
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    let sum = 0;
+    for (const i of iter) {
+        sum += d1[i];
+    }
+    return sum;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_swap.js.html b/docs/vectorious/6.0.3/core_swap.js.html new file mode 100644 index 00000000..1f11b0c7 --- /dev/null +++ b/docs/vectorious/6.0.3/core_swap.js.html @@ -0,0 +1,156 @@ + + + + + Vectorious: core/swap.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/swap.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.swap = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function swap
+ * @description Swaps two rows `i` and `j` in `x`.
+ * @param {NDArray} x
+ * @param {Number} i
+ * @param {Number} j
+ * @returns {NDArray}
+ * @example
+ * import { swap } from 'vectorious/core/swap';
+ *
+ * swap([[1, 2], [3, 4]], 0, 1); // => array([[3, 4], [1, 2]])
+ */
+const swap = (x, i, j) => array_1.array(x).swap(i, j);
+exports.swap = swap;
+/**
+ * @function swap
+ * @memberof NDArray.prototype
+ * @description Swaps two rows `i` and `j` in current matrix
+ * @param {Number} i
+ * @param {Number} j
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[1, 2], [3, 4]]); // <=> array([[3, 4], [1, 2]])
+ */
+function default_1(i, j) {
+    this.check(i, 0);
+    this.check(j, 0);
+    const { data: d1 } = this;
+    const [, c] = this.shape;
+    const d2 = d1.slice(i * c, (i + 1) * c);
+    d1.copyWithin(i * c, j * c, (j + 1) * c);
+    d1.set(d2, j * c);
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_tan.js.html b/docs/vectorious/6.0.3/core_tan.js.html new file mode 100644 index 00000000..b49dbe1c --- /dev/null +++ b/docs/vectorious/6.0.3/core_tan.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/tan.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/tan.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.tan = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { tan: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function tan
+ * @description Returns the tangent of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { tan } from 'vectorious/core/tan';
+ *
+ * tan([1, 2, 3]); // => array([1.5574077367782593, -2.185039758682251, -0.14254654943943024])
+ */
+const tan = (x) => array_1.array(x).tan();
+exports.tan = tan;
+/**
+ * @function tan
+ * @memberof NDArray.prototype
+ * @description Returns the tangent of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).tan(); // <=> array([1.5574077367782593, -2.185039758682251, -0.14254654943943024])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_tanh.js.html b/docs/vectorious/6.0.3/core_tanh.js.html new file mode 100644 index 00000000..56fa47e4 --- /dev/null +++ b/docs/vectorious/6.0.3/core_tanh.js.html @@ -0,0 +1,152 @@ + + + + + Vectorious: core/tanh.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/tanh.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.tanh = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { tanh: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function tanh
+ * @description Returns the hyperbolic tangent of each element of `x`.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { tanh } from 'vectorious/core/tanh';
+ *
+ * tanh([1, 2, 3]); // => array([0.7615941762924194, 0.9640275835990906, 0.9950547814369202])
+ */
+const tanh = (x) => array_1.array(x).tanh();
+exports.tanh = tanh;
+/**
+ * @function tanh
+ * @memberof NDArray.prototype
+ * @description Returns the hyperbolic tangent of each element of current array.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).tanh(); // <=> array([0.7615941762924194, 0.9640275835990906, 0.9950547814369202])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_toArray.js.html b/docs/vectorious/6.0.3/core_toArray.js.html new file mode 100644 index 00000000..fd6e953a --- /dev/null +++ b/docs/vectorious/6.0.3/core_toArray.js.html @@ -0,0 +1,163 @@ + + + + + Vectorious: core/toArray.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/toArray.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.toArray = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function toArray
+ * @description Converts `x` into a JavaScript array.
+ * @param {NDArray} x
+ * @returns {Array}
+ * @example
+ * import { toArray } from 'vectorious/core/toArray';
+ *
+ * toArray([1, 2, 3]); // => [1, 2, 3]
+ */
+const toArray = (x) => array_1.array(x).toArray();
+exports.toArray = toArray;
+/**
+ * @function toArray
+ * @memberof NDArray.prototype
+ * @description Converts current vector into a JavaScript array.
+ * @param {Number} index
+ * @param {Number} dim
+ * @returns {Array}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).toArray(); // => [1, 2, 3]
+ */
+function default_1(index = 0, dim = 0) {
+    const { data: d1, shape: s1, strides: st1 } = this;
+    const { length: ndim } = s1;
+    if (dim >= ndim) {
+        return d1[index];
+    }
+    const n = s1[dim];
+    const stride = st1[dim];
+    const list = [];
+    for (let i = 0; i < n; i++) {
+        const item = this.toArray(index, dim + 1);
+        if (item === null) {
+            return null;
+        }
+        list[i] = item;
+        index += stride;
+    }
+    return list;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_toString.js.html b/docs/vectorious/6.0.3/core_toString.js.html new file mode 100644 index 00000000..8d918b18 --- /dev/null +++ b/docs/vectorious/6.0.3/core_toString.js.html @@ -0,0 +1,146 @@ + + + + + Vectorious: core/toString.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/toString.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.toString = void 0;
+const util_1 = require("util");
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function toString
+ * @description Converts `x` into a readable formatted string.
+ * @param {NDArray} x
+ * @returns {String}
+ * @example
+ * import { toString } from 'vectorious/core/toString';
+ *
+ * toString([1, 2, 3]); // => '1,2,3'
+ */
+const toString = (x) => array_1.array(x).toString();
+exports.toString = toString;
+/**
+ * @function toString
+ * @memberof NDArray.prototype
+ * @description Converts current vector into a readable formatted string.
+ * @returns {String}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).toString(); // => '1,2,3'
+ */
+function default_1() {
+    return `array(${util_1.inspect(this.toArray(), { depth: 10, breakLength: 40 })}, dtype=${this.dtype})`;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_trace.js.html b/docs/vectorious/6.0.3/core_trace.js.html new file mode 100644 index 00000000..ab0cf3c8 --- /dev/null +++ b/docs/vectorious/6.0.3/core_trace.js.html @@ -0,0 +1,153 @@ + + + + + Vectorious: core/trace.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/trace.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.trace = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function trace
+ * @description Gets the trace of `x` (the sum of all diagonal elements).
+ * @param {NDArray} x
+ * @returns {Number}
+ * @example
+ * import { trace } from 'vectorious/core/trace';
+ *
+ * trace([[1, 2], [3, 4]]); // => 5
+ */
+const trace = (x) => array_1.array(x).trace();
+exports.trace = trace;
+/**
+ * @function trace
+ * @memberof NDArray.prototype
+ * @description Gets the trace of the matrix (the sum of all diagonal elements).
+ * @returns {Number}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1, 2, 3]).trace(); // => 5
+ */
+function default_1() {
+    const [r, c] = this.shape;
+    const { data: d1 } = this;
+    const n = Math.min(r, c);
+    let result = 0;
+    let j;
+    for (j = 0; j < n; j += 1) {
+        result += d1[j * c + j];
+    }
+    return result;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_transpose.js.html b/docs/vectorious/6.0.3/core_transpose.js.html new file mode 100644 index 00000000..39fb4446 --- /dev/null +++ b/docs/vectorious/6.0.3/core_transpose.js.html @@ -0,0 +1,154 @@ + + + + + Vectorious: core/transpose.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/transpose.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.transpose = void 0;
+const array_1 = require("./array");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function transpose
+ * @description Transposes `x` (mirror across the diagonal).
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { transpose } from 'vectorious/core/transpose';
+ *
+ * transpose([[1, 2, 3], [4, 5, 6], [7, 8, 9]]); // => array([[1, 4, 7], [2, 5, 8], [3, 6, 9]])
+ */
+const transpose = (x) => array_1.array(x).transpose();
+exports.transpose = transpose;
+/**
+ * @function transpose
+ * @memberof NDArray.prototype
+ * @description Transposes current matrix (mirror across the diagonal).
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]); // <=> array([[1, 4, 7], [2, 5, 8], [3, 6, 9]])
+ */
+function default_1() {
+    if (this.shape.length < 2) {
+        return this;
+    }
+    let tmp = this.shape[0];
+    this.shape[0] = this.shape[1];
+    this.shape[1] = tmp;
+    tmp = this.strides[0];
+    this.strides[0] = this.strides[1];
+    this.strides[1] = tmp;
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_trunc.js.html b/docs/vectorious/6.0.3/core_trunc.js.html new file mode 100644 index 00000000..e84d4378 --- /dev/null +++ b/docs/vectorious/6.0.3/core_trunc.js.html @@ -0,0 +1,156 @@ + + + + + Vectorious: core/trunc.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/trunc.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.trunc = void 0;
+const array_1 = require("./array");
+const iterator_1 = require("../iterator");
+const { trunc: f } = Math;
+/**
+ * @static
+ * @memberof module:Globals
+ * @function trunc
+ * @description
+ * Returns the integer part of each element of `x`,
+ * removing any fractional digits.
+ * @param {NDArray} x
+ * @returns {NDArray}
+ * @example
+ * import { trunc } from 'vectorious/core/trunc';
+ *
+ * trunc([1.2, 2.8, 3.5]); // => array([1, 2, 3])
+ */
+const trunc = (x) => array_1.array(x).trunc();
+exports.trunc = trunc;
+/**
+ * @function trunc
+ * @memberof NDArray.prototype
+ * @description
+ * Returns the integer part of each element of current array,
+ * removing any fractional digits.
+ * @returns {this}
+ * @example
+ * import { array } from 'vectorious/core/array';
+ *
+ * array([1.2, 2.8, 3.5]).trunc(); // => array([1, 2, 3])
+ */
+function default_1() {
+    const { data: d1 } = this;
+    const iter = new iterator_1.NDIter(this);
+    for (const i of iter) {
+        d1[i] = f(d1[i]);
+    }
+    return this;
+}
+exports.default = default_1;
+;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/core_zeros.js.html b/docs/vectorious/6.0.3/core_zeros.js.html new file mode 100644 index 00000000..3c6f2fdc --- /dev/null +++ b/docs/vectorious/6.0.3/core_zeros.js.html @@ -0,0 +1,130 @@ + + + + + Vectorious: core/zeros.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

core/zeros.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.zeros = void 0;
+const _1 = require("./");
+/**
+ * @static
+ * @memberof module:Globals
+ * @function zeros
+ * @description Creates an array containing zeros (`0`) of shape `shape`
+ * @param {Number[]} ...shape
+ * @returns {NDArray}
+ * @example
+ * import { zeros } from 'vectorious/core/zeros';
+ *
+ * zeros(3); // => array([0, 0, 0])
+ */
+const zeros = (...shape) => new _1.NDArray(new Float64Array(shape.reduce((sum, dim) => sum * dim, 1)), { shape }).fill(0);
+exports.zeros = zeros;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/index.html b/docs/vectorious/6.0.3/index.html new file mode 100644 index 00000000..785ad481 --- /dev/null +++ b/docs/vectorious/6.0.3/index.html @@ -0,0 +1,209 @@ + + + + + Vectorious: + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

+

+ + + + + + + +

vectorious 6.0.3

+ + + + + + + + + + + + + + + +
+

+ Vectorious Logo +

+

+ A linear algebra library, written in TypeScript and accelerated with C++ bindings to BLAS and LAPACK. +

+

+ +

+

Usage

+

Follow the installation instructions in nlapack and nblas to get maximum performance.

+
# with C++ bindings
+$ npm install vectorious
+
+# or, if you don't want C++ bindings
+$ npm install vectorious --no-optional
+
+
import v = require('vectorious');
+
+const x = v.random(2, 2);
+/*
+array([
+  [
+    0.26472008228302,
+    0.4102575480937958
+  ],
+  [
+    0.4068726599216461,
+    0.4589384198188782
+  ]
+], dtype=float64)
+*/
+
+const y = v.range(0, 9).reshape(3, 3);
+/*
+array([
+  [ 0, 1, 2 ],
+  [ 3, 4, 5 ],
+  [ 6, 7, 8 ]
+], dtype=float64)
+*/
+
+const z = v.array([[1, 2], [3, 4]]);
+/*
+array([ [ 1, 2 ], [ 3, 4 ] ], dtype=float64)
+*/
+
+x.add(z);
+/*
+array([
+  [
+    1.26472008228302,
+    2.410257577896118
+  ],
+  [
+    3.4068727493286133,
+    4.4589385986328125
+  ]
+], dtype=float64)
+*/
+
+

Documentation

+ +

Examples

+

Basic

+ +

Machine learning

+ +

Benchmarks

+

Run benchmarks with

+
$ npm run benchmark
+
+
+ + + + + + +
+
+ + + + + \ No newline at end of file diff --git a/docs/vectorious/6.0.3/index.js.html b/docs/vectorious/6.0.3/index.js.html new file mode 100644 index 00000000..543352e4 --- /dev/null +++ b/docs/vectorious/6.0.3/index.js.html @@ -0,0 +1,129 @@ + + + + + Vectorious: index.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

index.js

+ + + + + + +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * @module Globals
+ */
+__exportStar(require("./core"), exports);
+__exportStar(require("./iterator"), exports);
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/index.ts.html b/docs/vectorious/6.0.3/index.ts.html new file mode 100644 index 00000000..60589675 --- /dev/null +++ b/docs/vectorious/6.0.3/index.ts.html @@ -0,0 +1,85 @@ + + + + + Vectorious: index.ts + + + + + + + + + + + + +
+ +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

index.ts

+ + + + + + +
+
+
/**
+ * @module Globals
+ */
+export * from './core';
+export * from './iterator';
+
+
+
+ + + + +
+
+ + + + + + + + diff --git a/docs/vectorious/6.0.3/iterator_index.js.html b/docs/vectorious/6.0.3/iterator_index.js.html new file mode 100644 index 00000000..a85a9662 --- /dev/null +++ b/docs/vectorious/6.0.3/iterator_index.js.html @@ -0,0 +1,435 @@ + + + + + Vectorious: iterator/index.js + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

source

+

iterator/index.js

+ + + + + + +
+
+
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.NDMultiIter = exports.NDIter = exports.V_MAXDIMS = void 0;
+const array_1 = require("../core/array");
+exports.V_MAXDIMS = 32;
+/**
+ * @class NDIter
+ * @description Constructs an NDIter instance.
+ * @param {NDArray} x
+ */
+class NDIter {
+    constructor(x) {
+        this.x = array_1.array(x);
+        const { shape, strides, length, } = this.x;
+        this.length = length;
+        this.lengthm1 = length - 1;
+        this.nd = shape.length;
+        this.ndm1 = this.nd - 1;
+        this.shape = Array(exports.V_MAXDIMS).fill(0);
+        this.strides = Array(exports.V_MAXDIMS).fill(0);
+        this.shapem1 = Array(exports.V_MAXDIMS).fill(0);
+        this.coords = Array(exports.V_MAXDIMS).fill(0);
+        this.backstrides = Array(exports.V_MAXDIMS).fill(0);
+        this.factors = Array(exports.V_MAXDIMS).fill(0);
+        if (this.nd !== 0) {
+            this.factors[this.nd - 1] = 1;
+        }
+        this.contiguous = true;
+        let stride = 1;
+        let i;
+        for (i = 0; i < this.nd; i += 1) {
+            this.shape[i] = shape[i];
+            this.shapem1[i] = shape[i] - 1;
+            this.strides[i] = strides[i];
+            this.backstrides[i] = strides[i] * this.shapem1[i];
+            this.coords[i] = 0;
+            // Check if C-contiguous
+            if (shape[this.ndm1 - i] !== 1) {
+                if (strides[i] !== stride) {
+                    this.contiguous = false;
+                }
+                stride *= shape[this.ndm1 - i];
+            }
+            if (i > 0) {
+                this.factors[this.ndm1 - i] = this.factors[this.nd - i] * shape[this.nd - i];
+            }
+        }
+        this.index = 0;
+        this.pos = 0;
+    }
+    /**
+     * @function done
+     * @memberof NDIter.prototype
+     * @description Returns true if the iterator is done, false otherwise
+     * @returns {Boolean}
+     * @example
+     * import { array } from 'vectorious/core/array';
+     * import { NDIter } from 'vectorious/iterator';
+     *
+     * const iter = new NDIter(array([1, 2, 3]));
+     * iter.done(); // false
+     */
+    done() {
+        return this.index > this.lengthm1;
+    }
+    /**
+     * @function current
+     * @memberof NDIter.prototype
+     * @description Returns the current element of the iterator
+     * @returns {Object} current
+     * @returns {Number} [current.value]
+     * @returns {Boolean} current.done
+     * @example
+     * import { array } from 'vectorious/core/array';
+     * import { NDIter } from 'vectorious/iterator';
+     *
+     * const iter = new NDIter(array([1, 2, 3]));
+     * iter.current(); // { value: 1, done: false }
+     */
+    current() {
+        const done = this.done();
+        return {
+            value: done ? undefined : this.pos,
+            done,
+        };
+    }
+    /**
+     * @function next1d
+     * @memberof NDIter.prototype
+     * @description Steps to the next position in the iterator, assuming it is 1 dimensional.
+     */
+    next1d() {
+        const { strides, } = this;
+        this.pos += strides[0];
+        this.coords[0] += 1;
+    }
+    /**
+     * @function nextcontiguous
+     * @memberof NDIter.prototype
+     * @description Steps to the next position in the iterator, assuming its data is contiguous.
+     */
+    nextcontiguous() {
+        this.pos += 1;
+    }
+    /**
+     * @function next2d
+     * @memberof NDIter.prototype
+     * @description Steps to the next position in the iterator, assuming it is 2 dimensional.
+     */
+    next2d() {
+        const { strides, shapem1, backstrides, } = this;
+        if (this.coords[1] < shapem1[1]) {
+            this.coords[1] += 1;
+            this.pos += strides[1];
+        }
+        else {
+            this.coords[1] = 0;
+            this.coords[0] += 1;
+            this.pos += strides[0] - backstrides[1];
+        }
+    }
+    /**
+     * @function next2d
+     * @memberof NDIter.prototype
+     * @description Steps to the next position in the iterator
+     */
+    nextnd() {
+        const { ndm1, shapem1, strides, backstrides, } = this;
+        let i;
+        for (i = ndm1; i >= 0; i -= 1) {
+            if (this.coords[i] < shapem1[i]) {
+                this.coords[i] += 1;
+                this.pos += strides[i];
+                break;
+            }
+            this.coords[i] = 0;
+            this.pos -= backstrides[i];
+        }
+    }
+    /**
+     * @function next
+     * @memberof NDIter.prototype
+     * @description
+     * Steps to the next position in the iterator.
+     * Returns the current index of the iterator, or undefined if done.
+     * @returns {Object}
+     * @example
+     * import { array } from 'vectorious/core/array';
+     * import { NDIter } from 'vectorious/iterator';
+     *
+     * const iter = new NDIter(array([1, 2, 3]));
+     * iter.next(); // { value: 2, done: false }
+     * iter.next(); // { value: 3, done: false }
+     * iter.next(); // { done: true }
+     */
+    next() {
+        const current = this.current();
+        this.index += 1;
+        const { ndm1, contiguous, } = this;
+        if (ndm1 === 0) {
+            this.next1d();
+        }
+        else if (contiguous) {
+            this.nextcontiguous();
+        }
+        else if (ndm1 === 1) {
+            this.next2d();
+        }
+        else {
+            this.nextnd();
+        }
+        return current;
+    }
+    [Symbol.iterator]() {
+        return this;
+    }
+}
+exports.NDIter = NDIter;
+/**
+ * @class NDMultiIter
+ * @description Constructs an NDMultiIter instance.
+ * @param {NDArray[]} ...args
+ */
+class NDMultiIter {
+    constructor(...args) {
+        this.iters = args.map(arg => new NDIter(arg));
+        this.numiter = args.length;
+        let i;
+        let nd;
+        for (i = 0, nd = 0; i < this.numiter; i += 1) {
+            nd = Math.max(nd, this.iters[i].x.shape.length);
+        }
+        this.nd = nd;
+        this.shape = Array(nd).fill(0);
+        let it;
+        let j;
+        let k;
+        let tmp;
+        for (i = 0; i < nd; i += 1) {
+            this.shape[i] = 1;
+            for (j = 0; j < this.numiter; j += 1) {
+                it = this.iters[j];
+                k = i + it.x.shape.length - nd;
+                if (k >= 0) {
+                    tmp = it.x.shape[k];
+                    if (tmp == 1) {
+                        continue;
+                    }
+                    if (this.shape[i] == 1) {
+                        this.shape[i] = tmp;
+                    }
+                    else if (this.shape[i] !== tmp) {
+                        throw new Error('shape mismatch');
+                    }
+                }
+            }
+        }
+        tmp = this.shape.reduce((acc, dim) => acc * dim, 1);
+        this.length = tmp;
+        this.lengthm1 = tmp - 1;
+        for (i = 0; i < this.numiter; i += 1) {
+            it = this.iters[i];
+            it.nd = this.nd;
+            it.ndm1 = this.nd - 1;
+            it.length = tmp;
+            it.lengthm1 = tmp - 1;
+            nd = it.x.shape.length;
+            if (nd !== 0) {
+                it.factors[this.nd - 1] = 1;
+            }
+            for (j = 0; j < this.nd; j += 1) {
+                it.shape[j] = this.shape[j];
+                it.shapem1[j] = this.shape[j] - 1;
+                k = j + nd - this.nd;
+                if ((k < 0) || it.x.shape[k] !== this.shape[j]) {
+                    it.contiguous = false;
+                    it.strides[j] = 0;
+                }
+                else {
+                    it.strides[j] = it.x.strides[k];
+                }
+                it.backstrides[j] = it.strides[j] * it.shapem1[j];
+                if (j > 0) {
+                    it.factors[this.nd - j - 1] = it.factors[this.nd - j] * this.shape[this.nd - j];
+                }
+            }
+        }
+        this.index = 0;
+        this.pos = Array(this.numiter).fill(0);
+    }
+    /**
+     * @function done
+     * @memberof NDMultiIter
+     * @description Returns true if the iterator is done, false otherwise
+     * @returns {Boolean}
+     * @example
+     * import { array } from 'vectorious/core/array';
+     * import { NDMultiIter } from 'vectorious/iterator';
+     *
+     * const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6]));
+     * iter.done(); // false
+     */
+    done() {
+        return this.index > this.lengthm1;
+    }
+    /**
+     * @function current
+     * @memberof NDMultiIter
+     * @description Returns the current indices of the iterators
+     * @returns {Object} current
+     * @returns {Number[]} [current.value]
+     * @returns {Boolean} current.done
+     * @example
+     * import { array } from 'vectorious/core/array';
+     * import { NDMultiIter } from 'vectorious/iterator';
+     *
+     * const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6]));
+     * iter.current(); // { value: [0, 0], done: false }
+     */
+    current() {
+        const done = this.done();
+        return {
+            value: done ? undefined : this.pos,
+            done,
+        };
+    }
+    /**
+     * @function next
+     * @memberof NDMultiIter
+     * @description
+     * Steps to the next position in the iterator.
+     * Returns the current indices of the iterators, or undefined if done.
+     * @returns {Object} current
+     * @returns {Number[]} [current.value]
+     * @returns {Boolean} current.done
+     * @example
+     * import { array } from 'vectorious/core/array';
+     * import { NDMultiIter } from 'vectorious/iterator';
+     *
+     * const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6]));
+     * iter.next(); // { value: [0, 0], done: false }
+     * iter.next(); // { value: [1, 1], done: false }
+     * iter.next(); // { value: [2, 2], done: false },
+     * iter.next(); // { value: undefined, done: true },
+     */
+    next() {
+        const current = this.current();
+        this.index += 1;
+        const { numiter, } = this;
+        let it;
+        let i;
+        for (i = 0; i < numiter; i += 1) {
+            it = this.iters[i];
+            this.pos[i] = it.pos;
+            it.next();
+        }
+        return current;
+    }
+    [Symbol.iterator]() {
+        return this;
+    }
+}
+exports.NDMultiIter = NDMultiIter;
+
+
+
+ + + + +
+
+ + + + + diff --git a/docs/vectorious/6.0.3/module-Globals.html b/docs/vectorious/6.0.3/module-Globals.html new file mode 100644 index 00000000..ad7258f7 --- /dev/null +++ b/docs/vectorious/6.0.3/module-Globals.html @@ -0,0 +1,14509 @@ + + + + + Vectorious: Globals + + + + + + + + + + + + + +
+ + + Vectorious + + +

+ + Vectorious + +

+ +
+ + +
+
+

Module

+

Globals

+ + + + + +
+ + +
+ + + + + +
+ +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + +

Methods

+ + + + + +
+ + + + + + + + + +
+ static +
+ +

abs(x) → {NDArray} +

+ + + + + +
+ +

Returns the absolute value of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { abs } from 'vectorious/core/abs';
+
+abs([-1, -2, -3]) // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

acos(x) → {NDArray} +

+ + + + + +
+ +

Returns the arccosine of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { acos } from 'vectorious/core/acos';
+
+acos([-1, 0, 1]); // => array([3.141592653589793, 1.5707963267948966, 0])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

acosh(x) → {NDArray} +

+ + + + + +
+ +

Returns the hyperbolic arccosine of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { acosh } from 'vectorious/core/acosh';
+
+acosh([1, 2, 3]); // => array([0, 1.316957950592041, 1.7627471685409546])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

add(x, y) → {NDArray} +

+ + + + + +
+ +

Adds y multiplied by alpha to x. +Accelerated with BLAS ?axpy.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { add } from 'vectorious/core/add';
+
+add([1, 2, 3], [4, 5, 6]); // => array([5, 7, 9])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

angle(x, y) → {number} +

+ + + + + +
+ +

Determines the angle between the x and y

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + number + + +
  • + +
+ + + + +

Example

+ +
import { angle } from 'vectorious/core/angle';
+
+angle([1, 2, 3], [4, 5, 6]); // => 0.22572622788897287
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

array() → {NDArray} +

+ + + + + +
+ +

array(...args) is an alias for new v(...args)

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + ...args + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { array } from 'vectorious/core/array';
+
+array([1, 2, 3]); // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

asin(x) → {NDArray} +

+ + + + + +
+ +

Returns the arcsine of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { asin } from 'vectorious/core/asin';
+
+asin([-1, 0, 1]) // => array([-1.5707963705062866, 0, 1.5707963705062866])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

asinh(x) → {NDArray} +

+ + + + + +
+ +

Returns the hyperbolic arcsine of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { asinh } from 'vectorious/core/asinh';
+
+asinh([0, 1, 2]) // => array([0, 0.8813735842704773, 1.4436354637145996])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

atan(x) → {NDArray} +

+ + + + + +
+ +

Returns the arctangent of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { atan } from 'vectorious/core/atan';
+
+atan([1, 2, 3]); // => array([0.7853981852531433, 1.1071487665176392, 1.249045729637146])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

atanh(x) → {NDArray} +

+ + + + + +
+ +

Returns the hyperbolic arctangent of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { atanh } from 'vectorious/core/atanh';
+
+atanh([0, -0.5]); // => array([0, -0.5493061542510986])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

augment(x, y) → {NDArray} +

+ + + + + +
+ +

Augments x and y.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { augment } from 'vectorious/core/augment';
+
+augment([[1, 2], [3, 4]], [[1], [2]]); // => array([[1, 2, 1], [3, 4, 2]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

binOp(x, y) → {NDArray} +

+ + + + + +
+ +

Perform binary operation f on y in x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { binOp } from 'vectorious/core/binOp';
+
+binOp([1, 2, 3], [4, 5, 6], (a, b) => a + b); // => array([[5, 7, 9])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

cbrt(x) → {NDArray} +

+ + + + + +
+ +

Returns the cube root of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { cbrt } from 'vectorious/core/cbrt';
+
+cbrt([1, 8, 27]); // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

ceil(x) → {NDArray} +

+ + + + + +
+ +

Returns smallest integer greater than or equal to of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { ceil } from 'vectorious/core/ceil';
+
+ceil([0.5, 1.5, 2.5]); // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

check(x) +

+ + + + + +
+ +

Asserts if indices i, j, ..., n are within the bounds of x

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + ...indices + + + + + + + + Array.<Number> + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +

Example

+ +
import { check } from 'vectorious/core/check';
+
+check([0.5, 1.5, 2.5], 3); // Error: index out of bounds
+ + + + + + + + + + + + +

Throws

+ + + +
+
+
+

index out of bounds

+
+
+
+
+
+
+ Type +
+
+ + + + + Error + + + +
+
+
+
+
+ + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

combine(x, y) → {NDArray} +

+ + + + + +
+ +

Combines the vector x with y

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { combine } from 'vectorious/core/combine';
+
+combine([1, 2, 3], [4, 5, 6]); // => array([1, 2, 3, 4, 5, 6])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

copy(x) → {NDArray} +

+ + + + + +
+ +

Makes a copy of x

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { copy } from 'vectorious/core/copy';
+
+copy([1, 2, 3]); // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

cos(x) → {NDArray} +

+ + + + + +
+ +

Returns the cosine of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { cos } from 'vectorious/core/cos';
+
+cos([0, Math.PI / 2, Math.PI]); // => array([1, 0, -1])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

cosh(x) → {NDArray} +

+ + + + + +
+ +

Returns the hyperbolic cosine of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { cosh } from 'vectorious/core/cosh';
+
+cosh([0, 1, 2]); // => array([1, 1.5430806875228882, 3.762195587158203])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

cross(x, y) → {NDArray} +

+ + + + + +
+ +

Computes the cross product of the x and the vector y +This operation can only calculated for vectors with three components. +Otherwise it throws an exception.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { cross } from 'vectorious/core/cross';
+
+cross([1, 2, 3], [4, 5, 6]); // => array([-3, 6, -3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

det(x) → {Number} +

+ + + + + +
+ +

Gets the determinant of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { det } from 'vectorious/core/det';
+
+det([[0, 1], [2, 3]]); // => -2
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

diagonal(x) → {NDArray} +

+ + + + + +
+ +

Gets the diagonal of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { diagonal } from 'vectorious/core/diagonal';
+
+diagonal([[1, 2], [3, 4]]); // => array([1, 4])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

dot(x, y) → {Number} +

+ + + + + +
+ +

Performs dot multiplication with x and y. +Accelerated with BLAS ?dot.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { dot } from 'vectorious/core/dot';
+
+dot([1, 2, 3], [4, 5, 6]); // => 32
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

eig(x) → {Array.<NDArray>} +

+ + + + + +
+ +

Gets eigenvalues and eigenvectors of x using the Jacobi method. +Accelerated with LAPACK ?geev.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Array.<NDArray> + + +
  • + +
+ + + + +

Example

+ +
import { eig } from 'vectorious/core/eig';
+
+eig([[1, 0, 0], [0, 2, 0], [0, 0, 3]]); // => [array([1, 2, 3]), array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])]
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

equals(x, y, tolerance) → {Boolean} +

+ + + + + +
+ +

Checks if x and y are equal.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + tolerance + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Boolean + + +
  • + +
+ + + + +

Example

+ +
import { equals } from 'vectorious/core/equals';
+
+equals([1, 2, 3], [1, 2, 3]); // => true
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

equidimensional(x, y) +

+ + + + + +
+ +

Asserts if x and y have the same shape

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + +

Deprecated

+ +
  • Yes
+ + + + + + + + + + + + + + + + +
+ + + + + + +

Example

+ +
import { equidimensional } from 'vectorious/core/equidimensional';
+
+equidimensional([1, 2, 3], [1, 2]); // Error: shapes 3 and 2 do not match
+ + + + + + + + + + + + +

Throws

+ + + +
+
+
+

shapes x and y do not match

+
+
+
+
+
+
+ Type +
+
+ + + + + Error + + + +
+
+
+
+
+ + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

equilateral(x, y) +

+ + + + + +
+ +

Asserts if x and y have the same length

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + +

Deprecated

+ +
  • Yes
+ + + + + + + + + + + + + + + + +
+ + + + + + +

Example

+ +
import { equilateral } from 'vectorious/core/equilateral';
+
+equilateral([1, 2, 3], [1, 2]); // Error: lengths 3 and 2 do not match
+ + + + + + + + + + + + +

Throws

+ + + +
+
+
+

lengths x and y do not match

+
+
+
+
+
+
+ Type +
+
+ + + + + Error + + + +
+
+
+
+
+ + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

exp(x) → {NDArray} +

+ + + + + +
+ +

Returns e^x of each element of x, where x is the argument, +and e is Euler's constant (2.718…), the base of the natural logarithm.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { exp } from 'vectorious/core/exp';
+
+exp([1, 2, 3]); // => array([2.7182817459106445, 7.389056205749512, 20.08553695678711])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

expm1(x) → {NDArray} +

+ + + + + +
+ +

Returns subtracting 1 from exp(x) of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { expm1 } from 'vectorious/core/expm1';
+
+expm1([1, 2, 3]); // => array([1.7182817459106445, 6.389056205749512, 19.08553695678711])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

eye(n) → {NDArray} +

+ + + + + +
+ +

Creates an identity matrix of size n and type type.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + n + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { eye } from 'vectorious/core/eye';
+
+eye(2); // => array([[1, 0], [0, 1]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

fill(x, value) → {NDArray} +

+ + + + + +
+ +

Fills x with a scalar value

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + value + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { fill } from 'vectorious/core/fill';
+
+fill([1, 2, 3], 0); // => array([0, 0, 0])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

floor(x) → {NDArray} +

+ + + + + +
+ +

Returns the largest integer less than or equal to a number of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { floor } from 'vectorious/core/floor';
+
+floor([1.5, 2.5, 3.5]); // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

forEach(x, f) +

+ + + + + +
+ +

Equivalent to TypedArray.prototype.forEach.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + f + + + + + + + + function + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +

Example

+ +
import { forEach } from 'vectorious/core/forEach';
+
+forEach([1, 2, 3], console.log);
+// 1 0 [ 1, 2, 3 ]
+// 2 1 [ 1, 2, 3 ]
+// 3 2 [ 1, 2, 3 ]
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

fround(x) → {NDArray} +

+ + + + + +
+ +

Returns the nearest single precision float representation of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { fround } from 'vectorious/core/fround';
+
+fround([-5.05, 5.05]); // => array([-5.050000190734863, 5.050000190734863])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

gauss(x) → {NDArray} +

+ + + + + +
+ +

Gauss-Jordan elimination (i.e. returns the reduced row echelon form) of x. +Accelerated with LAPACK ?getrf.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { gauss } from 'vectorious/core/gauss';
+
+gauss([[1, 2, 3], [4, 5, 6]]); // => array([[1, 0, -1], [-0, 1, 2]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

get(x) → {Number} +

+ + + + + +
+ +

Gets the element at i, j, ..., n from x

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + ...indices + + + + + + + + Array.<Number> + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { get } from 'vectorious/core/get';
+
+get([1, 2, 3], 2); // 3
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

inv(x) → {NDArray} +

+ + + + + +
+ +

Determines the inverse of x. +Accelerated with LAPACK ?getrf and ?getri.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { inv } from 'vectorious/core/inv';
+
+inv([[2, -1, 0], [-1, 2, -1], [0, -1, 2]]); // => array([[0.75, 0.5, 0.25], [0.5, 1, 0.5], [0.25, 0.5, 0.75]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

log(x) → {NDArray} +

+ + + + + +
+ +

Returns the natural logarithm (log_e, also ln) of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { log } from 'vectorious/core/log';
+
+log([1, 2, 3]); // => array([0, 0.6931471824645996, 1.0986123085021973])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

log1p(x) → {NDArray} +

+ + + + + +
+ +

Returns the natural logarithm (log_e, also ln) of 1 + x for each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { log1p } from 'vectorious/core/log1p';
+
+log1p([1, 2, 3]); // => array([0.6931471824645996, 1.0986123085021973, 1.3862943649291992])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

log2(x) → {NDArray} +

+ + + + + +
+ +

Returns the base 2 logarithm of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { log2 } from 'vectorious/core/log2';
+
+log2([1, 2, 4]); // => array([0, 1, 2])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

log10(x) → {NDArray} +

+ + + + + +
+ +

Returns the base 10 logarithm of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { log10 } from 'vectorious/core/log10';
+
+log10([10, 100, 1000]); // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

lu(x) → {Array.<NDArray, Int32Array>} +

+ + + + + +
+ +

Performs full LU decomposition on x. +Accelerated with LAPACK ?getrf.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Array.<NDArray, Int32Array> + + +
  • + +
+ + + + +

Example

+ +
import { lu } from 'vectorious/core/lu';
+
+lu([[1, 3, 5], [2, 4, 7], [1, 1, 0]]); // => [array([[1, 0, 0], [0.5, 1, 0], [0.5, -1, 1]]), array([[2, 4, 7], [0, 1, 1.5], [0, 0, -2]]), Int32Array([2, 2, 3])]
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

lu_factor(x) → {Array.<(NDArray|Int32Array)>} +

+ + + + + +
+ +

Performs LU factorization on x. +Accelerated with LAPACK ?getrf.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Array.<(NDArray|Int32Array)> + + +
  • + +
+ + + + +

Example

+ +
import { lu_factor } from 'vectorious/core/lu_factor';
+
+lu_factor([[1, 3, 5], [2, 4, 7], [1, 1, 0]]); // => [array([[2, 4, 7], [0.5, 1, 1.5], [0.5, -1, -2]]), Int32Array([2, 2, 3])]
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

magic(n) → {NDArray} +

+ + + + + +
+ +

Creates a magic square matrix of size n

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + n + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { magic } from 'vectorious/core/magic';
+
+magic(3); // => array([[8, 1, 6], [3, 5, 7], [4, 9, 2]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

map(x) → {NDArray} +

+ + + + + +
+ +

Equivalent to TypedArray.prototype.map.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { map } from 'vectorious/core/map';
+
+map([1, 2, 3], value => -value); // => array([-1, -2, -3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

matrix(r, c) → {NDArray} +

+ + + + + +
+ +

Creates a matrix of r rows and c columns.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + r + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + c + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { matrix } from 'vectorious/core/matrix';
+
+matrix(2, 2); // => array([[0, 0], [0, 0]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

max(x) → {Number} +

+ + + + + +
+ +

Gets the maximum value (largest) element of x. +Accelerated with BLAS i?amax.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { max } from 'vectorious/core/max';
+
+max([1, 2, 3]); // => 3
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

mean(x) → {Number} +

+ + + + + +
+ +

Gets the arithmetic mean of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { mean } from 'vectorious/core/mean';
+
+mean([1, 2, 3]); // => 2
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

min(x) → {Number} +

+ + + + + +
+ +

Gets the minimum value (smallest) element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { min } from 'vectorious/core/min';
+
+min([1, 2, 3]); // => 1
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

multiply(x, y) → {NDArray} +

+ + + + + +
+ +

Multiplies two matrices x and y of matching dimensions. +Accelerated with BLAS ?gemm.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { multiply } from 'vectorious/core/multiply';
+
+multiply([[1, 2]], [[1], [2]]); // => array([[5]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

norm(x) → {Number} +

+ + + + + +
+ +

Calculates the norm of current array (also called L2 norm or Euclidean length). +Accelerated with BLAS ?nrm2.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { norm } from 'vectorious/core/norm';
+
+norm([1, 2, 3]); // => 3.7416574954986572
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

normalize(x) → {NDArray} +

+ + + + + +
+ +

Normalizes x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { normalize } from 'vectorious/core/normalize';
+
+normalize([1, 2, 3]); // => array([0.26726123690605164, 0.5345224738121033, 0.8017836809158325])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

ones() → {NDArray} +

+ + + + + +
+ +

Creates an array containing ones (1) of shape shape

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + ...shape + + + + + + + + Array.<Number> + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { ones } from 'vectorious/core/ones';
+
+ones(3); // => array([1, 1, 1])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

pow(x, exponent) → {NDArray} +

+ + + + + +
+ +

Returns each element of x to the exponent power, that is, element^exponent.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + exponent + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { pow } from 'vectorious/core/pow';
+
+pow([1, 2, 3], 2); // => array([1, 4, 9])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

prod(x) → {Number} +

+ + + + + +
+ +

Product of all elements of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { prod } from 'vectorious/core/prod';
+
+prod([1, 2, 3]); // => 6
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

product(x, y) → {NDArray} +

+ + + + + +
+ +

Hadamard product of x and y

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { product } from 'vectorious/core/product';
+
+product([1, 2, 3], [4, 5, 6]); // => array([4, 10, 18])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

project(x, y) → {NDArray} +

+ + + + + +
+ +

Projects the y onto x using the projection formula (y * (x * y / y * y)).

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { project } from 'vectorious/core/project';
+
+project([1, 2, 3], [4, 5, 6]); // => array([1.6623376607894897, 2.0779221057891846, 2.49350643157959])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

push(x, value) → {NDArray} +

+ + + + + +
+ +

Pushes a new value into x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + value + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { push } from 'vectorious/core/push';
+
+push([1, 2, 3], 4); // => array([1, 2, 3, 4])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

random() → {NDArray} +

+ + + + + +
+ +

Creates a vector containing random samples from a uniform distribution over [0, 1) of shape shape

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + ...shape + + + + + + + + Array.<Number> + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { random } from 'vectorious/core/random';
+
+random(3); // => array([0.27496153116226196, 0.7581521272659302, 0.3682245910167694])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

range(start, step, stop) → {NDArray} +

+ + + + + +
+ +

Creates an array containing a range (can be either ascending or descending) +of numbers specified by the arguments provided (e.g. NDArray.range(0, .5, 2) +gives an array containing all numbers in the interval [0, 2) separated by +steps of 0.5)

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + start + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + step + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + stop + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { range } from 'vectorious/core/range';
+
+range(1, 2, 9); // => array([1, 3, 5, 7])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

rank(x, tolerance) → {Number} +

+ + + + + +
+ +

Finds the rank of x using gaussian elimination.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + tolerance + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { rank } from 'vectorious/core/rank';
+
+rank([[1, 1, 1], [2, 2, 2], [3, 3, 3]]); // => 1
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

reciprocal(x) → {NDArray} +

+ + + + + +
+ +

Gets the element-wise reciprocal of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { reciprocal } from 'vectorious/core/reciprocal';
+
+reciprocal([1, 2, 3]); // => array([1, 0.5, 0.3333333432674408])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

reduce(x, f, initialValue) → {Number} +

+ + + + + +
+ +

Equivalent to TypedArray.prototype.reduce.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + f + + + + + + + + function + + + + + + + + + +
    + +
  • + + + +
  • + + initialValue + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { reduce } from 'vectorious/core/reduce';
+
+reduce([1, 2, 3], (a, b) => a + b, 0); // => 6
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

reshape(x) → {NDArray} +

+ + + + + +
+ +

Reshapes x

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + ...shape + + + + + + + + Array.<Number> + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { reshape } from 'vectorious/core/reshape';
+
+reshape([1, 2, 3, 4], 2, 2); // => array([[1, 2], [3, 4]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

round(x) → {NDArray} +

+ + + + + +
+ +

Returns the value of each element of x rounded to the nearest integer.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { round } from 'vectorious/core/round';
+
+round([1.2, 2.8, 3.5]); // => array([1, 3, 4])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

row_add(x, dest, source, scalar) → {NDArray} +

+ + + + + +
+ +

Adds a multiple of one row multiplied by scalar to another inside x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + dest + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + source + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + scalar + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { row_add } from 'vectorious/core/row_add';
+
+row_add([[1, 2], [3, 4]], 1, 0, 2); // => array([[1, 2], [5, 8]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

scale(x, scalar) → {NDArray} +

+ + + + + +
+ +

Multiplies all elements of x with a specified scalar. +Accelerated with BLAS ?scal.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + scalar + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { scale } from 'vectorious/core/scale';
+
+scale([1, 2, 3], 2); // => array([2, 4, 6])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

set(x, value) → {NDArray} +

+ + + + + +
+ +

Sets the element at i, j, ..., n to value.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + ...indices + + + + + + + + Array.<Number> + + + + + + + + + +
    + +
  • + + + +
  • + + value + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { set } from 'vectorious/core/set';
+
+set([1, 2, 3], 1, 0); // => array([1, 0, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

sign(x) → {NDArray} +

+ + + + + +
+ +

Returns the sign of each element of x, indicating +whether it is positive, negative or zero.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { sign } from 'vectorious/core/sign';
+
+sign([1, 2, 3]); // => array([1, 1, 1])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

sin(x) → {NDArray} +

+ + + + + +
+ +

Returns the sine of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { sin } from 'vectorious/core/sin';
+
+sin([0, Math.PI / 2, Math.PI]); // => array([0, 1, 0])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

sinh(x) → {NDArray} +

+ + + + + +
+ +

Returns the hyperbolic sine of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { sinh } from 'vectorious/core/sinh';
+
+sinh([1, 2, 3]); // => array([1.175201177597046, 3.6268603801727295, 10.017874717712402])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

slice(x, begin, end, step) → {NDArray} +

+ + + + + +
+ +

Slices x in the corresponding dimension

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + begin + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + end + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + step + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { slice } from 'vectorious/core/slice';
+
+slice([1, 2, 3, 4], 0, 4, 2); // => array([1, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

solve(x, y) → {NDArray} +

+ + + + + +
+ +

Solves the equation AX = B (where A is x and B is y). +Accelerated with LAPACK ?gesv.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + y + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { solve } from 'vectorious/core/solve';
+
+solve([[1, 3, 5], [2, 4, 7], [1, 1, 0]], [[1], [3], [5]]); // => array([[3.25], [1.75], [-1.5]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

sqrt(x) → {NDArray} +

+ + + + + +
+ +

Returns the positive square root of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { sqrt } from 'vectorious/core/sqrt';
+
+sqrt([1, 4, 9]); // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

square(x) +

+ + + + + +
+ +

Asserts if x is square.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +

Example

+ +
import { square } from 'vectorious/core/square';
+
+square([1, 2, 3]); // Error: matrix is not square
+ + + + + + + + + + + + +

Throws

+ + + +
+
+
+

matrix is not square

+
+
+
+
+
+
+ Type +
+
+ + + + + Error + + + +
+
+
+
+
+ + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

subtract(x) → {NDArray} +

+ + + + + +
+ +

Subtracts y from x. +Accelerated with BLAS ?axpy.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { subtract } from 'vectorious/core/subtract';
+
+subtract([1, 2, 3], [1, 1, 1]); // => array([0, 1, 2])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

sum(x) → {Number} +

+ + + + + +
+ +

Sum of x

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { sum } from 'vectorious/core/sum';
+
+sum([1, 2, 3]); // => 6
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

swap(x, i, j) → {NDArray} +

+ + + + + +
+ +

Swaps two rows i and j in x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + + +
  • + + i + + + + + + + + Number + + + + + + + + + +
    + +
  • + + + +
  • + + j + + + + + + + + Number + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { swap } from 'vectorious/core/swap';
+
+swap([[1, 2], [3, 4]], 0, 1); // => array([[3, 4], [1, 2]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

tan(x) → {NDArray} +

+ + + + + +
+ +

Returns the tangent of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { tan } from 'vectorious/core/tan';
+
+tan([1, 2, 3]); // => array([1.5574077367782593, -2.185039758682251, -0.14254654943943024])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

tanh(x) → {NDArray} +

+ + + + + +
+ +

Returns the hyperbolic tangent of each element of x.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { tanh } from 'vectorious/core/tanh';
+
+tanh([1, 2, 3]); // => array([0.7615941762924194, 0.9640275835990906, 0.9950547814369202])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

toArray(x) → {Array} +

+ + + + + +
+ +

Converts x into a JavaScript array.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Array + + +
  • + +
+ + + + +

Example

+ +
import { toArray } from 'vectorious/core/toArray';
+
+toArray([1, 2, 3]); // => [1, 2, 3]
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

toString(x) → {String} +

+ + + + + +
+ +

Converts x into a readable formatted string.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + String + + +
  • + +
+ + + + +

Example

+ +
import { toString } from 'vectorious/core/toString';
+
+toString([1, 2, 3]); // => '1,2,3'
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

trace(x) → {Number} +

+ + + + + +
+ +

Gets the trace of x (the sum of all diagonal elements).

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + Number + + +
  • + +
+ + + + +

Example

+ +
import { trace } from 'vectorious/core/trace';
+
+trace([[1, 2], [3, 4]]); // => 5
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

transpose(x) → {NDArray} +

+ + + + + +
+ +

Transposes x (mirror across the diagonal).

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { transpose } from 'vectorious/core/transpose';
+
+transpose([[1, 2, 3], [4, 5, 6], [7, 8, 9]]); // => array([[1, 4, 7], [2, 5, 8], [3, 6, 9]])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

trunc(x) → {NDArray} +

+ + + + + +
+ +

Returns the integer part of each element of x, +removing any fractional digits.

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + x + + + + + + + + NDArray + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { trunc } from 'vectorious/core/trunc';
+
+trunc([1.2, 2.8, 3.5]); // => array([1, 2, 3])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + +
+ + + + + + + + + +
+ static +
+ +

zeros() → {NDArray} +

+ + + + + +
+ +

Creates an array containing zeros (0) of shape shape

+
+ + + + + + + + + +

Parameters

+ + +
    + + +
  • + + ...shape + + + + + + + + Array.<Number> + + + + + + + + + +
    + +
  • + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

Returns

+
    + +
  • + + NDArray + + +
  • + +
+ + + + +

Example

+ +
import { zeros } from 'vectorious/core/zeros';
+
+zeros(3); // => array([0, 0, 0])
+ + + + + + + + + + + + + + +

Source

+ + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + + + \ No newline at end of file diff --git a/docs/vectorious/6.0.3/scripts/prism-linenumbers.js b/docs/vectorious/6.0.3/scripts/prism-linenumbers.js new file mode 100644 index 00000000..67ede74a --- /dev/null +++ b/docs/vectorious/6.0.3/scripts/prism-linenumbers.js @@ -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 wrapped inside
 (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 
 nor the  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 
+    env.element.className = env.element.className.replace(clsReg, '');
+  }
+  if (!clsReg.test(pre.className)) {
+    // Add the class "line-numbers" to the 
+    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('');
+
+  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);
+
+});
+
+}());
\ No newline at end of file
diff --git a/docs/vectorious/6.0.3/scripts/prism.dev.js b/docs/vectorious/6.0.3/scripts/prism.dev.js
new file mode 100644
index 00000000..beb5e582
--- /dev/null
+++ b/docs/vectorious/6.0.3/scripts/prism.dev.js
@@ -0,0 +1,1115 @@
+/* PrismJS 1.13.0
+http://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+json&plugins=line-highlight+line-numbers */
+var _self = (typeof window !== 'undefined')
+	? window   // if in browser
+	: (
+		(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
+		? self // if in worker
+		: {}   // if in node js
+	);
+
+/**
+ * Prism: Lightweight, robust, elegant syntax highlighting
+ * MIT license http://www.opensource.org/licenses/mit-license.php/
+ * @author Lea Verou http://lea.verou.me
+ */
+
+var Prism = (function(){
+
+// Private helper vars
+var lang = /\blang(?:uage)?-(\w+)\b/i;
+var uniqueId = 0;
+
+var _ = _self.Prism = {
+	manual: _self.Prism && _self.Prism.manual,
+	disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
+	util: {
+		encode: function (tokens) {
+			if (tokens instanceof Token) {
+				return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias);
+			} else if (_.util.type(tokens) === 'Array') {
+				return tokens.map(_.util.encode);
+			} else {
+				return tokens.replace(/&/g, '&').replace(/ text.length) {
+						// Something went terribly wrong, ABORT, ABORT!
+						return;
+					}
+
+					if (str instanceof Token) {
+						continue;
+					}
+
+					if (greedy && i != strarr.length - 1) {
+						pattern.lastIndex = pos;
+						var match = pattern.exec(text);
+						if (!match) {
+							break;
+						}
+
+						var from = match.index + (lookbehind ? match[1].length : 0),
+						    to = match.index + match[0].length,
+						    k = i,
+						    p = pos;
+
+						for (var len = strarr.length; k < len && (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); ++k) {
+							p += strarr[k].length;
+							// Move the index i to the element in strarr that is closest to from
+							if (from >= p) {
+								++i;
+								pos = p;
+							}
+						}
+
+						// If strarr[i] is a Token, then the match starts inside another Token, which is invalid
+						if (strarr[i] instanceof Token) {
+							continue;
+						}
+
+						// Number of tokens to delete and replace with the new match
+						delNum = k - i;
+						str = text.slice(pos, p);
+						match.index -= pos;
+					} else {
+						pattern.lastIndex = 0;
+
+						var match = pattern.exec(str),
+							delNum = 1;
+					}
+
+					if (!match) {
+						if (oneshot) {
+							break;
+						}
+
+						continue;
+					}
+
+					if(lookbehind) {
+						lookbehindLength = match[1] ? match[1].length : 0;
+					}
+
+					var from = match.index + lookbehindLength,
+					    match = match[0].slice(lookbehindLength),
+					    to = from + match.length,
+					    before = str.slice(0, from),
+					    after = str.slice(to);
+
+					var args = [i, delNum];
+
+					if (before) {
+						++i;
+						pos += before.length;
+						args.push(before);
+					}
+
+					var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy);
+
+					args.push(wrapped);
+
+					if (after) {
+						args.push(after);
+					}
+
+					Array.prototype.splice.apply(strarr, args);
+
+					if (delNum != 1)
+						_.matchGrammar(text, strarr, grammar, i, pos, true, token);
+
+					if (oneshot)
+						break;
+				}
+			}
+		}
+	},
+
+	tokenize: function(text, grammar, language) {
+		var strarr = [text];
+
+		var rest = grammar.rest;
+
+		if (rest) {
+			for (var token in rest) {
+				grammar[token] = rest[token];
+			}
+
+			delete grammar.rest;
+		}
+
+		_.matchGrammar(text, strarr, grammar, 0, 0, false);
+
+		return strarr;
+	},
+
+	hooks: {
+		all: {},
+
+		add: function (name, callback) {
+			var hooks = _.hooks.all;
+
+			hooks[name] = hooks[name] || [];
+
+			hooks[name].push(callback);
+		},
+
+		run: function (name, env) {
+			var callbacks = _.hooks.all[name];
+
+			if (!callbacks || !callbacks.length) {
+				return;
+			}
+
+			for (var i=0, callback; callback = callbacks[i++];) {
+				callback(env);
+			}
+		}
+	}
+};
+
+var Token = _.Token = function(type, content, alias, matchedStr, greedy) {
+	this.type = type;
+	this.content = content;
+	this.alias = alias;
+	// Copy of the full string this token was created from
+	this.length = (matchedStr || "").length|0;
+	this.greedy = !!greedy;
+};
+
+Token.stringify = function(o, language, parent) {
+	if (typeof o == 'string') {
+		return o;
+	}
+
+	if (_.util.type(o) === 'Array') {
+		return o.map(function(element) {
+			return Token.stringify(element, language, o);
+		}).join('');
+	}
+
+	var env = {
+		type: o.type,
+		content: Token.stringify(o.content, language, parent),
+		tag: 'span',
+		classes: ['token', o.type],
+		attributes: {},
+		language: language,
+		parent: parent
+	};
+
+	if (o.alias) {
+		var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias];
+		Array.prototype.push.apply(env.classes, aliases);
+	}
+
+	_.hooks.run('wrap', env);
+
+	var attributes = Object.keys(env.attributes).map(function(name) {
+		return name + '="' + (env.attributes[name] || '').replace(/"/g, '"') + '"';
+	}).join(' ');
+
+	return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + '';
+
+};
+
+if (!_self.document) {
+	if (!_self.addEventListener) {
+		// in Node.js
+		return _self.Prism;
+	}
+
+	if (!_.disableWorkerMessageHandler) {
+		// In worker
+		_self.addEventListener('message', function (evt) {
+			var message = JSON.parse(evt.data),
+				lang = message.language,
+				code = message.code,
+				immediateClose = message.immediateClose;
+
+			_self.postMessage(_.highlight(code, _.languages[lang], lang));
+			if (immediateClose) {
+				_self.close();
+			}
+		}, false);
+	}
+
+	return _self.Prism;
+}
+
+//Get current script and highlight
+var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop();
+
+if (script) {
+	_.filename = script.src;
+
+	if (!_.manual && !script.hasAttribute('data-manual')) {
+		if(document.readyState !== "loading") {
+			if (window.requestAnimationFrame) {
+				window.requestAnimationFrame(_.highlightAll);
+			} else {
+				window.setTimeout(_.highlightAll, 16);
+			}
+		}
+		else {
+			document.addEventListener('DOMContentLoaded', _.highlightAll);
+		}
+	}
+}
+
+return _self.Prism;
+
+})();
+
+if (typeof module !== 'undefined' && module.exports) {
+	module.exports = Prism;
+}
+
+// hack for components to work correctly in node.js
+if (typeof global !== 'undefined') {
+	global.Prism = Prism;
+}
+;
+Prism.languages.markup = {
+	'comment': //,
+	'prolog': /<\?[\s\S]+?\?>/,
+	'doctype': //i,
+	'cdata': //i,
+	'tag': {
+		pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,
+		greedy: true,
+		inside: {
+			'tag': {
+				pattern: /^<\/?[^\s>\/]+/i,
+				inside: {
+					'punctuation': /^<\/?/,
+					'namespace': /^[^\s>\/:]+:/
+				}
+			},
+			'attr-value': {
+				pattern: /=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,
+				inside: {
+					'punctuation': [
+						/^=/,
+						{
+							pattern: /(^|[^\\])["']/,
+							lookbehind: true
+						}
+					]
+				}
+			},
+			'punctuation': /\/?>/,
+			'attr-name': {
+				pattern: /[^\s>\/]+/,
+				inside: {
+					'namespace': /^[^\s>\/:]+:/
+				}
+			}
+
+		}
+	},
+	'entity': /&#?[\da-z]{1,8};/i
+};
+
+Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
+	Prism.languages.markup['entity'];
+
+// Plugin to make entity title show the real entity, idea by Roman Komarov
+Prism.hooks.add('wrap', function(env) {
+
+	if (env.type === 'entity') {
+		env.attributes['title'] = env.content.replace(/&/, '&');
+	}
+});
+
+Prism.languages.xml = Prism.languages.markup;
+Prism.languages.html = Prism.languages.markup;
+Prism.languages.mathml = Prism.languages.markup;
+Prism.languages.svg = Prism.languages.markup;
+
+Prism.languages.css = {
+	'comment': /\/\*[\s\S]*?\*\//,
+	'atrule': {
+		pattern: /@[\w-]+?.*?(?:;|(?=\s*\{))/i,
+		inside: {
+			'rule': /@[\w-]+/
+			// See rest below
+		}
+	},
+	'url': /url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
+	'selector': /[^{}\s][^{};]*?(?=\s*\{)/,
+	'string': {
+		pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
+		greedy: true
+	},
+	'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,
+	'important': /\B!important\b/i,
+	'function': /[-a-z0-9]+(?=\()/i,
+	'punctuation': /[(){};:]/
+};
+
+Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
+
+if (Prism.languages.markup) {
+	Prism.languages.insertBefore('markup', 'tag', {
+		'style': {
+			pattern: /()[\s\S]*?(?=<\/style>)/i,
+			lookbehind: true,
+			inside: Prism.languages.css,
+			alias: 'language-css',
+			greedy: true
+		}
+	});
+
+	Prism.languages.insertBefore('inside', 'attr-value', {
+		'style-attr': {
+			pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,
+			inside: {
+				'attr-name': {
+					pattern: /^\s*style/i,
+					inside: Prism.languages.markup.tag.inside
+				},
+				'punctuation': /^\s*=\s*['"]|['"]\s*$/,
+				'attr-value': {
+					pattern: /.+/i,
+					inside: Prism.languages.css
+				}
+			},
+			alias: 'language-css'
+		}
+	}, Prism.languages.markup.tag);
+};
+Prism.languages.clike = {
+	'comment': [
+		{
+			pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
+			lookbehind: true
+		},
+		{
+			pattern: /(^|[^\\:])\/\/.*/,
+			lookbehind: true,
+			greedy: true
+		}
+	],
+	'string': {
+		pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
+		greedy: true
+	},
+	'class-name': {
+		pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,
+		lookbehind: true,
+		inside: {
+			punctuation: /[.\\]/
+		}
+	},
+	'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
+	'boolean': /\b(?:true|false)\b/,
+	'function': /[a-z0-9_]+(?=\()/i,
+	'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,
+	'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
+	'punctuation': /[{}[\];(),.:]/
+};
+
+Prism.languages.javascript = Prism.languages.extend('clike', {
+	'keyword': /\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,
+	'number': /\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,
+	// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
+	'function': /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,
+	'operator': /-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/
+});
+
+Prism.languages.insertBefore('javascript', 'keyword', {
+	'regex': {
+		pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,
+		lookbehind: true,
+		greedy: true
+	},
+	// This must be declared before keyword because we use "function" inside the look-forward
+	'function-variable': {
+		pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,
+		alias: 'function'
+	},
+	'constant': /\b[A-Z][A-Z\d_]*\b/
+});
+
+Prism.languages.insertBefore('javascript', 'string', {
+	'template-string': {
+		pattern: /`(?:\\[\s\S]|[^\\`])*`/,
+		greedy: true,
+		inside: {
+			'interpolation': {
+				pattern: /\$\{[^}]+\}/,
+				inside: {
+					'interpolation-punctuation': {
+						pattern: /^\$\{|\}$/,
+						alias: 'punctuation'
+					},
+					rest: Prism.languages.javascript
+				}
+			},
+			'string': /[\s\S]+/
+		}
+	}
+});
+
+if (Prism.languages.markup) {
+	Prism.languages.insertBefore('markup', 'tag', {
+		'script': {
+			pattern: /()[\s\S]*?(?=<\/script>)/i,
+			lookbehind: true,
+			inside: Prism.languages.javascript,
+			alias: 'language-javascript',
+			greedy: true
+		}
+	});
+}
+
+Prism.languages.js = Prism.languages.javascript;
+
+Prism.languages.json = {
+	'property': /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/i,
+	'string': {
+		pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
+		greedy: true
+	},
+	'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,
+	'punctuation': /[{}[\]);,]/,
+	'operator': /:/g,
+	'boolean': /\b(?:true|false)\b/i,
+	'null': /\bnull\b/i
+};
+
+Prism.languages.jsonp = Prism.languages.json;
+
+(function(){
+
+if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) {
+	return;
+}
+
+function $$(expr, con) {
+	return Array.prototype.slice.call((con || document).querySelectorAll(expr));
+}
+
+function hasClass(element, className) {
+  className = " " + className + " ";
+  return (" " + element.className + " ").replace(/[\n\t]/g, " ").indexOf(className) > -1
+}
+
+// Some browsers round the line-height, others don't.
+// We need to test for it to position the elements properly.
+var isLineHeightRounded = (function() {
+	var res;
+	return function() {
+		if(typeof res === 'undefined') {
+			var d = document.createElement('div');
+			d.style.fontSize = '13px';
+			d.style.lineHeight = '1.5';
+			d.style.padding = 0;
+			d.style.border = 0;
+			d.innerHTML = ' 
 '; + document.body.appendChild(d); + // Browsers that round the line-height should have offsetHeight === 38 + // The others should have 39. + res = d.offsetHeight === 38; + document.body.removeChild(d); + } + return res; + } +}()); + +function highlightLines(pre, lines, classes) { + lines = typeof lines === 'string' ? lines : pre.getAttribute('data-line'); + + var ranges = lines.replace(/\s+/g, '').split(','), + offset = +pre.getAttribute('data-line-offset') || 0; + + var parseMethod = isLineHeightRounded() ? parseInt : parseFloat; + var lineHeight = parseMethod(getComputedStyle(pre).lineHeight); + var hasLineNumbers = hasClass(pre, 'line-numbers'); + + for (var i=0, currentRange; currentRange = ranges[i++];) { + var range = currentRange.split('-'); + + var start = +range[0], + end = +range[1] || start; + + var line = pre.querySelector('.line-highlight[data-range="' + currentRange + '"]') || document.createElement('div'); + + line.setAttribute('aria-hidden', 'true'); + line.setAttribute('data-range', currentRange); + line.className = (classes || '') + ' line-highlight'; + + //if the line-numbers plugin is enabled, then there is no reason for this plugin to display the line numbers + if(hasLineNumbers && Prism.plugins.lineNumbers) { + var startNode = Prism.plugins.lineNumbers.getLine(pre, start); + var endNode = Prism.plugins.lineNumbers.getLine(pre, end); + + if (startNode) { + line.style.top = startNode.offsetTop + 'px'; + } + + if (endNode) { + line.style.height = (endNode.offsetTop - startNode.offsetTop) + endNode.offsetHeight + 'px'; + } + } else { + line.setAttribute('data-start', start); + + if(end > start) { + line.setAttribute('data-end', end); + } + + line.style.top = (start - offset - 1) * lineHeight + 'px'; + + line.textContent = new Array(end - start + 2).join(' \n'); + } + + //allow this to play nicely with the line-numbers plugin + if(hasLineNumbers) { + //need to attack to pre as when line-numbers is enabled, the code tag is relatively which screws up the positioning + pre.appendChild(line); + } else { + (pre.querySelector('code') || pre).appendChild(line); + } + } +} + +function applyHash() { + var hash = location.hash.slice(1); + + // Remove pre-existing temporary lines + $$('.temporary.line-highlight').forEach(function (line) { + line.parentNode.removeChild(line); + }); + + var range = (hash.match(/\.([\d,-]+)$/) || [,''])[1]; + + if (!range || document.getElementById(hash)) { + return; + } + + var id = hash.slice(0, hash.lastIndexOf('.')), + pre = document.getElementById(id); + + if (!pre) { + return; + } + + if (!pre.hasAttribute('data-line')) { + pre.setAttribute('data-line', ''); + } + + highlightLines(pre, range, 'temporary '); + + document.querySelector('.temporary.line-highlight').scrollIntoView(); + + // offset fixed header with buffer + window.scrollBy(0, -100); +} + +var fakeTimer = 0; // Hack to limit the number of times applyHash() runs + +Prism.hooks.add('before-sanity-check', function(env) { + var pre = env.element.parentNode; + var lines = pre && pre.getAttribute('data-line'); + + if (!pre || !lines || !/pre/i.test(pre.nodeName)) { + return; + } + + /* + * Cleanup for other plugins (e.g. autoloader). + * + * Sometimes blocks are highlighted multiple times. It is necessary + * to cleanup any left-over tags, because the whitespace inside of the
+ * tags change the content of the tag. + */ + var num = 0; + $$('.line-highlight', pre).forEach(function (line) { + num += line.textContent.length; + line.parentNode.removeChild(line); + }); + // Remove extra whitespace + if (num && /^( \n)+$/.test(env.code.slice(-num))) { + env.code = env.code.slice(0, -num); + } +}); + +Prism.hooks.add('complete', function completeHook(env) { + var pre = env.element.parentNode; + var lines = pre && pre.getAttribute('data-line'); + + if (!pre || !lines || !/pre/i.test(pre.nodeName)) { + return; + } + + clearTimeout(fakeTimer); + + var hasLineNumbers = Prism.plugins.lineNumbers; + var isLineNumbersLoaded = env.plugins && env.plugins.lineNumbers; + + if (hasClass(pre, 'line-numbers') && hasLineNumbers && !isLineNumbersLoaded) { + Prism.hooks.add('line-numbers', completeHook); + } else { + highlightLines(pre, lines); + fakeTimer = setTimeout(applyHash, 1); + } +}); + + window.addEventListener('load', applyHash); + window.addEventListener('hashchange', applyHash); + window.addEventListener('resize', function () { + var preElements = document.querySelectorAll('pre[data-line]'); + Array.prototype.forEach.call(preElements, function (pre) { + highlightLines(pre); + }); + }); + +})(); +(function () { + + if (typeof self === 'undefined' || !self.Prism || !self.document) { + return; + } + + /** + * Plugin name which is used as a class name for
 which is activating the plugin
+	 * @type {String}
+	 */
+	var PLUGIN_NAME = 'line-numbers';
+
+	/**
+	 * Regular expression used for determining line breaks
+	 * @type {RegExp}
+	 */
+	var NEW_LINE_EXP = /\n(?!$)/g;
+
+	/**
+	 * Resizes line numbers spans according to height of line of code
+	 * @param {Element} element 
 element
+	 */
+	var _resizeElement = function (element) {
+		var codeStyles = getStyles(element);
+		var whiteSpace = codeStyles['white-space'];
+
+		if (whiteSpace === 'pre-wrap' || whiteSpace === 'pre-line') {
+			var codeElement = element.querySelector('code');
+			var lineNumbersWrapper = element.querySelector('.line-numbers-rows');
+			var lineNumberSizer = element.querySelector('.line-numbers-sizer');
+			var codeLines = codeElement.textContent.split(NEW_LINE_EXP);
+
+			if (!lineNumberSizer) {
+				lineNumberSizer = document.createElement('span');
+				lineNumberSizer.className = 'line-numbers-sizer';
+
+				codeElement.appendChild(lineNumberSizer);
+			}
+
+			lineNumberSizer.style.display = 'block';
+
+			codeLines.forEach(function (line, lineNumber) {
+				lineNumberSizer.textContent = line || '\n';
+				var lineSize = lineNumberSizer.getBoundingClientRect().height;
+				lineNumbersWrapper.children[lineNumber].style.height = lineSize + 'px';
+			});
+
+			lineNumberSizer.textContent = '';
+			lineNumberSizer.style.display = 'none';
+		}
+	};
+
+	/**
+	 * Returns style declarations for the element
+	 * @param {Element} element
+	 */
+	var getStyles = function (element) {
+		if (!element) {
+			return null;
+		}
+
+		return window.getComputedStyle ? getComputedStyle(element) : (element.currentStyle || null);
+	};
+
+	window.addEventListener('resize', function () {
+		Array.prototype.forEach.call(document.querySelectorAll('pre.' + PLUGIN_NAME), _resizeElement);
+	});
+
+	Prism.hooks.add('complete', function (env) {
+		if (!env.code) {
+			return;
+		}
+
+		// works only for  wrapped inside 
 (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 
 nor the  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 
+			env.element.className = env.element.className.replace(clsReg, ' ');
+		}
+		if (!clsReg.test(pre.className)) {
+			// Add the class 'line-numbers' to the 
+			pre.className += ' line-numbers';
+		}
+
+		var match = env.code.match(NEW_LINE_EXP);
+		var linesNum = match ? match.length + 1 : 1;
+		var lineNumbersWrapper;
+
+		var lines = new Array(linesNum + 1);
+		lines = lines.join('');
+
+		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);
+
+		_resizeElement(pre);
+
+		Prism.hooks.run('line-numbers', env);
+	});
+
+	Prism.hooks.add('line-numbers', function (env) {
+		env.plugins = env.plugins || {};
+		env.plugins.lineNumbers = true;
+	});
+
+	/**
+	 * Global exports
+	 */
+	Prism.plugins.lineNumbers = {
+		/**
+		 * Get node for provided line number
+		 * @param {Element} element pre element
+		 * @param {Number} number line number
+		 * @return {Element|undefined}
+		 */
+		getLine: function (element, number) {
+			if (element.tagName !== 'PRE' || !element.classList.contains(PLUGIN_NAME)) {
+				return;
+			}
+
+			var lineNumberRows = element.querySelector('.line-numbers-rows');
+			var lineNumberStart = parseInt(element.getAttribute('data-start'), 10) || 1;
+			var lineNumberEnd = lineNumberStart + (lineNumberRows.children.length - 1);
+
+			if (number < lineNumberStart) {
+				number = lineNumberStart;
+			}
+			if (number > lineNumberEnd) {
+				number = lineNumberEnd;
+			}
+
+			var lineIndex = number - lineNumberStart;
+
+			return lineNumberRows.children[lineIndex];
+		}
+	};
+
+}());
diff --git a/docs/vectorious/6.0.3/scripts/prism.js b/docs/vectorious/6.0.3/scripts/prism.js
new file mode 100644
index 00000000..fb7b2a9a
--- /dev/null
+++ b/docs/vectorious/6.0.3/scripts/prism.js
@@ -0,0 +1,9 @@
+/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+json+yaml&plugins=line-numbers */
+var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(v instanceof a)){u.lastIndex=0;var b=u.exec(v),k=1;if(!b&&h&&m!=r.length-1){if(u.lastIndex=y,b=u.exec(e),!b)break;for(var w=b.index+(c?b[1].length:0),_=b.index+b[0].length,P=m,A=y,j=r.length;j>P&&_>A;++P)A+=r[P].length,w>=A&&(++m,y=A);if(r[m]instanceof a||r[P-1].greedy)continue;k=P-m,v=e.slice(y,A),b.index-=y}if(b){c&&(f=b[1].length);var w=b.index+f,b=b[0].slice(f),_=w+b.length,x=v.slice(0,w),O=v.slice(_),S=[m,k];x&&S.push(x);var N=new a(i,g?n.tokenize(b,g):b,d,b,h);S.push(N),O&&S.push(O),Array.prototype.splice.apply(r,S)}}}}}return r},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,l=0;r=a[l++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||"").length,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var l={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if("comment"==l.type&&(l.attributes.spellcheck="true"),e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+""},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,l=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),l&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,!document.addEventListener||n.manual||r.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
+Prism.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
+Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:{pattern:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/()[\w\W]*?(?=<\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag));
+Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};
+Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*\*?|\/|~|\^|%|\.{3}/}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\\\|\\?[^\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/()[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript;
+Prism.languages.json={property:/"(?:\\.|[^\\"])*"(?=\s*:)/gi,string:/"(?!:)(?:\\.|[^\\"])*"(?!:)/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?)\b/g,punctuation:/[{}[\]);,]/g,operator:/:/g,"boolean":/\b(true|false)\b/gi,"null":/\bnull\b/gi},Prism.languages.jsonp=Prism.languages.json;
+Prism.languages.yaml={scalar:{pattern:/([\-:]\s*(![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\3[^\r\n]+)*)/,lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:/(\s*(?:^|[:\-,[{\r\n?])[ \t]*(![^\s]+)?[ \t]*)[^\r\n{[\]},#\s]+?(?=\s*:\s)/,lookbehind:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(\d{4}-\d\d?-\d\d?([tT]|[ \t]+)\d\d?:\d{2}:\d{2}(\.\d*)?[ \t]*(Z|[-+]\d\d?(:\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(:\d{2}(\.\d*)?)?)(?=[ \t]*($|,|]|}))/m,lookbehind:!0,alias:"number"},"boolean":{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(true|false)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},"null":{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(null|~)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},string:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')(?=[ \t]*($|,|]|}))/m,lookbehind:!0,greedy:!0},number:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\da-f]+|0o[0-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im,lookbehind:!0},tag:/![^\s]+/,important:/[&*][\w]+/,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./};
+!function(){"undefined"!=typeof self&&self.Prism&&self.document&&Prism.hooks.add("complete",function(e){if(e.code){var t=e.element.parentNode,s=/\s*\bline-numbers\b\s*/;if(t&&/pre/i.test(t.nodeName)&&(s.test(t.className)||s.test(e.element.className))&&!e.element.querySelector(".line-numbers-rows")){s.test(e.element.className)&&(e.element.className=e.element.className.replace(s,"")),s.test(t.className)||(t.className+=" line-numbers");var n,a=e.code.match(/\n(?!$)/g),l=a?a.length+1:1,r=new Array(l+1);r=r.join(""),n=document.createElement("span"),n.setAttribute("aria-hidden","true"),n.className="line-numbers-rows",n.innerHTML=r,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(n)}}})}();
diff --git a/docs/vectorious/6.0.3/scripts/prism.min.js b/docs/vectorious/6.0.3/scripts/prism.min.js
new file mode 100644
index 00000000..4108adac
--- /dev/null
+++ b/docs/vectorious/6.0.3/scripts/prism.min.js
@@ -0,0 +1,11 @@
+/* PrismJS 1.13.0
+http://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+json&plugins=line-highlight+line-numbers+autolinker */
+var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof r?new r(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof s)){if(m&&b!=t.length-1){h.lastIndex=k;var _=h.exec(e);if(!_)break;for(var j=_.index+(d?_[1].length:0),P=_.index+_[0].length,A=b,x=k,O=t.length;O>A&&(P>x||!t[A].type&&!t[A-1].greedy);++A)x+=t[A].length,j>=x&&(++b,k=x);if(t[b]instanceof s)continue;I=A-b,w=e.slice(k,x),_.index-=k}else{h.lastIndex=0;var _=h.exec(w),I=1}if(_){d&&(p=_[1]?_[1].length:0);var j=_.index+p,_=_[0].slice(p),P=j+_.length,N=w.slice(0,j),S=w.slice(P),C=[b,I];N&&(++b,k+=N.length,C.push(N));var E=new s(u,f?n.tokenize(_,f):_,y,_,m);if(C.push(E),S&&C.push(S),Array.prototype.splice.apply(t,C),1!=I&&n.matchGrammar(e,t,r,b,k,!0,u),i)break}else if(i)break}}}}},tokenize:function(e,t){var r=[e],a=t.rest;if(a){for(var l in a)t[l]=a[l];delete t.rest}return n.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){var r=n.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){var r=n.hooks.all[e];if(r&&r.length)for(var a,l=0;a=r[l++];)a(t)}}},r=n.Token=function(e,t,n,r,a){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!a};if(r.stringify=function(e,t,a){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return r.stringify(n,t,e)}).join("");var l={type:e.type,content:r.stringify(e.content,t,a),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:a};if(e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+""},!_self.document)return _self.addEventListener?(n.disableWorkerMessageHandler||_self.addEventListener("message",function(e){var t=JSON.parse(e.data),r=t.language,a=t.code,l=t.immediateClose;_self.postMessage(n.highlight(a,n.languages[r],r)),l&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(n.filename=a.src,n.manual||a.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
+Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
+Prism.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.languages.css,Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/()[\s\S]*?(?=<\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:"language-css",greedy:!0}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag));
+Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(?:true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};
+Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,"function":/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^\/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,alias:"function"},constant:/\b[A-Z][A-Z\d_]*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/()[\s\S]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript",greedy:!0}}),Prism.languages.js=Prism.languages.javascript;
+Prism.languages.json={property:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/i,string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,punctuation:/[{}[\]);,]/,operator:/:/g,"boolean":/\b(?:true|false)\b/i,"null":/\bnull\b/i},Prism.languages.jsonp=Prism.languages.json;
+!function(){function e(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function t(e,t){return t=" "+t+" ",(" "+e.className+" ").replace(/[\n\t]/g," ").indexOf(t)>-1}function n(e,n,i){n="string"==typeof n?n:e.getAttribute("data-line");for(var o,l=n.replace(/\s+/g,"").split(","),a=+e.getAttribute("data-line-offset")||0,s=r()?parseInt:parseFloat,d=s(getComputedStyle(e).lineHeight),u=t(e,"line-numbers"),c=0;o=l[c++];){var p=o.split("-"),m=+p[0],f=+p[1]||m,h=e.querySelector('.line-highlight[data-range="'+o+'"]')||document.createElement("div");if(h.setAttribute("aria-hidden","true"),h.setAttribute("data-range",o),h.className=(i||"")+" line-highlight",u&&Prism.plugins.lineNumbers){var g=Prism.plugins.lineNumbers.getLine(e,m),y=Prism.plugins.lineNumbers.getLine(e,f);g&&(h.style.top=g.offsetTop+"px"),y&&(h.style.height=y.offsetTop-g.offsetTop+y.offsetHeight+"px")}else h.setAttribute("data-start",m),f>m&&h.setAttribute("data-end",f),h.style.top=(m-a-1)*d+"px",h.textContent=new Array(f-m+2).join(" \n");u?e.appendChild(h):(e.querySelector("code")||e).appendChild(h)}}function i(){var t=location.hash.slice(1);e(".temporary.line-highlight").forEach(function(e){e.parentNode.removeChild(e)});var i=(t.match(/\.([\d,-]+)$/)||[,""])[1];if(i&&!document.getElementById(t)){var r=t.slice(0,t.lastIndexOf(".")),o=document.getElementById(r);o&&(o.hasAttribute("data-line")||o.setAttribute("data-line",""),n(o,i,"temporary "),document.querySelector(".temporary.line-highlight").scrollIntoView())}}if("undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector){var r=function(){var e;return function(){if("undefined"==typeof e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding=0,t.style.border=0,t.innerHTML=" 
 ",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e}}(),o=0;Prism.hooks.add("before-sanity-check",function(t){var n=t.element.parentNode,i=n&&n.getAttribute("data-line");if(n&&i&&/pre/i.test(n.nodeName)){var r=0;e(".line-highlight",n).forEach(function(e){r+=e.textContent.length,e.parentNode.removeChild(e)}),r&&/^( \n)+$/.test(t.code.slice(-r))&&(t.code=t.code.slice(0,-r))}}),Prism.hooks.add("complete",function l(e){var r=e.element.parentNode,a=r&&r.getAttribute("data-line");if(r&&a&&/pre/i.test(r.nodeName)){clearTimeout(o);var s=Prism.plugins.lineNumbers,d=e.plugins&&e.plugins.lineNumbers;t(r,"line-numbers")&&s&&!d?Prism.hooks.add("line-numbers",l):(n(r,a),o=setTimeout(i,1))}}),window.addEventListener("hashchange",i),window.addEventListener("resize",function(){var e=document.querySelectorAll("pre[data-line]");Array.prototype.forEach.call(e,function(e){n(e)})})}}(); +!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var e="line-numbers",t=/\n(?!$)/g,n=function(e){var n=r(e),s=n["white-space"];if("pre-wrap"===s||"pre-line"===s){var l=e.querySelector("code"),i=e.querySelector(".line-numbers-rows"),a=e.querySelector(".line-numbers-sizer"),o=l.textContent.split(t);a||(a=document.createElement("span"),a.className="line-numbers-sizer",l.appendChild(a)),a.style.display="block",o.forEach(function(e,t){a.textContent=e||"\n";var n=a.getBoundingClientRect().height;i.children[t].style.height=n+"px"}),a.textContent="",a.style.display="none"}},r=function(e){return e?window.getComputedStyle?getComputedStyle(e):e.currentStyle||null:null};window.addEventListener("resize",function(){Array.prototype.forEach.call(document.querySelectorAll("pre."+e),n)}),Prism.hooks.add("complete",function(e){if(e.code){var r=e.element.parentNode,s=/\s*\bline-numbers\b\s*/;if(r&&/pre/i.test(r.nodeName)&&(s.test(r.className)||s.test(e.element.className))&&!e.element.querySelector(".line-numbers-rows")){s.test(e.element.className)&&(e.element.className=e.element.className.replace(s," ")),s.test(r.className)||(r.className+=" line-numbers");var l,i=e.code.match(t),a=i?i.length+1:1,o=new Array(a+1);o=o.join(""),l=document.createElement("span"),l.setAttribute("aria-hidden","true"),l.className="line-numbers-rows",l.innerHTML=o,r.hasAttribute("data-start")&&(r.style.counterReset="linenumber "+(parseInt(r.getAttribute("data-start"),10)-1)),e.element.appendChild(l),n(r),Prism.hooks.run("line-numbers",e)}}}),Prism.hooks.add("line-numbers",function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}),Prism.plugins.lineNumbers={getLine:function(t,n){if("PRE"===t.tagName&&t.classList.contains(e)){var r=t.querySelector(".line-numbers-rows"),s=parseInt(t.getAttribute("data-start"),10)||1,l=s+(r.children.length-1);s>n&&(n=s),n>l&&(n=l);var i=n-s;return r.children[i]}}}}}(); +!function(){if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){var i=/\b([a-z]{3,7}:\/\/|tel:)[\w\-+%~\/.:=&]+(?:\?[\w\-+%~\/.:#=?&!$'()*,;]*)?(?:#[\w\-+%~\/.:#=?&!$'()*,;]*)?/,n=/\b\S+@[\w.]+[a-z]{2}/,e=/\[([^\]]+)]\(([^)]+)\)/,t=["comment","url","attr-value","string"];Prism.plugins.autolinker={processGrammar:function(r){r&&!r["url-link"]&&(Prism.languages.DFS(r,function(r,a,l){t.indexOf(l)>-1&&"Array"!==Prism.util.type(a)&&(a.pattern||(a=this[r]={pattern:a}),a.inside=a.inside||{},"comment"==l&&(a.inside["md-link"]=e),"attr-value"==l?Prism.languages.insertBefore("inside","punctuation",{"url-link":i},a):a.inside["url-link"]=i,a.inside["email-link"]=n)}),r["url-link"]=i,r["email-link"]=n)}},Prism.hooks.add("before-highlight",function(i){Prism.plugins.autolinker.processGrammar(i.grammar)}),Prism.hooks.add("wrap",function(i){if(/-link$/.test(i.type)){i.tag="a";var n=i.content;if("email-link"==i.type&&0!=n.indexOf("mailto:"))n="mailto:"+n;else if("md-link"==i.type){var t=i.content.match(e);n=t[2],i.content=t[1]}i.attributes.href=n}try{i.content=decodeURIComponent(i.content)}catch(r){}})}}(); diff --git a/docs/vectorious/6.0.3/styles/styles.css b/docs/vectorious/6.0.3/styles/styles.css new file mode 100644 index 00000000..12356e1d --- /dev/null +++ b/docs/vectorious/6.0.3/styles/styles.css @@ -0,0 +1,415 @@ +:root { + --primary-color: #0664a8; + --secondary-color: #107e7d; + --link-color: var(--primary-color); + --link-hover-color: var(--primary-color); + --border-color: #eee; + --code-color: #666; + --code-attention-color: #ca2d00; + --text-color: #4a4a4a; + --light-font-color: #999; + --supporting-color: #7097b5; + --heading-color: var(--text-color); + --subheading-color: var(--secondary-color); + --heading-background: #f7f7f7; + --code-bg-color: #f8f8f8; + --nav-title-color: var(--primary-color); + --nav-title-align: center; + --nav-title-size: 1rem; + --nav-title-margin-bottom: 1.5em; + --nav-title-font-weight: 600; + --nav-list-margin-left: 2em; + --nav-bg-color: #fff; + --nav-heading-display: block; + --nav-heading-color: #aaa; + --nav-link-color: #666; + --nav-text-color: #aaa; + --nav-type-class-color: #fff; + --nav-type-class-bg: #FF8C00; + --nav-type-member-color: #39b739; + --nav-type-member-bg: #d5efd5; + --nav-type-function-color: #549ab9; + --nav-type-function-bg: #e1f6ff; + --nav-type-namespace-color: #eb6420; + --nav-type-namespace-bg: #fad8c7; + --nav-type-typedef-color: #964cb1; + --nav-type-typedef-bg: #f2e4f7; + --nav-type-module-color: #964cb1; + --nav-type-module-bg: #f2e4f7; + --nav-type-event-color: #948b34; + --nav-type-event-bg: #fff6a6; + --max-content-width: 900px; + --nav-width: 320px; + --padding-unit: 30px; + --layout-footer-color: #aaa; + --member-name-signature-display: none; + --base-font-size: 16px; + --base-line-height: 1.7; + --body-font: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + --code-font: Consolas, Monaco, 'Andale Mono', monospace; } + +body { + font-family: var(--body-font); + font-size: var(--base-font-size); + line-height: var(--base-line-height); + color: var(--text-color); + -webkit-font-smoothing: antialiased; + text-size-adjust: 100%; } + +* { + box-sizing: border-box; } + +a { + text-decoration: none; + color: var(--link-color); } + a:hover, a:active { + text-decoration: underline; + color: var(--link-hover-color); } + +img { + max-width: 100%; } + img + p { + margin-top: 1em; } + +ul { + margin: 1em 0; } + +tt, code, kbd, samp { + font-family: var(--code-font); } + +code { + display: inline-block; + background-color: var(--code-bg-color); + padding: 2px 6px 0px; + border-radius: 3px; + color: var(--code-attention-color); } + +.prettyprint.source code:not([class*="language-"]) { + display: block; + padding: 20px; + overflow: scroll; + color: var(--code-color); } + +.layout-main, +.layout-footer { + margin-left: var(--nav-width); } + +.container { + max-width: var(--max-content-width); + margin-left: auto; + margin-right: auto; } + +.layout-main { + margin-top: var(--padding-unit); + margin-bottom: var(--padding-unit); + padding: 0 var(--padding-unit); } + +.layout-header { + background: var(--nav-bg-color); + border-right: 1px solid var(--border-color); + position: fixed; + padding: 0 var(--padding-unit); + top: 0; + left: 0; + right: 0; + width: var(--nav-width); + height: 100%; + overflow: scroll; } + .layout-header h1 { + display: block; + margin-bottom: var(--nav-title-margin-bottom); + font-size: var(--nav-title-size); + font-weight: var(--nav-title-font-weight); + text-align: var(--nav-title-align); } + .layout-header h1 a:link, .layout-header h1 a:visited { + color: var(--nav-title-color); } + .layout-header img { + max-width: 120px; + display: block; + margin: 1em auto; } + +.layout-nav { + margin-bottom: 2rem; } + .layout-nav ul { + margin: 0 0 var(--nav-list-margin-left); + padding: 0; } + .layout-nav li { + list-style-type: none; + font-size: 0.95em; } + .layout-nav li.nav-heading:first-child { + display: var(--nav-heading-display); + margin-left: 0; + margin-bottom: 1em; + text-transform: uppercase; + color: var(--nav-heading-color); + font-size: 0.85em; } + .layout-nav a { + color: var(--nav-link-color); } + .layout-nav a:link, .layout-nav a a:visited { + color: var(--nav-link-color); } + +.layout-content--source { + max-width: none; } + +.nav-heading { + margin-top: 1em; + font-weight: 500; } + .nav-heading a { + color: var(--nav-link-color); } + .nav-heading a:link, .nav-heading a:visited { + color: var(--nav-link-color); } + .nav-heading .nav-item-type { + font-size: 0.9em; } + +.nav-item-type { + display: inline-block; + font-size: 0.9em; + width: 1.2em; + height: 1.2em; + line-height: 1.2em; + display: inline-block; + text-align: center; + border-radius: 0.2em; + margin-right: 0.5em; } + .nav-item-type.type-class { + color: var(--nav-type-class-color); + background: var(--nav-type-class-bg); } + .nav-item-type.type-typedef { + color: var(--nav-type-typedef-color); + background: var(--nav-type-typedef-bg); } + .nav-item-type.type-function { + color: var(--nav-type-function-color); + background: var(--nav-type-function-bg); } + .nav-item-type.type-namespace { + color: var(--nav-type-namespace-color); + background: var(--nav-type-namespace-bg); } + .nav-item-type.type-member { + color: var(--nav-type-member-color); + background: var(--nav-type-member-bg); } + .nav-item-type.type-module { + color: var(--nav-type-module-color); + background: var(--nav-type-module-bg); } + .nav-item-type.type-event { + color: var(--nav-type-event-color); + background: var(--nav-type-event-bg); } + +.nav-item-name.is-function:after { + display: inline; + content: '()'; + color: var(--nav-link-color); + opacity: 0.75; } + +.nav-item-name.is-class { + font-size: 1.1em; } + +.layout-footer { + padding-top: 2rem; + padding-bottom: 2rem; + font-size: 0.8em; + text-align: center; + color: var(--layout-footer-color); } + .layout-footer a { + color: var(--light-font-color); + text-decoration: underline; } + +h1 { + font-size: 2rem; + color: var(--heading-color); } + +h5 { + margin: 0; + font-weight: 500; + font-size: 1em; } + h5 + .code-caption { + margin-top: 1em; } + +.page-kind { + margin: 0 0 -0.5em; + font-weight: 400; + color: var(--light-font-color); + text-transform: uppercase; } + +.page-title { + margin-top: 0; } + +.subtitle { + font-weight: 600; + font-size: 1.5em; + color: var(--subheading-color); + margin: 1em 0; + padding: 0.4em 0; + border-bottom: 1px solid var(--border-color); } + .subtitle + .event, + .subtitle + .member, + .subtitle + .method { + border-top: none; + padding-top: 0; } + +.method-type + .method-name { + margin-top: 0.5em; } + +.event-name, +.member-name, +.method-name, +.type-definition-name { + margin: 1em 0; + font-size: 1.4rem; + font-family: var(--code-font); + font-weight: 600; + color: var(--primary-color); } + .event-name .signature-attributes, + .member-name .signature-attributes, + .method-name .signature-attributes, + .type-definition-name .signature-attributes { + display: inline-block; + margin-left: 0.25em; + font-size: 60%; + color: #999; + font-style: italic; + font-weight: lighter; } + +.type-signature { + display: inline-block; + margin-left: 0.5em; } + +.member-name .type-signature { + display: var(--member-name-signature-display); } + +.type-signature, +.return-type-signature { + color: #aaa; + font-weight: 400; } + .type-signature a:link, .type-signature a:visited, + .return-type-signature a:link, + .return-type-signature a:visited { + color: #aaa; } + +table { + margin-top: 1rem; + width: auto; + min-width: 400px; + max-width: 100%; + border-top: 1px solid var(--border-color); + border-right: 1px solid var(--border-color); } + table th, table h4 { + font-weight: 500; } + table th, + table td { + padding: 0.5rem 0.75rem; } + table th, + table td { + border-left: 1px solid var(--border-color); + border-bottom: 1px solid var(--border-color); } + table p:last-child { + margin-bottom: 0; } + +.readme h2 { + border-bottom: 1px solid var(--border-color); + margin: 1em 0; + padding-bottom: 0.5rem; + color: var(--subheading-color); } + .readme h2 + h3 { + margin-top: 0; } + +.readme h3 { + margin: 2rem 0 1rem 0; } + +article.event, article.member, article.method { + padding: 1em 0 1em; + margin: 1em 0; + border-top: 1px solid var(--border-color); } + +.method-type-signature:not(:empty) { + display: inline-block; + background: #ecf0f1; + color: #627475; + padding: 0.25em 0.5em 0.35em; + font-weight: 300; + font-size: 0.8rem; + margin: 0 0.75em 0 0; } + +.method-heading { + margin: 1em 0; } + +li.method-returns, +.method-params li { + margin-bottom: 1em; } + +.method-source a:link, .method-source a:visited { + color: var(--light-font-color); } + +.method-returns p { + margin: 0; } + +.event-description, +.method-description { + margin: 0 0 2em; } + +.param-type code, +.method-returns code { + color: #111; } + +.param-name { + font-weight: 600; + display: inline-block; + margin-right: 0.5em; } + +.param-type, +.param-default, +.param-attributes { + font-family: var(--code-font); } + +.param-default::before { + display: inline-block; + content: 'Default:'; + font-family: var(--body-font); } + +.param-attributes { + color: var(--light-font-color); } + +.param-description p:first-child { + margin-top: 0; } + +.param-properties { + font-weight: 500; + margin: 1em 0 0; } + +.param-types, +.property-types { + display: inline-block; + margin: 0 0.5em 0 .25em; + color: #999; } + +.param-attr, +.property-attr { + display: inline-block; + padding: 0.2em 0.5em; + border: 1px solid #eee; + color: #aaa; + font-weight: 300; + font-size: 0.8em; + vertical-align: baseline; } + +.properties-table p:last-child { + margin-bottom: 0; } + +pre[class*="language-"] { + border-radius: 0; } + +code[class*="language-"], +pre[class*="language-"] { + text-shadow: none; + border: none; } + code[class*="language-"].source-page, + pre[class*="language-"].source-page { + font-size: 0.9em; } + +.line-numbers .line-numbers-rows { + border-right: none; } + +.source-page { + font-size: 14px; } + .source-page code { + z-index: 1; } + .source-page .line-height.temporary { + z-index: 0; } diff --git a/docs/vectorious/6.0.3/styles/vendor/prism-custom.css b/docs/vectorious/6.0.3/styles/vendor/prism-custom.css new file mode 100644 index 00000000..09d20634 --- /dev/null +++ b/docs/vectorious/6.0.3/styles/vendor/prism-custom.css @@ -0,0 +1,142 @@ +/* PrismJS 1.17.1 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+http */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ + +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, pre[class*="language-"] ::selection, +code[class*="language-"]::selection, code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #f6f8fa; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function, +.token.class-name { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + diff --git a/docs/vectorious/6.0.3/styles/vendor/prism-default.css b/docs/vectorious/6.0.3/styles/vendor/prism-default.css new file mode 100644 index 00000000..006d0a30 --- /dev/null +++ b/docs/vectorious/6.0.3/styles/vendor/prism-default.css @@ -0,0 +1,142 @@ +/* PrismJS 1.17.1 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+http */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ + +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, pre[class*="language-"] ::selection, +code[class*="language-"]::selection, code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function, +.token.class-name { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + diff --git a/docs/vectorious/6.0.3/styles/vendor/prism-okaidia.css b/docs/vectorious/6.0.3/styles/vendor/prism-okaidia.css new file mode 100644 index 00000000..95b3eab4 --- /dev/null +++ b/docs/vectorious/6.0.3/styles/vendor/prism-okaidia.css @@ -0,0 +1,217 @@ +/* PrismJS 1.16.0 +https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript+json&plugins=line-highlight+line-numbers */ +/** + * okaidia theme for JavaScript, CSS and HTML + * Loosely based on Monokai textmate theme by http://www.monokai.nl/ + * @author ocodia + */ + +code[class*="language-"], +pre[class*="language-"] { + color: #f8f8f2; + background: none; + text-shadow: 0 1px rgba(0, 0, 0, 0.3); + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; + border-radius: 0.3em; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #272822; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #f8f8f2; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.constant, +.token.symbol, +.token.deleted { + color: #f92672; +} + +.token.boolean, +.token.number { + color: #ae81ff; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #a6e22e; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string, +.token.variable { + color: #f8f8f2; +} + +.token.atrule, +.token.attr-value, +.token.function, +.token.class-name { + color: #e6db74; +} + +.token.keyword { + color: #66d9ef; +} + +.token.regex, +.token.important { + color: #fd971f; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +pre[data-line] { + position: relative; + padding: 1em 0 1em 3em; +} + +.line-highlight { + position: absolute; + left: 0; + right: 0; + padding: inherit 0; + margin-top: 1em; /* Same as .prism’s padding-top */ + + background: hsla(24, 20%, 50%,.08); + background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0)); + + pointer-events: none; + + line-height: inherit; + white-space: pre; +} + + .line-highlight:before, + .line-highlight[data-end]:after { + content: attr(data-start); + position: absolute; + top: .4em; + left: .6em; + min-width: 1em; + padding: 0 .5em; + background-color: hsla(24, 20%, 50%,.4); + color: hsl(24, 20%, 95%); + font: bold 65%/1.5 sans-serif; + text-align: center; + vertical-align: .3em; + border-radius: 999px; + text-shadow: none; + box-shadow: 0 1px white; + } + + .line-highlight[data-end]:after { + content: attr(data-end); + top: auto; + bottom: .4em; + } + +.line-numbers .line-highlight:before, +.line-numbers .line-highlight:after { + content: none; +} + +pre[class*="language-"].line-numbers { + position: relative; + padding-left: 3.8em; + counter-reset: linenumber; +} + +pre[class*="language-"].line-numbers > code { + position: relative; + white-space: inherit; +} + +.line-numbers .line-numbers-rows { + position: absolute; + pointer-events: none; + top: 0; + font-size: 100%; + left: -3.8em; + width: 3em; /* works for line-numbers below 1000 lines */ + letter-spacing: -1px; + border-right: 1px solid #999; + + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + +} + + .line-numbers-rows > span { + pointer-events: none; + display: block; + counter-increment: linenumber; + } + + .line-numbers-rows > span:before { + content: counter(linenumber); + color: #999; + display: block; + padding-right: 0.8em; + text-align: right; + } diff --git a/docs/vectorious/6.0.3/styles/vendor/prism-tomorrow-night.css b/docs/vectorious/6.0.3/styles/vendor/prism-tomorrow-night.css new file mode 100644 index 00000000..0039e969 --- /dev/null +++ b/docs/vectorious/6.0.3/styles/vendor/prism-tomorrow-night.css @@ -0,0 +1,217 @@ +/* PrismJS 1.16.0 +https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript+json&plugins=line-highlight+line-numbers */ +/** + * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML + * Based on https://github.com/chriskempson/tomorrow-theme + * @author Rose Pritchard + */ + +code[class*="language-"], +pre[class*="language-"] { + color: #ccc; + background: none; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; + +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #2d2d2d; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.block-comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: #999; +} + +.token.punctuation { + color: #ccc; +} + +.token.tag, +.token.attr-name, +.token.namespace, +.token.deleted { + color: #e2777a; +} + +.token.function-name { + color: #6196cc; +} + +.token.boolean, +.token.number, +.token.function { + color: #f08d49; +} + +.token.property, +.token.class-name, +.token.constant, +.token.symbol { + color: #f8c555; +} + +.token.selector, +.token.important, +.token.atrule, +.token.keyword, +.token.builtin { + color: #cc99cd; +} + +.token.string, +.token.char, +.token.attr-value, +.token.regex, +.token.variable { + color: #7ec699; +} + +.token.operator, +.token.entity, +.token.url { + color: #67cdcc; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +.token.inserted { + color: green; +} + +pre[data-line] { + position: relative; + padding: 1em 0 1em 3em; +} + +.line-highlight { + position: absolute; + left: 0; + right: 0; + padding: inherit 0; + margin-top: 1em; /* Same as .prism’s padding-top */ + + background: hsla(24, 20%, 50%,.08); + background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0)); + + pointer-events: none; + + line-height: inherit; + white-space: pre; +} + + .line-highlight:before, + .line-highlight[data-end]:after { + content: attr(data-start); + position: absolute; + top: .4em; + left: .6em; + min-width: 1em; + padding: 0 .5em; + background-color: hsla(24, 20%, 50%,.4); + color: hsl(24, 20%, 95%); + font: bold 65%/1.5 sans-serif; + text-align: center; + vertical-align: .3em; + border-radius: 999px; + text-shadow: none; + box-shadow: 0 1px white; + } + + .line-highlight[data-end]:after { + content: attr(data-end); + top: auto; + bottom: .4em; + } + +.line-numbers .line-highlight:before, +.line-numbers .line-highlight:after { + content: none; +} + +pre[class*="language-"].line-numbers { + position: relative; + padding-left: 3.8em; + counter-reset: linenumber; +} + +pre[class*="language-"].line-numbers > code { + position: relative; + white-space: inherit; +} + +.line-numbers .line-numbers-rows { + position: absolute; + pointer-events: none; + top: 0; + font-size: 100%; + left: -3.8em; + width: 3em; /* works for line-numbers below 1000 lines */ + letter-spacing: -1px; + border-right: 1px solid #999; + + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + +} + + .line-numbers-rows > span { + pointer-events: none; + display: block; + counter-increment: linenumber; + } + + .line-numbers-rows > span:before { + content: counter(linenumber); + color: #999; + display: block; + padding-right: 0.8em; + text-align: right; + } + diff --git a/jsdoc.json b/jsdoc.json index d3a6ade6..ced3310d 100644 --- a/jsdoc.json +++ b/jsdoc.json @@ -27,11 +27,21 @@ "prism-theme": "prism-custom" }, "metadata": { - "title": "Vectorious" + "title": "Vectorious", + "logo": "https://github.com/mateogianolio/vectorious/raw/master/logo.gif" }, "styles": { + "base-font-size": "16px", + "base-line-height": "1.5", + "body-font": "-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji", + "body-font-size": "16px", + "body-line-height": "1.5", + "text-color": "rgb(36, 41, 46)", + "code-font": "SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace", "primary-color": "#0E6EB8", "secondary-color": "#000000", - "nav-title-size": "0" + "nav-title-size": "0", + "nav-width": "240px", + "max-content-width": "auto" } } diff --git a/package.json b/package.json index bdd2ed40..67c71af1 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "test": "jest", "benchmark": "for file in $(ls src/**/*.bench.ts); do ts-node $file; done", - "docs": "jsdoc --configure jsdoc.json", + "docs": "tsc --outDir built && jsdoc --configure jsdoc.json && rm -rf built", "build:node": "esbuild --bundle src/index.ts --minify --sourcemap --platform=node --outfile=dist/index.js --external:nblas --external:nlapack", "build:browser": "esbuild --bundle src/index.ts --minify --sourcemap --platform=browser --global-name=v --outfile=dist/index.browser.js --external:nblas --external:nlapack", "build": "tsc -emitDeclarationOnly && npm run build:node && npm run build:browser", diff --git a/src/core/index.ts b/src/core/index.ts index 6c015487..9475b453 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -343,7 +343,7 @@ export class NDArray implements INDArray { /** * @name T * @memberof NDArray.prototype - * @description Short for this.copy().transpose() + * @description Short for `this.transpose()` * @type NDArray */ public get T() {