data-structure-typed 2.6.0 → 2.6.1

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.
Files changed (80) hide show
  1. package/.github/workflows/ci.yml +7 -2
  2. package/.github/workflows/release-package.yml +9 -2
  3. package/docs-site-docusaurus/docs/api/classes/AVLTree.md +108 -108
  4. package/docs-site-docusaurus/docs/api/classes/BST.md +101 -101
  5. package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -13
  6. package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +66 -66
  7. package/docs-site-docusaurus/docs/api/classes/Deque.md +235 -51
  8. package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +21 -21
  9. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +231 -67
  10. package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
  11. package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
  12. package/docs-site-docusaurus/docs/api/classes/HashMap.md +14 -14
  13. package/docs-site-docusaurus/docs/api/classes/Heap.md +117 -34
  14. package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +83 -13
  15. package/docs-site-docusaurus/docs/api/classes/LinearBase.md +124 -20
  16. package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +140 -32
  17. package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +23 -23
  18. package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +159 -51
  19. package/docs-site-docusaurus/docs/api/classes/MapGraph.md +20 -20
  20. package/docs-site-docusaurus/docs/api/classes/Matrix.md +23 -23
  21. package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -34
  22. package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +117 -34
  23. package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -34
  24. package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +117 -34
  25. package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +117 -34
  26. package/docs-site-docusaurus/docs/api/classes/Queue.md +142 -34
  27. package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +117 -117
  28. package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +8 -8
  29. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +158 -50
  30. package/docs-site-docusaurus/docs/api/classes/SkipList.md +21 -21
  31. package/docs-site-docusaurus/docs/api/classes/Stack.md +108 -26
  32. package/docs-site-docusaurus/docs/api/classes/TreeMap.md +33 -33
  33. package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +75 -39
  34. package/docs-site-docusaurus/docs/api/classes/TreeSet.md +301 -39
  35. package/docs-site-docusaurus/docs/api/classes/Trie.md +110 -28
  36. package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +20 -20
  37. package/package.json +45 -46
  38. package/src/common/error.ts +15 -32
  39. package/src/common/index.ts +0 -3
  40. package/src/data-structures/base/iterable-element-base.ts +0 -3
  41. package/src/data-structures/base/linear-base.ts +2 -36
  42. package/src/data-structures/binary-tree/avl-tree.ts +31 -529
  43. package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -572
  44. package/src/data-structures/binary-tree/binary-tree.ts +326 -1311
  45. package/src/data-structures/binary-tree/bst.ts +158 -1082
  46. package/src/data-structures/binary-tree/red-black-tree.ts +451 -1290
  47. package/src/data-structures/binary-tree/segment-tree.ts +73 -351
  48. package/src/data-structures/binary-tree/tree-map.ts +462 -5124
  49. package/src/data-structures/binary-tree/tree-multi-map.ts +302 -4914
  50. package/src/data-structures/binary-tree/tree-multi-set.ts +284 -3972
  51. package/src/data-structures/binary-tree/tree-set.ts +338 -4836
  52. package/src/data-structures/graph/abstract-graph.ts +98 -167
  53. package/src/data-structures/graph/directed-graph.ts +137 -562
  54. package/src/data-structures/graph/map-graph.ts +0 -3
  55. package/src/data-structures/graph/undirected-graph.ts +132 -511
  56. package/src/data-structures/hash/hash-map.ts +154 -582
  57. package/src/data-structures/heap/heap.ts +200 -795
  58. package/src/data-structures/linked-list/doubly-linked-list.ts +121 -865
  59. package/src/data-structures/linked-list/singly-linked-list.ts +122 -794
  60. package/src/data-structures/linked-list/skip-linked-list.ts +211 -918
  61. package/src/data-structures/matrix/matrix.ts +179 -518
  62. package/src/data-structures/matrix/navigator.ts +0 -1
  63. package/src/data-structures/priority-queue/max-priority-queue.ts +1 -6
  64. package/src/data-structures/priority-queue/min-priority-queue.ts +6 -11
  65. package/src/data-structures/priority-queue/priority-queue.ts +1 -2
  66. package/src/data-structures/queue/deque.ts +214 -882
  67. package/src/data-structures/queue/queue.ts +102 -625
  68. package/src/data-structures/stack/stack.ts +76 -505
  69. package/src/data-structures/trie/trie.ts +98 -628
  70. package/src/types/common.ts +0 -10
  71. package/src/types/data-structures/binary-tree/bst.ts +0 -7
  72. package/src/types/data-structures/binary-tree/red-black-tree.ts +0 -1
  73. package/src/types/data-structures/graph/abstract-graph.ts +0 -2
  74. package/src/types/data-structures/hash/hash-map.ts +0 -3
  75. package/src/types/data-structures/hash/index.ts +0 -1
  76. package/src/types/data-structures/matrix/navigator.ts +0 -2
  77. package/src/types/utils/utils.ts +0 -7
  78. package/src/types/utils/validate-type.ts +0 -7
  79. package/src/utils/number.ts +0 -2
  80. package/src/utils/utils.ts +0 -5
