mathjs 10.5.2 → 10.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HISTORY.md +8 -0
- package/lib/browser/math.js +3 -3
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/version.js +1 -1
- package/lib/esm/version.js +1 -1
- package/package.json +6 -11
- package/docs/command_line_interface.md +0 -87
- package/docs/core/chaining.md +0 -41
- package/docs/core/configuration.md +0 -144
- package/docs/core/extension.md +0 -263
- package/docs/core/index.md +0 -21
- package/docs/core/serialization.md +0 -50
- package/docs/custom_bundling.md +0 -116
- package/docs/datatypes/bignumbers.md +0 -102
- package/docs/datatypes/complex_numbers.md +0 -168
- package/docs/datatypes/fractions.md +0 -75
- package/docs/datatypes/index.md +0 -67
- package/docs/datatypes/matrices.md +0 -375
- package/docs/datatypes/numbers.md +0 -106
- package/docs/datatypes/units.md +0 -444
- package/docs/expressions/algebra.md +0 -110
- package/docs/expressions/customization.md +0 -379
- package/docs/expressions/expression_trees.md +0 -710
- package/docs/expressions/html_classes.md +0 -38
- package/docs/expressions/index.md +0 -21
- package/docs/expressions/parsing.md +0 -224
- package/docs/expressions/security.md +0 -89
- package/docs/expressions/syntax.md +0 -706
- package/docs/getting_started.md +0 -124
- package/docs/index.md +0 -39
- package/docs/reference/classes/densematrix.md +0 -247
- package/docs/reference/classes/fibonacciheap.md +0 -70
- package/docs/reference/classes/matrixindex.md +0 -133
- package/docs/reference/classes/matrixrange.md +0 -158
- package/docs/reference/classes/resultset.md +0 -47
- package/docs/reference/classes/sparsematrix.md +0 -245
- package/docs/reference/classes/unit.md +0 -242
- package/docs/reference/classes.md +0 -86
- package/docs/reference/constants.md +0 -29
- package/docs/reference/functions/abs.md +0 -46
- package/docs/reference/functions/acos.md +0 -49
- package/docs/reference/functions/acosh.md +0 -47
- package/docs/reference/functions/acot.md +0 -48
- package/docs/reference/functions/acoth.md +0 -46
- package/docs/reference/functions/acsc.md +0 -49
- package/docs/reference/functions/acsch.md +0 -46
- package/docs/reference/functions/add.md +0 -59
- package/docs/reference/functions/and.md +0 -53
- package/docs/reference/functions/apply.md +0 -56
- package/docs/reference/functions/arg.md +0 -53
- package/docs/reference/functions/asec.md +0 -49
- package/docs/reference/functions/asech.md +0 -46
- package/docs/reference/functions/asin.md +0 -49
- package/docs/reference/functions/asinh.md +0 -46
- package/docs/reference/functions/atan.md +0 -49
- package/docs/reference/functions/atan2.md +0 -56
- package/docs/reference/functions/atanh.md +0 -46
- package/docs/reference/functions/bellNumbers.md +0 -45
- package/docs/reference/functions/bignumber.md +0 -47
- package/docs/reference/functions/bin.md +0 -45
- package/docs/reference/functions/bitAnd.md +0 -51
- package/docs/reference/functions/bitNot.md +0 -51
- package/docs/reference/functions/bitOr.md +0 -52
- package/docs/reference/functions/bitXor.md +0 -51
- package/docs/reference/functions/boolean.md +0 -50
- package/docs/reference/functions/catalan.md +0 -45
- package/docs/reference/functions/cbrt.md +0 -60
- package/docs/reference/functions/ceil.md +0 -63
- package/docs/reference/functions/chain.md +0 -54
- package/docs/reference/functions/clone.md +0 -43
- package/docs/reference/functions/column.md +0 -45
- package/docs/reference/functions/combinations.md +0 -49
- package/docs/reference/functions/combinationsWithRep.md +0 -49
- package/docs/reference/functions/compare.md +0 -67
- package/docs/reference/functions/compareNatural.md +0 -92
- package/docs/reference/functions/compareText.md +0 -54
- package/docs/reference/functions/compile.md +0 -56
- package/docs/reference/functions/complex.md +0 -17
- package/docs/reference/functions/composition.md +0 -46
- package/docs/reference/functions/concat.md +0 -56
- package/docs/reference/functions/config.md +0 -44
- package/docs/reference/functions/conj.md +0 -50
- package/docs/reference/functions/cos.md +0 -51
- package/docs/reference/functions/cosh.md +0 -46
- package/docs/reference/functions/cot.md +0 -47
- package/docs/reference/functions/coth.md +0 -49
- package/docs/reference/functions/count.md +0 -45
- package/docs/reference/functions/createUnit.md +0 -52
- package/docs/reference/functions/cross.md +0 -58
- package/docs/reference/functions/csc.md +0 -47
- package/docs/reference/functions/csch.md +0 -49
- package/docs/reference/functions/ctranspose.md +0 -50
- package/docs/reference/functions/cube.md +0 -51
- package/docs/reference/functions/cumsum.md +0 -57
- package/docs/reference/functions/deepEqual.md +0 -53
- package/docs/reference/functions/derivative.md +0 -61
- package/docs/reference/functions/det.md +0 -49
- package/docs/reference/functions/diag.md +0 -61
- package/docs/reference/functions/diff.md +0 -70
- package/docs/reference/functions/distance.md +0 -80
- package/docs/reference/functions/divide.md +0 -55
- package/docs/reference/functions/dot.md +0 -48
- package/docs/reference/functions/dotDivide.md +0 -52
- package/docs/reference/functions/dotMultiply.md +0 -52
- package/docs/reference/functions/dotPow.md +0 -49
- package/docs/reference/functions/eigs.md +0 -54
- package/docs/reference/functions/equal.md +0 -75
- package/docs/reference/functions/equalText.md +0 -53
- package/docs/reference/functions/erf.md +0 -49
- package/docs/reference/functions/evaluate.md +0 -56
- package/docs/reference/functions/exp.md +0 -54
- package/docs/reference/functions/expm.md +0 -49
- package/docs/reference/functions/expm1.md +0 -54
- package/docs/reference/functions/factorial.md +0 -49
- package/docs/reference/functions/fft.md +0 -35
- package/docs/reference/functions/filter.md +0 -50
- package/docs/reference/functions/fix.md +0 -62
- package/docs/reference/functions/flatten.md +0 -46
- package/docs/reference/functions/floor.md +0 -66
- package/docs/reference/functions/forEach.md +0 -41
- package/docs/reference/functions/format.md +0 -127
- package/docs/reference/functions/fraction.md +0 -45
- package/docs/reference/functions/gamma.md +0 -49
- package/docs/reference/functions/gcd.md +0 -50
- package/docs/reference/functions/getMatrixDataType.md +0 -59
- package/docs/reference/functions/hasNumericValue.md +0 -55
- package/docs/reference/functions/help.md +0 -42
- package/docs/reference/functions/hex.md +0 -45
- package/docs/reference/functions/hypot.md +0 -51
- package/docs/reference/functions/identity.md +0 -57
- package/docs/reference/functions/ifft.md +0 -35
- package/docs/reference/functions/im.md +0 -53
- package/docs/reference/functions/import.md +0 -68
- package/docs/reference/functions/index.md +0 -55
- package/docs/reference/functions/intersect.md +0 -50
- package/docs/reference/functions/inv.md +0 -45
- package/docs/reference/functions/invmod.md +0 -47
- package/docs/reference/functions/isInteger.md +0 -55
- package/docs/reference/functions/isNaN.md +0 -56
- package/docs/reference/functions/isNegative.md +0 -55
- package/docs/reference/functions/isNumeric.md +0 -55
- package/docs/reference/functions/isPositive.md +0 -57
- package/docs/reference/functions/isPrime.md +0 -54
- package/docs/reference/functions/isZero.md +0 -59
- package/docs/reference/functions/kldivergence.md +0 -41
- package/docs/reference/functions/kron.md +0 -53
- package/docs/reference/functions/larger.md +0 -60
- package/docs/reference/functions/largerEq.md +0 -56
- package/docs/reference/functions/lcm.md +0 -54
- package/docs/reference/functions/leafCount.md +0 -52
- package/docs/reference/functions/leftShift.md +0 -52
- package/docs/reference/functions/lgamma.md +0 -46
- package/docs/reference/functions/log.md +0 -57
- package/docs/reference/functions/log10.md +0 -50
- package/docs/reference/functions/log1p.md +0 -54
- package/docs/reference/functions/log2.md +0 -50
- package/docs/reference/functions/lsolve.md +0 -51
- package/docs/reference/functions/lsolveAll.md +0 -51
- package/docs/reference/functions/lup.md +0 -52
- package/docs/reference/functions/lusolve.md +0 -59
- package/docs/reference/functions/mad.md +0 -50
- package/docs/reference/functions/map.md +0 -65
- package/docs/reference/functions/matrix.md +0 -56
- package/docs/reference/functions/matrixFromColumns.md +0 -49
- package/docs/reference/functions/matrixFromFunction.md +0 -54
- package/docs/reference/functions/matrixFromRows.md +0 -49
- package/docs/reference/functions/max.md +0 -61
- package/docs/reference/functions/mean.md +0 -57
- package/docs/reference/functions/median.md +0 -57
- package/docs/reference/functions/min.md +0 -61
- package/docs/reference/functions/mod.md +0 -59
- package/docs/reference/functions/mode.md +0 -50
- package/docs/reference/functions/multinomial.md +0 -46
- package/docs/reference/functions/multiply.md +0 -60
- package/docs/reference/functions/norm.md +0 -59
- package/docs/reference/functions/not.md +0 -50
- package/docs/reference/functions/nthRoot.md +0 -53
- package/docs/reference/functions/nthRoots.md +0 -58
- package/docs/reference/functions/number.md +0 -49
- package/docs/reference/functions/numeric.md +0 -52
- package/docs/reference/functions/oct.md +0 -45
- package/docs/reference/functions/ones.md +0 -59
- package/docs/reference/functions/or.md +0 -53
- package/docs/reference/functions/parse.md +0 -56
- package/docs/reference/functions/parser.md +0 -70
- package/docs/reference/functions/partitionSelect.md +0 -53
- package/docs/reference/functions/permutations.md +0 -51
- package/docs/reference/functions/pickRandom.md +0 -59
- package/docs/reference/functions/pinv.md +0 -44
- package/docs/reference/functions/pow.md +0 -65
- package/docs/reference/functions/print.md +0 -64
- package/docs/reference/functions/prod.md +0 -55
- package/docs/reference/functions/qr.md +0 -65
- package/docs/reference/functions/quantileSeq.md +0 -62
- package/docs/reference/functions/random.md +0 -54
- package/docs/reference/functions/randomInt.md +0 -53
- package/docs/reference/functions/range.md +0 -70
- package/docs/reference/functions/rationalize.md +0 -68
- package/docs/reference/functions/re.md +0 -53
- package/docs/reference/functions/reshape.md +0 -60
- package/docs/reference/functions/resize.md +0 -51
- package/docs/reference/functions/resolve.md +0 -46
- package/docs/reference/functions/rightArithShift.md +0 -52
- package/docs/reference/functions/rightLogShift.md +0 -52
- package/docs/reference/functions/rotate.md +0 -53
- package/docs/reference/functions/rotationMatrix.md +0 -57
- package/docs/reference/functions/round.md +0 -61
- package/docs/reference/functions/row.md +0 -45
- package/docs/reference/functions/sec.md +0 -47
- package/docs/reference/functions/sech.md +0 -49
- package/docs/reference/functions/setCartesian.md +0 -49
- package/docs/reference/functions/setDifference.md +0 -47
- package/docs/reference/functions/setDistinct.md +0 -43
- package/docs/reference/functions/setIntersect.md +0 -46
- package/docs/reference/functions/setIsSubset.md +0 -47
- package/docs/reference/functions/setMultiplicity.md +0 -46
- package/docs/reference/functions/setPowerset.md +0 -43
- package/docs/reference/functions/setSize.md +0 -47
- package/docs/reference/functions/setSymDifference.md +0 -47
- package/docs/reference/functions/setUnion.md +0 -46
- package/docs/reference/functions/sign.md +0 -52
- package/docs/reference/functions/simplify.md +0 -130
- package/docs/reference/functions/simplifyConstant.md +0 -52
- package/docs/reference/functions/simplifyCore.md +0 -50
- package/docs/reference/functions/sin.md +0 -51
- package/docs/reference/functions/sinh.md +0 -46
- package/docs/reference/functions/size.md +0 -50
- package/docs/reference/functions/slu.md +0 -57
- package/docs/reference/functions/smaller.md +0 -60
- package/docs/reference/functions/smallerEq.md +0 -56
- package/docs/reference/functions/sort.md +0 -56
- package/docs/reference/functions/sparse.md +0 -51
- package/docs/reference/functions/splitUnit.md +0 -37
- package/docs/reference/functions/sqrt.md +0 -50
- package/docs/reference/functions/sqrtm.md +0 -46
- package/docs/reference/functions/square.md +0 -51
- package/docs/reference/functions/squeeze.md +0 -53
- package/docs/reference/functions/std.md +0 -76
- package/docs/reference/functions/stirlingS2.md +0 -52
- package/docs/reference/functions/string.md +0 -49
- package/docs/reference/functions/subset.md +0 -65
- package/docs/reference/functions/subtract.md +0 -54
- package/docs/reference/functions/sum.md +0 -54
- package/docs/reference/functions/symbolicEqual.md +0 -62
- package/docs/reference/functions/tan.md +0 -49
- package/docs/reference/functions/tanh.md +0 -50
- package/docs/reference/functions/to.md +0 -47
- package/docs/reference/functions/trace.md +0 -50
- package/docs/reference/functions/transpose.md +0 -49
- package/docs/reference/functions/typeOf.md +0 -81
- package/docs/reference/functions/typed.md +0 -56
- package/docs/reference/functions/unaryMinus.md +0 -49
- package/docs/reference/functions/unaryPlus.md +0 -48
- package/docs/reference/functions/unequal.md +0 -74
- package/docs/reference/functions/unit.md +0 -48
- package/docs/reference/functions/usolve.md +0 -51
- package/docs/reference/functions/usolveAll.md +0 -51
- package/docs/reference/functions/variance.md +0 -78
- package/docs/reference/functions/xgcd.md +0 -47
- package/docs/reference/functions/xor.md +0 -53
- package/docs/reference/functions/zeros.md +0 -57
- package/docs/reference/functions.md +0 -297
- package/docs/reference/index.md +0 -5
- package/examples/advanced/convert_fraction_to_bignumber.js +0 -59
- package/examples/advanced/custom_argument_parsing.js +0 -98
- package/examples/advanced/custom_datatype.js +0 -56
- package/examples/advanced/custom_evaluate_using_factories.js +0 -19
- package/examples/advanced/custom_evaluate_using_import.js +0 -18
- package/examples/advanced/custom_loading.js +0 -33
- package/examples/advanced/custom_relational_functions.js +0 -62
- package/examples/advanced/custom_scope_objects.js +0 -115
- package/examples/advanced/expression_trees.js +0 -55
- package/examples/advanced/function_transform.js +0 -50
- package/examples/advanced/more_secure_eval.js +0 -36
- package/examples/advanced/use_bigint.js +0 -43
- package/examples/advanced/web_server/math_worker.js +0 -24
- package/examples/advanced/web_server/server.js +0 -80
- package/examples/algebra.js +0 -34
- package/examples/basic_usage.js +0 -49
- package/examples/bignumbers.js +0 -52
- package/examples/browser/angle_configuration.html +0 -134
- package/examples/browser/basic_usage.html +0 -39
- package/examples/browser/currency_conversion.html +0 -125
- package/examples/browser/custom_separators.html +0 -81
- package/examples/browser/plot.html +0 -78
- package/examples/browser/pretty_printing_with_mathjax.html +0 -122
- package/examples/browser/printing_html.html +0 -170
- package/examples/browser/requirejs_loading.html +0 -20
- package/examples/browser/rocket_trajectory_optimization.html +0 -301
- package/examples/browser/webworkers/webworkers.html +0 -80
- package/examples/browser/webworkers/worker.js +0 -28
- package/examples/chaining.js +0 -56
- package/examples/complex_numbers.js +0 -67
- package/examples/expressions.js +0 -188
- package/examples/fractions.js +0 -74
- package/examples/import.js +0 -95
- package/examples/matrices.js +0 -101
- package/examples/objects.js +0 -35
- package/examples/package.json +0 -3
- package/examples/serialization.js +0 -16
- package/examples/sparse_matrices.js +0 -19
- package/examples/units.js +0 -108
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
<a name="Range"></a>
|
|
2
|
-
## Range
|
|
3
|
-
* [new Range(start, end, [step])](#new_Range_new)
|
|
4
|
-
* _instance_
|
|
5
|
-
* [.size()](#Range+size) ⇒ <code>Array.<number></code>
|
|
6
|
-
* [.min()](#Range+min) ⇒ <code>number</code> | <code>undefined</code>
|
|
7
|
-
* [.max()](#Range+max) ⇒ <code>number</code> | <code>undefined</code>
|
|
8
|
-
* [.forEach(callback)](#Range+forEach)
|
|
9
|
-
* [.map(callback)](#Range+map) ⇒ <code>Array</code>
|
|
10
|
-
* [.toArray()](#Range+toArray) ⇒ <code>Array</code>
|
|
11
|
-
* [.valueOf()](#Range+valueOf) ⇒ <code>Array</code>
|
|
12
|
-
* [.format([options])](#Range+format) ⇒ <code>string</code>
|
|
13
|
-
* [.toString()](#Range+toString) ⇒ <code>string</code>
|
|
14
|
-
* [.toJSON()](#Range+toJSON) ⇒ <code>Object</code>
|
|
15
|
-
* _static_
|
|
16
|
-
* [.parse(str)](#Range.parse) ⇒ <code>[Range](#Range)</code> | <code>null</code>
|
|
17
|
-
* [.fromJSON(json)](#Range.fromJSON) ⇒ <code>[Range](#Range)</code>
|
|
18
|
-
|
|
19
|
-
<a name="new_Range_new"></a>
|
|
20
|
-
### new Range(start, end, [step])
|
|
21
|
-
Create a range. A range has a start, step, and end, and contains functions
|
|
22
|
-
to iterate over the range.
|
|
23
|
-
|
|
24
|
-
A range can be constructed as:
|
|
25
|
-
|
|
26
|
-
```js
|
|
27
|
-
const range = new Range(start, end)
|
|
28
|
-
const range = new Range(start, end, step)
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
To get the result of the range:
|
|
32
|
-
|
|
33
|
-
```js
|
|
34
|
-
range.forEach(function (x) {
|
|
35
|
-
console.log(x)
|
|
36
|
-
})
|
|
37
|
-
range.map(function (x) {
|
|
38
|
-
return math.sin(x)
|
|
39
|
-
})
|
|
40
|
-
range.toArray()
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Example usage:
|
|
44
|
-
|
|
45
|
-
```js
|
|
46
|
-
const c = new Range(2, 6) // 2:1:5
|
|
47
|
-
c.toArray() // [2, 3, 4, 5]
|
|
48
|
-
const d = new Range(2, -3, -1) // 2:-1:-2
|
|
49
|
-
d.toArray() // [2, 1, 0, -1, -2]
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
| Param | Type | Description |
|
|
53
|
-
| --- | --- | --- |
|
|
54
|
-
| start | <code>number</code> | included lower bound |
|
|
55
|
-
| end | <code>number</code> | excluded upper bound |
|
|
56
|
-
| [step] | <code>number</code> | step size, default value is 1 |
|
|
57
|
-
|
|
58
|
-
<a name="Range+size"></a>
|
|
59
|
-
### range.size() ⇒ <code>Array.<number></code>
|
|
60
|
-
Retrieve the size of the range.
|
|
61
|
-
Returns an array containing one number, the number of elements in the range.
|
|
62
|
-
|
|
63
|
-
**Kind**: instance method of <code>[Range](#Range)</code>
|
|
64
|
-
**Returns**: <code>Array.<number></code> - size
|
|
65
|
-
<a name="Range+min"></a>
|
|
66
|
-
### range.min() ⇒ <code>number</code> | <code>undefined</code>
|
|
67
|
-
Calculate the minimum value in the range
|
|
68
|
-
|
|
69
|
-
**Kind**: instance method of <code>[Range](#Range)</code>
|
|
70
|
-
**Returns**: <code>number</code> | <code>undefined</code> - min
|
|
71
|
-
<a name="Range+max"></a>
|
|
72
|
-
### range.max() ⇒ <code>number</code> | <code>undefined</code>
|
|
73
|
-
Calculate the maximum value in the range
|
|
74
|
-
|
|
75
|
-
**Kind**: instance method of <code>[Range](#Range)</code>
|
|
76
|
-
**Returns**: <code>number</code> | <code>undefined</code> - max
|
|
77
|
-
<a name="Range+forEach"></a>
|
|
78
|
-
### range.forEach(callback)
|
|
79
|
-
Execute a callback function for each value in the range.
|
|
80
|
-
|
|
81
|
-
**Kind**: instance method of <code>[Range](#Range)</code>
|
|
82
|
-
|
|
83
|
-
| Param | Type | Description |
|
|
84
|
-
| --- | --- | --- |
|
|
85
|
-
| callback | <code>function</code> | The callback method is invoked with three parameters: the value of the element, the index of the element, and the Range being traversed. |
|
|
86
|
-
|
|
87
|
-
<a name="Range+map"></a>
|
|
88
|
-
### range.map(callback) ⇒ <code>Array</code>
|
|
89
|
-
Execute a callback function for each value in the Range, and return the
|
|
90
|
-
results as an array
|
|
91
|
-
|
|
92
|
-
**Kind**: instance method of <code>[Range](#Range)</code>
|
|
93
|
-
**Returns**: <code>Array</code> - array
|
|
94
|
-
|
|
95
|
-
| Param | Type | Description |
|
|
96
|
-
| --- | --- | --- |
|
|
97
|
-
| callback | <code>function</code> | The callback method is invoked with three parameters: the value of the element, the index of the element, and the Matrix being traversed. |
|
|
98
|
-
|
|
99
|
-
<a name="Range+toArray"></a>
|
|
100
|
-
### range.toArray() ⇒ <code>Array</code>
|
|
101
|
-
Create an Array with a copy of the Ranges data
|
|
102
|
-
|
|
103
|
-
**Kind**: instance method of <code>[Range](#Range)</code>
|
|
104
|
-
**Returns**: <code>Array</code> - array
|
|
105
|
-
<a name="Range+valueOf"></a>
|
|
106
|
-
### range.valueOf() ⇒ <code>Array</code>
|
|
107
|
-
Get the primitive value of the Range, a one dimensional array
|
|
108
|
-
|
|
109
|
-
**Kind**: instance method of <code>[Range](#Range)</code>
|
|
110
|
-
**Returns**: <code>Array</code> - array
|
|
111
|
-
<a name="Range+format"></a>
|
|
112
|
-
### range.format([options]) ⇒ <code>string</code>
|
|
113
|
-
Get a string representation of the range, with optional formatting options.
|
|
114
|
-
Output is formatted as 'start:step:end', for example '2:6' or '0:0.2:11'
|
|
115
|
-
|
|
116
|
-
**Kind**: instance method of <code>[Range](#Range)</code>
|
|
117
|
-
**Returns**: <code>string</code> - str
|
|
118
|
-
|
|
119
|
-
| Param | Type | Description |
|
|
120
|
-
| --- | --- | --- |
|
|
121
|
-
| [options] | <code>Object</code> | <code>number</code> | <code>function</code> | Formatting options. See lib/utils/number:format for a description of the available options. |
|
|
122
|
-
|
|
123
|
-
<a name="Range+toString"></a>
|
|
124
|
-
### range.toString() ⇒ <code>string</code>
|
|
125
|
-
Get a string representation of the range.
|
|
126
|
-
|
|
127
|
-
**Kind**: instance method of <code>[Range](#Range)</code>
|
|
128
|
-
<a name="Range+toJSON"></a>
|
|
129
|
-
### range.toJSON() ⇒ <code>Object</code>
|
|
130
|
-
Get a JSON representation of the range
|
|
131
|
-
|
|
132
|
-
**Kind**: instance method of <code>[Range](#Range)</code>
|
|
133
|
-
**Returns**: <code>Object</code> - Returns a JSON object structured as:
|
|
134
|
-
`{"mathjs": "Range", "start": 2, "end": 4, "step": 1}`
|
|
135
|
-
<a name="Range.parse"></a>
|
|
136
|
-
### Range.parse(str) ⇒ <code>[Range](#Range)</code> | <code>null</code>
|
|
137
|
-
Parse a string into a range,
|
|
138
|
-
The string contains the start, optional step, and end, separated by a colon.
|
|
139
|
-
If the string does not contain a valid range, null is returned.
|
|
140
|
-
For example str='0:2:11'.
|
|
141
|
-
|
|
142
|
-
**Kind**: static method of <code>[Range](#Range)</code>
|
|
143
|
-
**Returns**: <code>[Range](#Range)</code> | <code>null</code> - range
|
|
144
|
-
|
|
145
|
-
| Param | Type |
|
|
146
|
-
| --- | --- |
|
|
147
|
-
| str | <code>string</code> |
|
|
148
|
-
|
|
149
|
-
<a name="Range.fromJSON"></a>
|
|
150
|
-
### Range.fromJSON(json) ⇒ <code>[Range](#Range)</code>
|
|
151
|
-
Instantiate a Range from a JSON object
|
|
152
|
-
|
|
153
|
-
**Kind**: static method of <code>[Range](#Range)</code>
|
|
154
|
-
|
|
155
|
-
| Param | Type | Description |
|
|
156
|
-
| --- | --- | --- |
|
|
157
|
-
| json | <code>Object</code> | A JSON object structured as: `{"mathjs": "Range", "start": 2, "end": 4, "step": 1}` |
|
|
158
|
-
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<a name="ResultSet"></a>
|
|
2
|
-
## ResultSet
|
|
3
|
-
* [new ResultSet(entries)](#new_ResultSet_new)
|
|
4
|
-
* _instance_
|
|
5
|
-
* [.valueOf()](#ResultSet+valueOf) ⇒ <code>Array</code>
|
|
6
|
-
* [.toString()](#ResultSet+toString) ⇒ <code>string</code>
|
|
7
|
-
* [.toJSON()](#ResultSet+toJSON) ⇒ <code>Object</code>
|
|
8
|
-
* _static_
|
|
9
|
-
* [.fromJSON(json)](#ResultSet.fromJSON) ⇒ <code>[ResultSet](#ResultSet)</code>
|
|
10
|
-
|
|
11
|
-
<a name="new_ResultSet_new"></a>
|
|
12
|
-
### new ResultSet(entries)
|
|
13
|
-
A ResultSet contains a list or results
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
| Param | Type |
|
|
17
|
-
| --- | --- |
|
|
18
|
-
| entries | <code>Array</code> |
|
|
19
|
-
|
|
20
|
-
<a name="ResultSet+valueOf"></a>
|
|
21
|
-
### resultSet.valueOf() ⇒ <code>Array</code>
|
|
22
|
-
Returns the array with results hold by this ResultSet
|
|
23
|
-
|
|
24
|
-
**Kind**: instance method of <code>[ResultSet](#ResultSet)</code>
|
|
25
|
-
**Returns**: <code>Array</code> - entries
|
|
26
|
-
<a name="ResultSet+toString"></a>
|
|
27
|
-
### resultSet.toString() ⇒ <code>string</code>
|
|
28
|
-
Returns the stringified results of the ResultSet
|
|
29
|
-
|
|
30
|
-
**Kind**: instance method of <code>[ResultSet](#ResultSet)</code>
|
|
31
|
-
**Returns**: <code>string</code> - string
|
|
32
|
-
<a name="ResultSet+toJSON"></a>
|
|
33
|
-
### resultSet.toJSON() ⇒ <code>Object</code>
|
|
34
|
-
Get a JSON representation of the ResultSet
|
|
35
|
-
|
|
36
|
-
**Kind**: instance method of <code>[ResultSet](#ResultSet)</code>
|
|
37
|
-
**Returns**: <code>Object</code> - Returns a JSON object structured as:
|
|
38
|
`{"mathjs": "ResultSet", "entries": [...]}`
|
|
39
|
-
<a name="ResultSet.fromJSON"></a>
|
|
40
|
-
### ResultSet.fromJSON(json) ⇒ <code>[ResultSet](#ResultSet)</code>
|
|
41
|
-
Instantiate a ResultSet from a JSON object
|
|
42
|
-
|
|
43
|
-
**Kind**: static method of <code>[ResultSet](#ResultSet)</code>
|
|
44
|
-
|
|
45
|
-
| Param | Type | Description |
|
|
46
|
-
| --- | --- | --- |
|
|
47
|
-
| json | <code>Object</code> | A JSON object structured as: `{"mathjs": "ResultSet", "entries": [...]}` |
|
|
48
|
-
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
<a name="SparseMatrix"></a>
|
|
2
|
-
## SparseMatrix
|
|
3
|
-
Sparse Matrix implementation. This type implements a Compressed Column Storage format
|
|
4
|
-
for sparse matrices.
|
|
5
|
-
|
|
6
|
-
* _instance_
|
|
7
|
-
* [.storage()](#SparseMatrix+storage) ⇒ <code>string</code>
|
|
8
|
-
* [.datatype()](#SparseMatrix+datatype) ⇒ <code>string</code>
|
|
9
|
-
* [.create(data, [datatype])](#SparseMatrix+create)
|
|
10
|
-
* [.density()](#SparseMatrix+density) ⇒ <code>number</code>
|
|
11
|
-
* [.subset(index, [replacement], [defaultValue])](#SparseMatrix+subset)
|
|
12
|
-
* [.get(index)](#SparseMatrix+get) ⇒ <code>\*</code>
|
|
13
|
-
* [.set(index, value, [defaultValue])](#SparseMatrix+set) ⇒ <code>[SparseMatrix](#SparseMatrix)</code>
|
|
14
|
-
* [.resize(size, [defaultValue], [copy])](#SparseMatrix+resize) ⇒ <code>Matrix</code>
|
|
15
|
-
* [.clone()](#SparseMatrix+clone) ⇒ <code>[SparseMatrix](#SparseMatrix)</code>
|
|
16
|
-
* [.size()](#SparseMatrix+size) ⇒ <code>Array.<number></code>
|
|
17
|
-
* [.map(callback, [skipZeros])](#SparseMatrix+map) ⇒ <code>[SparseMatrix](#SparseMatrix)</code>
|
|
18
|
-
* [.forEach(callback, [skipZeros])](#SparseMatrix+forEach)
|
|
19
|
-
* [.toArray()](#SparseMatrix+toArray) ⇒ <code>Array</code>
|
|
20
|
-
* [.valueOf()](#SparseMatrix+valueOf) ⇒ <code>Array</code>
|
|
21
|
-
* [.format([options])](#SparseMatrix+format) ⇒ <code>string</code>
|
|
22
|
-
* [.toString()](#SparseMatrix+toString) ⇒ <code>string</code>
|
|
23
|
-
* [.toJSON()](#SparseMatrix+toJSON) ⇒ <code>Object</code>
|
|
24
|
-
* [.diagonal([k])](#SparseMatrix+diagonal) ⇒ <code>Matrix</code>
|
|
25
|
-
* [.swapRows(i, j)](#SparseMatrix+swapRows) ⇒ <code>Matrix</code>
|
|
26
|
-
* _static_
|
|
27
|
-
* [.fromJSON(json)](#SparseMatrix.fromJSON) ⇒ <code>[SparseMatrix](#SparseMatrix)</code>
|
|
28
|
-
* [.diagonal(size, value, [k], [datatype])](#SparseMatrix.diagonal) ⇒ <code>[SparseMatrix](#SparseMatrix)</code>
|
|
29
|
-
|
|
30
|
-
<a name="SparseMatrix+storage"></a>
|
|
31
|
-
### sparseMatrix.storage() ⇒ <code>string</code>
|
|
32
|
-
Get the storage format used by the matrix.
|
|
33
|
-
|
|
34
|
-
Usage:
|
|
35
|
-
```js
|
|
36
|
-
const format = matrix.storage() // retrieve storage format
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
40
|
-
**Returns**: <code>string</code> - The storage format.
|
|
41
|
-
<a name="SparseMatrix+datatype"></a>
|
|
42
|
-
### sparseMatrix.datatype() ⇒ <code>string</code>
|
|
43
|
-
Get the datatype of the data stored in the matrix.
|
|
44
|
-
|
|
45
|
-
Usage:
|
|
46
|
-
```js
|
|
47
|
-
const format = matrix.datatype() // retrieve matrix datatype
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
51
|
-
**Returns**: <code>string</code> - The datatype.
|
|
52
|
-
<a name="SparseMatrix+create"></a>
|
|
53
|
-
### sparseMatrix.create(data, [datatype])
|
|
54
|
-
Create a new SparseMatrix
|
|
55
|
-
|
|
56
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
57
|
-
|
|
58
|
-
| Param | Type |
|
|
59
|
-
| --- | --- |
|
|
60
|
-
| data | <code>Array</code> |
|
|
61
|
-
| [datatype] | <code>string</code> |
|
|
62
|
-
|
|
63
|
-
<a name="SparseMatrix+density"></a>
|
|
64
|
-
### sparseMatrix.density() ⇒ <code>number</code>
|
|
65
|
-
Get the matrix density.
|
|
66
|
-
|
|
67
|
-
Usage:
|
|
68
|
-
```js
|
|
69
|
-
const density = matrix.density() // retrieve matrix density
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
73
|
-
**Returns**: <code>number</code> - The matrix density.
|
|
74
|
-
<a name="SparseMatrix+subset"></a>
|
|
75
|
-
### sparseMatrix.subset(index, [replacement], [defaultValue])
|
|
76
|
-
Get a subset of the matrix, or replace a subset of the matrix.
|
|
77
|
-
|
|
78
|
-
Usage:
|
|
79
|
-
```js
|
|
80
|
-
const subset = matrix.subset(index) // retrieve subset
|
|
81
|
-
const value = matrix.subset(index, replacement) // replace subset
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
85
|
-
|
|
86
|
-
| Param | Type | Default | Description |
|
|
87
|
-
| --- | --- | --- | --- |
|
|
88
|
-
| index | <code>Index</code> | | |
|
|
89
|
-
| [replacement] | <code>Array</code> | <code>Maytrix</code> | <code>\*</code> | | |
|
|
90
|
-
| [defaultValue] | <code>\*</code> | <code>0</code> | Default value, filled in on new entries when the matrix is resized. If not provided, new matrix elements will be filled with zeros. |
|
|
91
|
-
|
|
92
|
-
<a name="SparseMatrix+get"></a>
|
|
93
|
-
### sparseMatrix.get(index) ⇒ <code>\*</code>
|
|
94
|
-
Get a single element from the matrix.
|
|
95
|
-
|
|
96
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
97
|
-
**Returns**: <code>\*</code> - value
|
|
98
|
-
|
|
99
|
-
| Param | Type | Description |
|
|
100
|
-
| --- | --- | --- |
|
|
101
|
-
| index | <code>Array.<number></code> | Zero-based index |
|
|
102
|
-
|
|
103
|
-
<a name="SparseMatrix+set"></a>
|
|
104
|
-
### sparseMatrix.set(index, value, [defaultValue]) ⇒ <code>[SparseMatrix](#SparseMatrix)</code>
|
|
105
|
-
Replace a single element in the matrix.
|
|
106
|
-
|
|
107
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
108
|
-
**Returns**: <code>[SparseMatrix](#SparseMatrix)</code> - self
|
|
109
|
-
|
|
110
|
-
| Param | Type | Description |
|
|
111
|
-
| --- | --- | --- |
|
|
112
|
-
| index | <code>Array.<number></code> | Zero-based index |
|
|
113
|
-
| value | <code>\*</code> | |
|
|
114
|
-
| [defaultValue] | <code>\*</code> | Default value, filled in on new entries when the matrix is resized. If not provided, new matrix elements will be set to zero. |
|
|
115
|
-
|
|
116
|
-
<a name="SparseMatrix+resize"></a>
|
|
117
|
-
### sparseMatrix.resize(size, [defaultValue], [copy]) ⇒ <code>Matrix</code>
|
|
118
|
-
Resize the matrix to the given size. Returns a copy of the matrix when
|
|
119
|
-
`copy=true`, otherwise return the matrix itself (resize in place).
|
|
120
|
-
|
|
121
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
122
|
-
**Returns**: <code>Matrix</code> - The resized matrix
|
|
123
|
-
|
|
124
|
-
| Param | Type | Default | Description |
|
|
125
|
-
| --- | --- | --- | --- |
|
|
126
|
-
| size | <code>Array.<number></code> | | The new size the matrix should have. |
|
|
127
|
-
| [defaultValue] | <code>\*</code> | <code>0</code> | Default value, filled in on new entries. If not provided, the matrix elements will be filled with zeros. |
|
|
128
|
-
| [copy] | <code>boolean</code> | | Return a resized copy of the matrix |
|
|
129
|
-
|
|
130
|
-
<a name="SparseMatrix+clone"></a>
|
|
131
|
-
### sparseMatrix.clone() ⇒ <code>[SparseMatrix](#SparseMatrix)</code>
|
|
132
|
-
Create a clone of the matrix
|
|
133
|
-
|
|
134
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
135
|
-
**Returns**: <code>[SparseMatrix](#SparseMatrix)</code> - clone
|
|
136
|
-
<a name="SparseMatrix+size"></a>
|
|
137
|
-
### sparseMatrix.size() ⇒ <code>Array.<number></code>
|
|
138
|
-
Retrieve the size of the matrix.
|
|
139
|
-
|
|
140
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
141
|
-
**Returns**: <code>Array.<number></code> - size
|
|
142
|
-
<a name="SparseMatrix+map"></a>
|
|
143
|
-
### sparseMatrix.map(callback, [skipZeros]) ⇒ <code>[SparseMatrix](#SparseMatrix)</code>
|
|
144
|
-
Create a new matrix with the results of the callback function executed on
|
|
145
|
-
each entry of the matrix.
|
|
146
|
-
|
|
147
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
148
|
-
**Returns**: <code>[SparseMatrix](#SparseMatrix)</code> - matrix
|
|
149
|
-
|
|
150
|
-
| Param | Type | Description |
|
|
151
|
-
| --- | --- | --- |
|
|
152
|
-
| callback | <code>function</code> | The callback function is invoked with three parameters: the value of the element, the index of the element, and the Matrix being traversed. |
|
|
153
|
-
| [skipZeros] | <code>boolean</code> | Invoke callback function for non-zero values only. |
|
|
154
|
-
|
|
155
|
-
<a name="SparseMatrix+forEach"></a>
|
|
156
|
-
### sparseMatrix.forEach(callback, [skipZeros])
|
|
157
|
-
Execute a callback function on each entry of the matrix.
|
|
158
|
-
|
|
159
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
160
|
-
|
|
161
|
-
| Param | Type | Description |
|
|
162
|
-
| --- | --- | --- |
|
|
163
|
-
| callback | <code>function</code> | The callback function is invoked with three parameters: the value of the element, the index of the element, and the Matrix being traversed. |
|
|
164
|
-
| [skipZeros] | <code>boolean</code> | Invoke callback function for non-zero values only. |
|
|
165
|
-
|
|
166
|
-
<a name="SparseMatrix+toArray"></a>
|
|
167
|
-
### sparseMatrix.toArray() ⇒ <code>Array</code>
|
|
168
|
-
Create an Array with a copy of the data of the SparseMatrix
|
|
169
|
-
|
|
170
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
171
|
-
**Returns**: <code>Array</code> - array
|
|
172
|
-
<a name="SparseMatrix+valueOf"></a>
|
|
173
|
-
### sparseMatrix.valueOf() ⇒ <code>Array</code>
|
|
174
|
-
Get the primitive value of the SparseMatrix: a two dimensions array
|
|
175
|
-
|
|
176
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
177
|
-
**Returns**: <code>Array</code> - array
|
|
178
|
-
<a name="SparseMatrix+format"></a>
|
|
179
|
-
### sparseMatrix.format([options]) ⇒ <code>string</code>
|
|
180
|
-
Get a string representation of the matrix, with optional formatting options.
|
|
181
|
-
|
|
182
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
183
|
-
**Returns**: <code>string</code> - str
|
|
184
|
-
|
|
185
|
-
| Param | Type | Description |
|
|
186
|
-
| --- | --- | --- |
|
|
187
|
-
| [options] | <code>Object</code> | <code>number</code> | <code>function</code> | Formatting options. See lib/utils/number:format for a description of the available options. |
|
|
188
|
-
|
|
189
|
-
<a name="SparseMatrix+toString"></a>
|
|
190
|
-
### sparseMatrix.toString() ⇒ <code>string</code>
|
|
191
|
-
Get a string representation of the matrix
|
|
192
|
-
|
|
193
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
194
|
-
**Returns**: <code>string</code> - str
|
|
195
|
-
<a name="SparseMatrix+toJSON"></a>
|
|
196
|
-
### sparseMatrix.toJSON() ⇒ <code>Object</code>
|
|
197
|
-
Get a JSON representation of the matrix
|
|
198
|
-
|
|
199
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
200
|
-
<a name="SparseMatrix+diagonal"></a>
|
|
201
|
-
### sparseMatrix.diagonal([k]) ⇒ <code>Matrix</code>
|
|
202
|
-
Get the kth Matrix diagonal.
|
|
203
|
-
|
|
204
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
205
|
-
**Returns**: <code>Matrix</code> - The matrix vector with the diagonal values.
|
|
206
|
-
|
|
207
|
-
| Param | Type | Default | Description |
|
|
208
|
-
| --- | --- | --- | --- |
|
|
209
|
-
| [k] | <code>number</code> | <code>BigNumber</code> | <code>0</code> | The kth diagonal where the vector will retrieved. |
|
|
210
|
-
|
|
211
|
-
<a name="SparseMatrix+swapRows"></a>
|
|
212
|
-
### sparseMatrix.swapRows(i, j) ⇒ <code>Matrix</code>
|
|
213
|
-
Swap rows i and j in Matrix.
|
|
214
|
-
|
|
215
|
-
**Kind**: instance method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
216
|
-
**Returns**: <code>Matrix</code> - The matrix reference
|
|
217
|
-
|
|
218
|
-
| Param | Type | Description |
|
|
219
|
-
| --- | --- | --- |
|
|
220
|
-
| i | <code>number</code> | Matrix row index 1 |
|
|
221
|
-
| j | <code>number</code> | Matrix row index 2 |
|
|
222
|
-
|
|
223
|
-
<a name="SparseMatrix.fromJSON"></a>
|
|
224
|
-
### SparseMatrix.fromJSON(json) ⇒ <code>[SparseMatrix](#SparseMatrix)</code>
|
|
225
|
-
Generate a matrix from a JSON object
|
|
226
|
-
|
|
227
|
-
**Kind**: static method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
228
|
-
|
|
229
|
-
| Param | Type | Description |
|
|
230
|
-
| --- | --- | --- |
|
|
231
|
-
| json | <code>Object</code> | An object structured like `{"mathjs": "SparseMatrix", "values": [], "index": [], "ptr": [], "size": []}`, where mathjs is optional |
|
|
232
|
-
|
|
233
|
-
<a name="SparseMatrix.diagonal"></a>
|
|
234
|
-
### SparseMatrix.diagonal(size, value, [k], [datatype]) ⇒ <code>[SparseMatrix](#SparseMatrix)</code>
|
|
235
|
-
Create a diagonal matrix.
|
|
236
|
-
|
|
237
|
-
**Kind**: static method of <code>[SparseMatrix](#SparseMatrix)</code>
|
|
238
|
-
|
|
239
|
-
| Param | Type | Default | Description |
|
|
240
|
-
| --- | --- | --- | --- |
|
|
241
|
-
| size | <code>Array</code> | | The matrix size. |
|
|
242
|
-
| value | <code>number</code> | <code>Array</code> | <code>Matrix</code> | | The values for the diagonal. |
|
|
243
|
-
| [k] | <code>number</code> | <code>BigNumber</code> | <code>0</code> | The kth diagonal where the vector will be filled in. |
|
|
244
|
-
| [datatype] | <code>string</code> | | The Matrix datatype, values must be of this datatype. |
|
|
245
|
-
|