data-structure-typed 2.5.2 → 2.6.0
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/.husky/pre-commit +3 -0
- package/CHANGELOG.md +3 -1
- package/MIGRATION.md +217 -0
- package/README.md +80 -8
- package/README_CN.md +569 -143
- package/SPECIFICATION.md +44 -14
- package/SPECIFICATION.zh-CN.md +44 -14
- package/dist/cjs/binary-tree.cjs +5841 -1678
- package/dist/cjs/graph.cjs +422 -14
- package/dist/cjs/hash.cjs +95 -7
- package/dist/cjs/heap.cjs +174 -16
- package/dist/cjs/index.cjs +7751 -2449
- package/dist/cjs/linked-list.cjs +443 -2
- package/dist/cjs/matrix.cjs +56 -0
- package/dist/cjs/priority-queue.cjs +172 -14
- package/dist/cjs/queue.cjs +435 -0
- package/dist/cjs/stack.cjs +103 -4
- package/dist/cjs/trie.cjs +106 -0
- package/dist/cjs-legacy/binary-tree.cjs +5933 -1772
- package/dist/cjs-legacy/graph.cjs +422 -14
- package/dist/cjs-legacy/hash.cjs +95 -7
- package/dist/cjs-legacy/heap.cjs +174 -16
- package/dist/cjs-legacy/index.cjs +8154 -2854
- package/dist/cjs-legacy/linked-list.cjs +443 -2
- package/dist/cjs-legacy/matrix.cjs +56 -0
- package/dist/cjs-legacy/priority-queue.cjs +172 -14
- package/dist/cjs-legacy/queue.cjs +435 -0
- package/dist/cjs-legacy/stack.cjs +103 -4
- package/dist/cjs-legacy/trie.cjs +106 -0
- package/dist/esm/binary-tree.mjs +5841 -1678
- package/dist/esm/graph.mjs +422 -14
- package/dist/esm/hash.mjs +95 -7
- package/dist/esm/heap.mjs +174 -16
- package/dist/esm/index.mjs +7751 -2449
- package/dist/esm/linked-list.mjs +443 -2
- package/dist/esm/matrix.mjs +56 -0
- package/dist/esm/priority-queue.mjs +172 -14
- package/dist/esm/queue.mjs +435 -0
- package/dist/esm/stack.mjs +103 -4
- package/dist/esm/trie.mjs +106 -0
- package/dist/esm-legacy/binary-tree.mjs +5933 -1772
- package/dist/esm-legacy/graph.mjs +422 -14
- package/dist/esm-legacy/hash.mjs +95 -7
- package/dist/esm-legacy/heap.mjs +174 -16
- package/dist/esm-legacy/index.mjs +8154 -2854
- package/dist/esm-legacy/linked-list.mjs +443 -2
- package/dist/esm-legacy/matrix.mjs +56 -0
- package/dist/esm-legacy/priority-queue.mjs +172 -14
- package/dist/esm-legacy/queue.mjs +435 -0
- package/dist/esm-legacy/stack.mjs +103 -4
- package/dist/esm-legacy/trie.mjs +106 -0
- package/dist/types/data-structures/base/iterable-element-base.d.ts +17 -0
- package/dist/types/data-structures/base/linear-base.d.ts +6 -0
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +86 -2
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +98 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +191 -15
- package/dist/types/data-structures/binary-tree/bst.d.ts +171 -3
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +136 -8
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +42 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +1061 -167
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1232 -355
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +916 -194
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +1078 -141
- package/dist/types/data-structures/graph/directed-graph.d.ts +70 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +63 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +84 -6
- package/dist/types/data-structures/heap/heap.d.ts +140 -12
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +150 -2
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +106 -1
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +126 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +56 -0
- package/dist/types/data-structures/queue/deque.d.ts +171 -0
- package/dist/types/data-structures/queue/queue.d.ts +97 -0
- package/dist/types/data-structures/stack/stack.d.ts +72 -2
- package/dist/types/data-structures/trie/trie.d.ts +84 -0
- package/dist/types/interfaces/binary-tree.d.ts +2 -3
- package/dist/umd/data-structure-typed.js +7784 -2484
- package/dist/umd/data-structure-typed.min.js +4 -4
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +188 -200
- package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +11 -11
- package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +62 -62
- package/docs-site-docusaurus/docs/api/classes/BST.md +183 -195
- package/docs-site-docusaurus/docs/api/classes/BSTNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +15 -15
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +143 -155
- package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/Deque.md +99 -85
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +73 -73
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +100 -70
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +12 -12
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
- package/docs-site-docusaurus/docs/api/classes/HashMap.md +38 -38
- package/docs-site-docusaurus/docs/api/classes/Heap.md +96 -85
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +25 -25
- package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +48 -48
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +52 -52
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +46 -42
- package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +74 -74
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +73 -73
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +31 -31
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/Navigator.md +5 -5
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +103 -88
- package/docs-site-docusaurus/docs/api/classes/Queue.md +111 -59
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +200 -212
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -10
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +75 -75
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +37 -37
- package/docs-site-docusaurus/docs/api/classes/Stack.md +42 -42
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +107 -36
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +43 -43
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +106 -35
- package/docs-site-docusaurus/docs/api/classes/Trie.md +43 -43
- package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +72 -72
- package/docs-site-docusaurus/docs/guide/architecture.md +75 -7
- package/docs-site-docusaurus/docs/guide/concepts.md +53 -34
- package/docs-site-docusaurus/docs/guide/faq.md +53 -0
- package/docs-site-docusaurus/docs/guide/guides.md +8 -9
- package/docs-site-docusaurus/docs/guide/integrations.md +74 -177
- package/docs-site-docusaurus/docs/guide/overview.md +131 -17
- package/docs-site-docusaurus/src/pages/index.tsx +4 -0
- package/docs-site-docusaurus/typedoc.json +1 -0
- package/jest.integration.config.js +1 -2
- package/package.json +10 -7
- package/src/data-structures/base/iterable-element-base.ts +32 -0
- package/src/data-structures/base/linear-base.ts +11 -0
- package/src/data-structures/binary-tree/avl-tree.ts +88 -5
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +98 -0
- package/src/data-structures/binary-tree/binary-tree.ts +242 -81
- package/src/data-structures/binary-tree/bst.ts +173 -7
- package/src/data-structures/binary-tree/red-black-tree.ts +139 -15
- package/src/data-structures/binary-tree/segment-tree.ts +42 -0
- package/src/data-structures/binary-tree/tree-map.ts +948 -36
- package/src/data-structures/binary-tree/tree-multi-map.ts +893 -13
- package/src/data-structures/binary-tree/tree-multi-set.ts +761 -33
- package/src/data-structures/binary-tree/tree-set.ts +1260 -251
- package/src/data-structures/graph/directed-graph.ts +71 -1
- package/src/data-structures/graph/undirected-graph.ts +64 -1
- package/src/data-structures/hash/hash-map.ts +100 -12
- package/src/data-structures/heap/heap.ts +149 -19
- package/src/data-structures/linked-list/doubly-linked-list.ts +178 -2
- package/src/data-structures/linked-list/singly-linked-list.ts +106 -1
- package/src/data-structures/linked-list/skip-linked-list.ts +126 -0
- package/src/data-structures/matrix/matrix.ts +56 -0
- package/src/data-structures/queue/deque.ts +187 -0
- package/src/data-structures/queue/queue.ts +109 -0
- package/src/data-structures/stack/stack.ts +75 -5
- package/src/data-structures/trie/trie.ts +84 -0
- package/src/interfaces/binary-tree.ts +1 -9
- package/.vitepress/cache/deps_temp_51f5f1b0/chunk-7OIKW5WK.js +0 -12984
- package/.vitepress/cache/deps_temp_51f5f1b0/package.json +0 -3
- package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vue_devtools-api.js +0 -4505
- package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vueuse_core.js +0 -9731
- package/.vitepress/cache/deps_temp_51f5f1b0/vue.js +0 -347
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: Matrix
|
|
8
8
|
|
|
9
|
-
Defined in: [data-structures/matrix/matrix.ts:97](https://github.com/zrwusa/data-structure-typed/blob/
|
|
9
|
+
Defined in: [data-structures/matrix/matrix.ts:97](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L97)
|
|
10
10
|
|
|
11
11
|
Matrix — a numeric matrix with standard linear algebra operations.
|
|
12
12
|
|
|
@@ -107,7 +107,7 @@ Matrix — a numeric matrix with standard linear algebra operations.
|
|
|
107
107
|
new Matrix(data, options?): Matrix;
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
Defined in: [data-structures/matrix/matrix.ts:105](https://github.com/zrwusa/data-structure-typed/blob/
|
|
110
|
+
Defined in: [data-structures/matrix/matrix.ts:105](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L105)
|
|
111
111
|
|
|
112
112
|
The constructor function initializes a matrix object with the provided data and options, or with
|
|
113
113
|
default values if no options are provided.
|
|
@@ -141,7 +141,7 @@ properties:
|
|
|
141
141
|
get addFn(): (a, b) => number | undefined;
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
Defined in: [data-structures/matrix/matrix.ts:164](https://github.com/zrwusa/data-structure-typed/blob/
|
|
144
|
+
Defined in: [data-structures/matrix/matrix.ts:164](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L164)
|
|
145
145
|
|
|
146
146
|
The above function returns the value of the _addFn property.
|
|
147
147
|
|
|
@@ -161,7 +161,7 @@ The value of the property `_addFn` is being returned.
|
|
|
161
161
|
get cols(): number;
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
Defined in: [data-structures/matrix/matrix.ts:146](https://github.com/zrwusa/data-structure-typed/blob/
|
|
164
|
+
Defined in: [data-structures/matrix/matrix.ts:146](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L146)
|
|
165
165
|
|
|
166
166
|
The function returns the value of the protected variable _cols.
|
|
167
167
|
|
|
@@ -181,7 +181,7 @@ The number of columns.
|
|
|
181
181
|
get data(): number[][];
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
Defined in: [data-structures/matrix/matrix.ts:156](https://github.com/zrwusa/data-structure-typed/blob/
|
|
184
|
+
Defined in: [data-structures/matrix/matrix.ts:156](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L156)
|
|
185
185
|
|
|
186
186
|
The function returns a two-dimensional array of numbers.
|
|
187
187
|
|
|
@@ -201,7 +201,7 @@ The data property, which is a two-dimensional array of numbers.
|
|
|
201
201
|
get multiplyFn(): (a, b) => number;
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
-
Defined in: [data-structures/matrix/matrix.ts:180](https://github.com/zrwusa/data-structure-typed/blob/
|
|
204
|
+
Defined in: [data-structures/matrix/matrix.ts:180](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L180)
|
|
205
205
|
|
|
206
206
|
The function returns the value of the _multiplyFn property.
|
|
207
207
|
|
|
@@ -221,7 +221,7 @@ The `_multiplyFn` property is being returned.
|
|
|
221
221
|
get rows(): number;
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
-
Defined in: [data-structures/matrix/matrix.ts:136](https://github.com/zrwusa/data-structure-typed/blob/
|
|
224
|
+
Defined in: [data-structures/matrix/matrix.ts:136](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L136)
|
|
225
225
|
|
|
226
226
|
The function returns the number of rows.
|
|
227
227
|
|
|
@@ -241,7 +241,7 @@ The number of rows.
|
|
|
241
241
|
get size(): [number, number];
|
|
242
242
|
```
|
|
243
243
|
|
|
244
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
244
|
+
Defined in: [data-structures/matrix/matrix.ts:936](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L936)
|
|
245
245
|
|
|
246
246
|
Returns [rows, cols] dimensions tuple.
|
|
247
247
|
|
|
@@ -259,7 +259,7 @@ Returns [rows, cols] dimensions tuple.
|
|
|
259
259
|
get subtractFn(): (a, b) => number;
|
|
260
260
|
```
|
|
261
261
|
|
|
262
|
-
Defined in: [data-structures/matrix/matrix.ts:172](https://github.com/zrwusa/data-structure-typed/blob/
|
|
262
|
+
Defined in: [data-structures/matrix/matrix.ts:172](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L172)
|
|
263
263
|
|
|
264
264
|
The function returns the value of the _subtractFn property.
|
|
265
265
|
|
|
@@ -277,7 +277,7 @@ The `_subtractFn` property is being returned.
|
|
|
277
277
|
iterator: IterableIterator<number[]>;
|
|
278
278
|
```
|
|
279
279
|
|
|
280
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
280
|
+
Defined in: [data-structures/matrix/matrix.ts:965](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L965)
|
|
281
281
|
|
|
282
282
|
Iterates over rows.
|
|
283
283
|
|
|
@@ -293,7 +293,7 @@ Iterates over rows.
|
|
|
293
293
|
add(matrix): Matrix | undefined;
|
|
294
294
|
```
|
|
295
295
|
|
|
296
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
296
|
+
Defined in: [data-structures/matrix/matrix.ts:397](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L397)
|
|
297
297
|
|
|
298
298
|
The `add` function adds two matrices together, returning a new matrix with the result.
|
|
299
299
|
|
|
@@ -348,7 +348,7 @@ current matrix with the provided `matrix` parameter.
|
|
|
348
348
|
clone(): Matrix;
|
|
349
349
|
```
|
|
350
350
|
|
|
351
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
351
|
+
Defined in: [data-structures/matrix/matrix.ts:918](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L918)
|
|
352
352
|
|
|
353
353
|
The `clone` function returns a new instance of the Matrix class with the same data and properties
|
|
354
354
|
as the original instance.
|
|
@@ -368,7 +368,7 @@ and properties as the current instance.
|
|
|
368
368
|
dot(matrix): Matrix | undefined;
|
|
369
369
|
```
|
|
370
370
|
|
|
371
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
371
|
+
Defined in: [data-structures/matrix/matrix.ts:867](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L867)
|
|
372
372
|
|
|
373
373
|
The dot function calculates the dot product of two matrices and returns a new matrix.
|
|
374
374
|
|
|
@@ -406,7 +406,7 @@ a new Matrix object.
|
|
|
406
406
|
flatten(): number[];
|
|
407
407
|
```
|
|
408
408
|
|
|
409
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
409
|
+
Defined in: [data-structures/matrix/matrix.ts:954](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L954)
|
|
410
410
|
|
|
411
411
|
Returns a flat row-major array.
|
|
412
412
|
|
|
@@ -422,7 +422,7 @@ Returns a flat row-major array.
|
|
|
422
422
|
forEach(callback): void;
|
|
423
423
|
```
|
|
424
424
|
|
|
425
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
425
|
+
Defined in: [data-structures/matrix/matrix.ts:984](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L984)
|
|
426
426
|
|
|
427
427
|
Visits each element with its row and column index.
|
|
428
428
|
|
|
@@ -444,7 +444,7 @@ Visits each element with its row and column index.
|
|
|
444
444
|
get(row, col): number | undefined;
|
|
445
445
|
```
|
|
446
446
|
|
|
447
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
447
|
+
Defined in: [data-structures/matrix/matrix.ts:248](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L248)
|
|
448
448
|
|
|
449
449
|
The `get` function returns the value at the specified row and column index if it is a valid index.
|
|
450
450
|
|
|
@@ -501,7 +501,7 @@ Otherwise, it returns `undefined`.
|
|
|
501
501
|
inverse(): Matrix | undefined;
|
|
502
502
|
```
|
|
503
503
|
|
|
504
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
504
|
+
Defined in: [data-structures/matrix/matrix.ts:742](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L742)
|
|
505
505
|
|
|
506
506
|
The `inverse` function calculates the inverse of a square matrix using Gaussian elimination.
|
|
507
507
|
|
|
@@ -536,7 +536,7 @@ a Matrix object, which represents the inverse of the original matrix.
|
|
|
536
536
|
isMatchForCalculate(matrix): boolean;
|
|
537
537
|
```
|
|
538
538
|
|
|
539
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
539
|
+
Defined in: [data-structures/matrix/matrix.ts:326](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L326)
|
|
540
540
|
|
|
541
541
|
The function checks if the dimensions of the given matrix match the dimensions of the current
|
|
542
542
|
matrix.
|
|
@@ -563,7 +563,7 @@ a boolean value.
|
|
|
563
563
|
isValidIndex(row, col): boolean;
|
|
564
564
|
```
|
|
565
565
|
|
|
566
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
566
|
+
Defined in: [data-structures/matrix/matrix.ts:908](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L908)
|
|
567
567
|
|
|
568
568
|
The function checks if a given row and column index is valid within a specified range.
|
|
569
569
|
|
|
@@ -597,7 +597,7 @@ A boolean value is being returned.
|
|
|
597
597
|
map(callback): Matrix;
|
|
598
598
|
```
|
|
599
599
|
|
|
600
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
600
|
+
Defined in: [data-structures/matrix/matrix.ts:995](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L995)
|
|
601
601
|
|
|
602
602
|
Maps each element (number → number) and returns a new Matrix.
|
|
603
603
|
|
|
@@ -619,7 +619,7 @@ Maps each element (number → number) and returns a new Matrix.
|
|
|
619
619
|
multiply(matrix): Matrix | undefined;
|
|
620
620
|
```
|
|
621
621
|
|
|
622
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
622
|
+
Defined in: [data-structures/matrix/matrix.ts:568](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L568)
|
|
623
623
|
|
|
624
624
|
The `multiply` function performs matrix multiplication between two matrices and returns the result
|
|
625
625
|
as a new matrix.
|
|
@@ -677,7 +677,7 @@ set(
|
|
|
677
677
|
value): boolean;
|
|
678
678
|
```
|
|
679
679
|
|
|
680
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
680
|
+
Defined in: [data-structures/matrix/matrix.ts:312](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L312)
|
|
681
681
|
|
|
682
682
|
The set function updates the value at a specified row and column in a two-dimensional array.
|
|
683
683
|
|
|
@@ -733,7 +733,7 @@ set.
|
|
|
733
733
|
subtract(matrix): Matrix | undefined;
|
|
734
734
|
```
|
|
735
735
|
|
|
736
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
736
|
+
Defined in: [data-structures/matrix/matrix.ts:475](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L475)
|
|
737
737
|
|
|
738
738
|
The `subtract` function performs element-wise subtraction between two matrices and returns a new
|
|
739
739
|
matrix with the result.
|
|
@@ -773,7 +773,7 @@ a new Matrix object with the result of the subtraction operation.
|
|
|
773
773
|
toArray(): number[][];
|
|
774
774
|
```
|
|
775
775
|
|
|
776
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
776
|
+
Defined in: [data-structures/matrix/matrix.ts:947](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L947)
|
|
777
777
|
|
|
778
778
|
Returns a deep copy of the data as a plain 2D array.
|
|
779
779
|
|
|
@@ -789,7 +789,7 @@ Returns a deep copy of the data as a plain 2D array.
|
|
|
789
789
|
transpose(): Matrix;
|
|
790
790
|
```
|
|
791
791
|
|
|
792
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
792
|
+
Defined in: [data-structures/matrix/matrix.ts:664](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L664)
|
|
793
793
|
|
|
794
794
|
The transpose function takes a matrix and returns a new matrix that is the transpose of the
|
|
795
795
|
original matrix.
|
|
@@ -833,7 +833,7 @@ The transpose() function returns a new Matrix object with the transposed data.
|
|
|
833
833
|
static from(data): Matrix;
|
|
834
834
|
```
|
|
835
835
|
|
|
836
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
836
|
+
Defined in: [data-structures/matrix/matrix.ts:1054](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1054)
|
|
837
837
|
|
|
838
838
|
Creates a Matrix from a plain 2D array (deep copy).
|
|
839
839
|
|
|
@@ -862,7 +862,7 @@ m.get(0, 1); // 2
|
|
|
862
862
|
static identity(n): Matrix;
|
|
863
863
|
```
|
|
864
864
|
|
|
865
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
865
|
+
Defined in: [data-structures/matrix/matrix.ts:1039](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1039)
|
|
866
866
|
|
|
867
867
|
Creates an n×n identity matrix.
|
|
868
868
|
|
|
@@ -890,7 +890,7 @@ const I = Matrix.identity(3); // [[1,0,0],[0,1,0],[0,0,1]]
|
|
|
890
890
|
static zeros(rows, cols): Matrix;
|
|
891
891
|
```
|
|
892
892
|
|
|
893
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
893
|
+
Defined in: [data-structures/matrix/matrix.ts:1027](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1027)
|
|
894
894
|
|
|
895
895
|
Creates a rows×cols zero matrix.
|
|
896
896
|
|
|
@@ -928,7 +928,7 @@ protected _addScaledRow(
|
|
|
928
928
|
scalar): void;
|
|
929
929
|
```
|
|
930
930
|
|
|
931
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
931
|
+
Defined in: [data-structures/matrix/matrix.ts:1108](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1108)
|
|
932
932
|
|
|
933
933
|
The function `_addScaledRow` multiplies a row in a matrix by a scalar value and adds it to another
|
|
934
934
|
row.
|
|
@@ -968,7 +968,7 @@ source row before adding them to the target row.
|
|
|
968
968
|
protected _scaleRow(row, scalar): void;
|
|
969
969
|
```
|
|
970
970
|
|
|
971
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
971
|
+
Defined in: [data-structures/matrix/matrix.ts:1090](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1090)
|
|
972
972
|
|
|
973
973
|
The function scales a specific row in a matrix by a given scalar value.
|
|
974
974
|
|
|
@@ -1000,7 +1000,7 @@ a specific row of a matrix.
|
|
|
1000
1000
|
protected _swapRows(row1, row2): void;
|
|
1001
1001
|
```
|
|
1002
1002
|
|
|
1003
|
-
Defined in: [data-structures/matrix/matrix.ts:
|
|
1003
|
+
Defined in: [data-structures/matrix/matrix.ts:1077](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1077)
|
|
1004
1004
|
|
|
1005
1005
|
The function `_swapRows` swaps the positions of two rows in an array.
|
|
1006
1006
|
|