@@ -461,7 +461,7 @@ Time O(V * E), Space O(V + E)
461
461
  clear(): void;
462
462
  ```
463
463
 
464
- Defined in: [data-structures/graph/directed-graph.ts:944](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L944)
464
+ Defined in: [data-structures/graph/directed-graph.ts:968](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L968)
465
465
 
466
466
  Remove all vertices and edges.
467
467
 
@@ -623,7 +623,7 @@ Time O(1), Space O(1)
623
623
  degreeOf(vertexOrKey): number;
624
624
  ```
625
625
 
626
- Defined in: [data-structures/graph/directed-graph.ts:626](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L626)
626
+ Defined in: [data-structures/graph/directed-graph.ts:641](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L641)
627
627
 
628
628
  Degree (in + out) of a vertex.
629
629
 
@@ -657,7 +657,7 @@ Time O(1) avg, Space O(1)
657
657
  deleteEdge(edgeOrSrcVertexKey, destVertexKey?): EO | undefined;
658
658
  ```
659
659
 
660
- Defined in: [data-structures/graph/directed-graph.ts:381](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L381)
660
+ Defined in: [data-structures/graph/directed-graph.ts:387](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L387)
661
661
 
662
662
  Delete an edge by instance or by `(srcKey, destKey)`.
663
663
 
@@ -728,7 +728,7 @@ Time O(1) avg, Space O(1)
728
728
  deleteEdgeSrcToDest(srcOrKey, destOrKey): EO | undefined;
729
729
  ```
730
730
 
731
- Defined in: [data-structures/graph/directed-graph.ts:290](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L290)
731
+ Defined in: [data-structures/graph/directed-graph.ts:293](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L293)
732
732
 
733
733
  Delete edge `src -> dest` if present.
734
734
 
@@ -768,7 +768,7 @@ Time O(1) avg, Space O(1)
768
768
  deleteVertex(vertexOrKey): boolean;
769
769
  ```
770
770
 
771
- Defined in: [data-structures/graph/directed-graph.ts:459](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L459)
771
+ Defined in: [data-structures/graph/directed-graph.ts:468](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L468)
772
772
 
773
773
  Remove a vertex
774
774
 
@@ -865,7 +865,7 @@ Time O(V^2 + E), Space O(V + E)
865
865
  edgeSet(): EO[];
866
866
  ```
867
867
 
868
- Defined in: [data-structures/graph/directed-graph.ts:839](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L839)
868
+ Defined in: [data-structures/graph/directed-graph.ts:860](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L860)
869
869
 
870
870
  Get all edges
871
871
 
@@ -898,7 +898,7 @@ Get all edges
898
898
  edgesOf(vertexOrKey): EO[];
899
899
  ```
900
900
 
901
- Defined in: [data-structures/graph/directed-graph.ts:656](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L656)
901
+ Defined in: [data-structures/graph/directed-graph.ts:671](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L671)
902
902
 
903
903
  All incident edges of a vertex.
904
904
 
@@ -1306,7 +1306,7 @@ Time exponential in worst-case, Space O(V + E)
1306
1306
  getDestinations(vertex): VO[];
1307
1307
  ```
1308
1308
 
1309
- Defined in: [data-structures/graph/directed-graph.ts:674](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L674)
1309
+ Defined in: [data-structures/graph/directed-graph.ts:689](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L689)
1310
1310
 
1311
1311
  Direct children reachable by one outgoing edge.
1312
1312
 
@@ -1340,7 +1340,7 @@ Time O(deg_out), Space O(deg_out)
1340
1340
  getDFNMap(): Map<VO, number>;
1341
1341
  ```
1342
1342
 
1343
- Defined in: [data-structures/graph/directed-graph.ts:1069](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1069)
1343
+ Defined in: [data-structures/graph/directed-graph.ts:1096](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1096)
1344
1344
 
1345
1345
  DFN index map computed by `tarjan()`.
1346
1346
 
@@ -1366,7 +1366,7 @@ Time O(V), Space O(V)
1366
1366
  getEdge(srcOrKey, destOrKey): EO | undefined;
1367
1367
  ```
1368
1368
 
1369
- Defined in: [data-structures/graph/directed-graph.ts:265](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L265)
1369
+ Defined in: [data-structures/graph/directed-graph.ts:268](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L268)
1370
1370
 
1371
1371
  Get the unique edge from `src` to `dest`, if present.
1372
1372
 
@@ -1420,7 +1420,7 @@ Time O(1) avg, Space O(1)
1420
1420
  getEndsOfEdge(edge): [VO, VO] | undefined;
1421
1421
  ```
1422
1422
 
1423
- Defined in: [data-structures/graph/directed-graph.ts:919](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L919)
1423
+ Defined in: [data-structures/graph/directed-graph.ts:943](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L943)
1424
1424
 
1425
1425
  Resolve an edge's `[src, dest]` endpoints to vertex instances.
1426
1426
 
@@ -1454,7 +1454,7 @@ Time O(1), Space O(1)
1454
1454
  getLowMap(): Map<VO, number>;
1455
1455
  ```
1456
1456
 
1457
- Defined in: [data-structures/graph/directed-graph.ts:1078](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1078)
1457
+ Defined in: [data-structures/graph/directed-graph.ts:1105](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1105)
1458
1458
 
1459
1459
  LOW link map computed by `tarjan()`.
1460
1460
 
@@ -1585,7 +1585,7 @@ Time O((V + E) log V) weighted / O(V + E) unweighted, Space O(V + E)
1585
1585
  getNeighbors(vertexOrKey): VO[];
1586
1586
  ```
1587
1587
 
1588
- Defined in: [data-structures/graph/directed-graph.ts:897](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L897)
1588
+ Defined in: [data-structures/graph/directed-graph.ts:921](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L921)
1589
1589
 
1590
1590
  Get outgoing neighbors
1591
1591
 
@@ -1661,7 +1661,7 @@ Time O(L), Space O(1) where L is path length
1661
1661
  getSCCs(): Map<number, VO[]>;
1662
1662
  ```
1663
1663
 
1664
- Defined in: [data-structures/graph/directed-graph.ts:1134](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1134)
1664
+ Defined in: [data-structures/graph/directed-graph.ts:1164](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1164)
1665
1665
 
1666
1666
  Strongly connected components computed by `tarjan()`.
1667
1667
 
@@ -1880,7 +1880,7 @@ Time O(1) avg, Space O(1)
1880
1880
  incomingEdgesOf(vertexOrKey): EO[];
1881
1881
  ```
1882
1882
 
1883
- Defined in: [data-structures/graph/directed-graph.ts:553](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L553)
1883
+ Defined in: [data-structures/graph/directed-graph.ts:565](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L565)
1884
1884
 
1885
1885
  Incoming edges of a vertex.
1886
1886
 
@@ -1929,7 +1929,7 @@ Time O(deg_in), Space O(deg_in)
1929
1929
  isEmpty(): boolean;
1930
1930
  ```
1931
1931
 
1932
- Defined in: [data-structures/graph/directed-graph.ts:936](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L936)
1932
+ Defined in: [data-structures/graph/directed-graph.ts:960](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L960)
1933
1933
 
1934
1934
  Whether the graph has no vertices and no edges.
1935
1935
 
@@ -2053,7 +2053,7 @@ Time O(n), Space O(n)
2053
2053
  outgoingEdgesOf(vertexOrKey): EO[];
2054
2054
  ```
2055
2055
 
2056
- Defined in: [data-structures/graph/directed-graph.ts:612](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L612)
2056
+ Defined in: [data-structures/graph/directed-graph.ts:627](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L627)
2057
2057
 
2058
2058
  Outgoing edges of a vertex.
2059
2059
 
@@ -2301,7 +2301,7 @@ Time O(n), Space O(1)
2301
2301
  tarjan(): object;
2302
2302
  ```
2303
2303
 
2304
- Defined in: [data-structures/graph/directed-graph.ts:1013](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1013)
2304
+ Defined in: [data-structures/graph/directed-graph.ts:1040](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1040)
2305
2305
 
2306
2306
  Tarjan's algorithm for strongly connected components.
2307
2307
 
@@ -2430,7 +2430,7 @@ DOT format string.
2430
2430
  topologicalSort(propertyName?): (VertexKey | VO)[] | undefined;
2431
2431
  ```
2432
2432
 
2433
- Defined in: [data-structures/graph/directed-graph.ts:756](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L756)
2433
+ Defined in: [data-structures/graph/directed-graph.ts:774](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L774)
2434
2434
 
2435
2435
  Topological sort if DAG; returns `undefined` if a cycle exists.
2436
2436
 
@@ -2672,7 +2672,7 @@ Override in subclasses (e.g., '--' for undirected, '->' for directed).
2672
2672
  protected _addEdge(edge): boolean;
2673
2673
  ```
2674
2674
 
2675
- Defined in: [data-structures/graph/directed-graph.ts:1144](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1144)
2675
+ Defined in: [data-structures/graph/directed-graph.ts:1174](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1174)
2676
2676
 
2677
2677
  Internal hook to attach a directed edge into adjacency maps.
2678
2678
 
@@ -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:936](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L936)
244
+ Defined in: [data-structures/matrix/matrix.ts:960](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L960)
245
245
 
246
246
  Returns [rows, cols] dimensions tuple.
247
247
 
@@ -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:965](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L965)
280
+ Defined in: [data-structures/matrix/matrix.ts:989](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L989)
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:397](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L397)
296
+ Defined in: [data-structures/matrix/matrix.ts:406](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L406)
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:918](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L918)
351
+ Defined in: [data-structures/matrix/matrix.ts:942](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L942)
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:867](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L867)
371
+ Defined in: [data-structures/matrix/matrix.ts:891](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L891)
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:954](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L954)
409
+ Defined in: [data-structures/matrix/matrix.ts:978](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L978)
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:984](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L984)
425
+ Defined in: [data-structures/matrix/matrix.ts:1008](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1008)
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:248](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L248)
447
+ Defined in: [data-structures/matrix/matrix.ts:251](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L251)
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:742](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L742)
504
+ Defined in: [data-structures/matrix/matrix.ts:763](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L763)
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:326](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L326)
539
+ Defined in: [data-structures/matrix/matrix.ts:332](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L332)
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:908](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L908)
566
+ Defined in: [data-structures/matrix/matrix.ts:932](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L932)
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:995](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L995)
600
+ Defined in: [data-structures/matrix/matrix.ts:1019](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1019)
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:568](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L568)
622
+ Defined in: [data-structures/matrix/matrix.ts:583](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L583)
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:312](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L312)
680
+ Defined in: [data-structures/matrix/matrix.ts:318](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L318)
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:475](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L475)
736
+ Defined in: [data-structures/matrix/matrix.ts:487](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L487)
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:947](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L947)
776
+ Defined in: [data-structures/matrix/matrix.ts:971](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L971)
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:664](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L664)
792
+ Defined in: [data-structures/matrix/matrix.ts:682](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L682)
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:1054](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1054)
836
+ Defined in: [data-structures/matrix/matrix.ts:1078](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1078)
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:1039](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1039)
865
+ Defined in: [data-structures/matrix/matrix.ts:1063](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1063)
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:1027](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1027)
893
+ Defined in: [data-structures/matrix/matrix.ts:1051](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1051)
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:1108](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1108)
931
+ Defined in: [data-structures/matrix/matrix.ts:1132](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1132)
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:1090](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1090)
971
+ Defined in: [data-structures/matrix/matrix.ts:1114](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1114)
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:1077](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1077)
1003
+ Defined in: [data-structures/matrix/matrix.ts:1101](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/matrix/matrix.ts#L1101)
1004
1004
 
1005
1005
  The function `_swapRows` swaps the positions of two rows in an array.
1006
1006