@thi.ng/adjacency 2.0.9 → 2.1.2

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/CHANGELOG.md CHANGED
@@ -1,103 +1,165 @@
1
1
  # Change Log
2
2
 
3
+ - **Last updated**: 2021-11-21T17:09:28Z
4
+ - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
+
3
6
  All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
+ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelines.
8
+
9
+ **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
+ and/or version bumps of transitive dependencies.
11
+
12
+ ## [2.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@2.1.0) (2021-11-17)
13
+
14
+ #### 🚀 Features
15
+
16
+ - Using workspaces for local tools ([bf7a404](https://github.com/thi-ng/umbrella/commit/bf7a404))
17
+ Improving the overall build ergonomics
18
+ - introduced a tools workspaces
19
+ - imported it in all needed packages/examples
20
+ - inclusive project root
21
+
22
+ #### ♻️ Refactoring
23
+
24
+ - testrunner to binary ([4ebbbb2](https://github.com/thi-ng/umbrella/commit/4ebbbb2))
25
+ this commit reverts (partly) changes made in:
26
+ ef346d7a8753590dc9094108a3d861a8dbd5dd2c
27
+ overall purpose is better testament ergonomics:
28
+ instead of having to pass NODE_OPTIONS with every invocation
29
+ having a binary to handle this for us.
30
+
31
+ ### [2.0.10](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@2.0.10) (2021-11-10)
32
+
33
+ #### ♻️ Refactoring
34
+
35
+ - update all countdown loops ([a5f374b](https://github.com/thi-ng/umbrella/commit/a5f374b))
36
+
37
+ ### [2.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@2.0.1) (2021-10-13)
5
38
 
6
- ## [2.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@2.0.8...@thi.ng/adjacency@2.0.9) (2021-11-04)
39
+ #### ♻️ Refactoring
7
40
 
8
- **Note:** Version bump only for package @thi.ng/adjacency
41
+ - update imports in all tests/pkgs ([effd591](https://github.com/thi-ng/umbrella/commit/effd591))
42
+ - update imports in all pkgs ([5fa2b6f](https://github.com/thi-ng/umbrella/commit/5fa2b6f))
43
+ - add .js suffix for all relative imports
9
44
 
45
+ # [2.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@2.0.0) (2021-10-12)
10
46
 
47
+ #### 🛑 Breaking changes
11
48
 
49
+ - major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea))
50
+ - BREAKING CHANGE: discontinue CommonJS & UMD versions
51
+ - only ESM modules will be published from now on
52
+ - CJS obsolete due to ESM support in recent versions of node:
53
+ - i.e. launch NodeJS via:
54
+ - `node --experimental-specifier-resolution=node --experimental-repl-await`
55
+ - in the node REPL use `await import(...)` instead of `require()`
56
+ - UMD obsolete due to widespread browser support for ESM
57
+ Also:
58
+ - normalize/restructure/reorg all package.json files
59
+ - cleanup all build scripts, remove obsolete
60
+ - switch from mocha to [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament) for all tests
12
61
 
62
+ #### ♻️ Refactoring
13
63
 
14
- ## [2.0.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@2.0.7...@thi.ng/adjacency@2.0.8) (2021-11-03)
64
+ - minor pkg restructure (various) ([47f88d2](https://github.com/thi-ng/umbrella/commit/47f88d2))
65
+ - update imports ([ee847e0](https://github.com/thi-ng/umbrella/commit/ee847e0))
66
+ - update all tests in _all_ pkgs ([8b582bc](https://github.com/thi-ng/umbrella/commit/8b582bc))
67
+ - update all to use [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament)
15
68
 
16
- **Note:** Version bump only for package @thi.ng/adjacency
69
+ ### [0.3.7](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@0.3.7) (2021-03-17)
17
70
 
71
+ #### ♻️ Refactoring
18
72
 
73
+ - dedupe OOB error handling ([84bbaaa](https://github.com/thi-ng/umbrella/commit/84bbaaa))
19
74
 
75
+ ## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@0.3.0) (2021-02-20)
20
76
 
77
+ #### 🛑 Breaking changes
21
78
 
22
- # [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@1.0.5...@thi.ng/adjacency@2.0.0) (2021-10-12)
79
+ - add IGraph.degree() & impls ([9fb02ac](https://github.com/thi-ng/umbrella/commit/9fb02ac))
80
+ - BREAKING CHANGE: replace .valence() w/ more flexible .degree() methods
81
+ - add IGraph.degree() with same default behavior as .valence(),
82
+ but supporting diff degree types (in/out/inout)
83
+ - add .degree() impls for all
84
+ - remove old .valence() methods
85
+ - update tests
86
+ - major update Adjacency(Bit)Matrix classes & API ([cd71a5f](https://github.com/thi-ng/umbrella/commit/cd71a5f))
87
+ - BREAKING CHANGE: fixed order add/removeEdge(), valence(), neighbors(),
88
+ remove static methods
89
+ - update IGraph, add/update methods, return types, generics
90
+ - remove/replace static methods in Adjacency(Bit)Matrix
91
+ - add defAdjBitMatrix/defAdjMatrix
92
+ - refactor/extract/re-use .toDot() graphviz conversion
93
+ - update tests
23
94
 
95
+ #### 🚀 Features
24
96
 
25
- ### Build System
97
+ - add AdjacencyList impl & initial tests ([8f44c97](https://github.com/thi-ng/umbrella/commit/8f44c97))
26
98
 
27
- * major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
99
+ #### Performance improvements
28
100
 
101
+ - pre-cache MST edge costs ([290f3a6](https://github.com/thi-ng/umbrella/commit/290f3a6))
29
102
 
30
- ### BREAKING CHANGES
103
+ #### ♻️ Refactoring
31
104
 
32
- * discontinue CommonJS & UMD versions
105
+ - update DisjointSet, add defDisjointSet() ([cfe3ed5](https://github.com/thi-ng/umbrella/commit/cfe3ed5))
106
+ - update BFS/DFS impls ([7bb045b](https://github.com/thi-ng/umbrella/commit/7bb045b))
107
+ - add one-off search bfs()/dfs() functions/syntax sugar
108
+ - update BFS to be single-source only (for more predictable results)
33
109
 
34
- - only ESM modules will be published from now on
35
- - CJS obsolete due to ESM support in recent versions of node:
36
- - i.e. launch NodeJS via:
37
- - `node --experimental-specifier-resolution=node --experimental-repl-await`
38
- - in the node REPL use `await import(...)` instead of `require()`
39
- - UMD obsolete due to widespread browser support for ESM
110
+ ## [0.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@0.2.0) (2020-12-22)
40
111
 
41
- Also:
42
- - normalize/restructure/reorg all package.json files
43
- - cleanup all build scripts, remove obsolete
44
- - switch from mocha to @thi.ng/testament for all tests
112
+ #### 🛑 Breaking changes
45
113
 
114
+ - fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace enum w/ type alias ([88edbe1](https://github.com/thi-ng/umbrella/commit/88edbe1))
115
+ - BREAKING CHANGE: replace DegreeType w/ type alias
46
116
 
117
+ ### [0.1.67](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@0.1.67) (2020-12-07)
47
118
 
119
+ #### ♻️ Refactoring
48
120
 
121
+ - update type-only imports ([b8243b9](https://github.com/thi-ng/umbrella/commit/b8243b9))
49
122
 
123
+ ### [0.1.65](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@0.1.65) (2020-11-24)
50
124
 
51
- ## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@1.0.4...@thi.ng/adjacency@1.0.5) (2021-09-03)
125
+ #### ♻️ Refactoring
52
126
 
53
- **Note:** Version bump only for package @thi.ng/adjacency
127
+ - update destructuring ([3524982](https://github.com/thi-ng/umbrella/commit/3524982))
54
128
 
55
- # [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.2.6...@thi.ng/adjacency@0.3.0) (2021-02-20)
129
+ ### [0.1.61](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@0.1.61) (2020-09-13)
56
130
 
57
- ### Features
131
+ #### ♻️ Refactoring
58
132
 
59
- - **adjacency:** add AdjacencyList impl & initial tests ([8f44c97](https://github.com/thi-ng/umbrella/commit/8f44c9762c0856a9b96e4548d2386eca6dcbf397))
60
- - **adjacency:** add IGraph.degree() & impls ([9fb02ac](https://github.com/thi-ng/umbrella/commit/9fb02ac7467785a0802c544cbc3100d6ac52fb87))
61
- - **adjacency:** major update Adjacency(Bit)Matrix classes & API ([cd71a5f](https://github.com/thi-ng/umbrella/commit/cd71a5fca3b2d8525c5b1c6e9032e55e39fea2dd))
133
+ - update imports, use new Fn types in various pkgs ([ced1e5d](https://github.com/thi-ng/umbrella/commit/ced1e5d))
62
134
 
63
- ### Performance Improvements
135
+ ### [0.1.35](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@0.1.35) (2020-04-05)
64
136
 
65
- - **adjacency:** pre-cache MST edge costs ([290f3a6](https://github.com/thi-ng/umbrella/commit/290f3a6e1f9d71ddf3bb33f4bc6e9552896903a9))
137
+ #### ♻️ Refactoring
66
138
 
67
- ### BREAKING CHANGES
139
+ - switch to non-const enums ([fd5c401](https://github.com/thi-ng/umbrella/commit/fd5c401))
68
140
 
69
- - **adjacency:** replace .valence() w/ more flexible .degree() methods
70
- - add IGraph.degree() with same default behavior as .valence(), but supporting diff degree types (in/out/inout)
71
- - add .degree() impls for all
72
- - remove old .valence() methods
73
- - update tests
74
- - **adjacency:** fixed order add/removeEdge(), valence(), neighbors(), remove static methods
75
- - update IGraph, add/update methods, return types, generics
76
- - remove/replace static methods in Adjacency(Bit)Matrix
77
- - add defAdjBitMatrix/defAdjMatrix
78
- - refactor/extract/re-use .toDot() graphviz conversion
79
- - update tests
141
+ ### [0.1.29](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@0.1.29) (2020-02-25)
80
142
 
81
- # [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.67...@thi.ng/adjacency@0.2.0) (2020-12-22)
143
+ #### ♻️ Refactoring
82
144
 
83
- ### Code Refactoring
145
+ - update type imports ([3d9ebcf](https://github.com/thi-ng/umbrella/commit/3d9ebcf))
84
146
 
85
- - **adjacency:** fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace enum w/ type alias ([88edbe1](https://github.com/thi-ng/umbrella/commit/88edbe10ffe9ceb9f5e8494c9a60b8067a7d57d1))
147
+ ### [0.1.16](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@0.1.16) (2019-07-07)
86
148
 
87
- ### BREAKING CHANGES
149
+ #### ♻️ Refactoring
88
150
 
89
- - **adjacency:** replace DegreeType w/ type alias
151
+ - TS strictNullChecks ([b628e61](https://github.com/thi-ng/umbrella/commit/b628e61))
90
152
 
91
- ## [0.1.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/adjacency@0.1.6...@thi.ng/adjacency@0.1.7) (2019-03-18)
153
+ ### [0.1.7](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@0.1.7) (2019-03-18)
92
154
 
93
- ### Performance Improvements
155
+ #### ⏱ Performance improvements
94
156
 
95
- - **adjacency:** update subsets() to use canonical() ([0918c5b](https://github.com/thi-ng/umbrella/commit/0918c5b))
157
+ - update subsets() to use canonical() ([0918c5b](https://github.com/thi-ng/umbrella/commit/0918c5b))
96
158
 
97
- # 0.1.0 (2019-02-17)
159
+ ## [0.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/adjacency@0.1.0) (2019-02-17)
98
160
 
99
- ### Features
161
+ #### 🚀 Features
100
162
 
101
- - **adjacency:** add bitmatrix edge counting, add/fix toDot() impls, add tests ([dae97ff](https://github.com/thi-ng/umbrella/commit/dae97ff))
102
- - **adjacency:** merge w/ unionfind pkg, add BFS, DFS, MST, DisjointSet ([2339b43](https://github.com/thi-ng/umbrella/commit/2339b43))
103
- - **adjacency:** re-import refactored adj matrices as new package ([501ea5e](https://github.com/thi-ng/umbrella/commit/501ea5e))
163
+ - merge w/ unionfind pkg, add BFS, DFS, MST, DisjointSet ([2339b43](https://github.com/thi-ng/umbrella/commit/2339b43))
164
+ - add bitmatrix edge counting, add/fix toDot() impls, add tests ([dae97ff](https://github.com/thi-ng/umbrella/commit/dae97ff))
165
+ - re-import refactored adj matrices as new package ([501ea5e](https://github.com/thi-ng/umbrella/commit/501ea5e))
package/README.md CHANGED
@@ -56,7 +56,7 @@ node --experimental-repl-await
56
56
  > const adjacency = await import("@thi.ng/adjacency");
57
57
  ```
58
58
 
59
- Package sizes (gzipped, pre-treeshake): ESM: 2.34 KB
59
+ Package sizes (gzipped, pre-treeshake): ESM: 2.42 KB
60
60
 
61
61
  ## Dependencies
62
62
 
package/binary.js CHANGED
@@ -15,7 +15,7 @@ export class AdjacencyBitMatrix {
15
15
  }
16
16
  *edges() {
17
17
  const directed = !this.undirected;
18
- for (let i = this.mat.n; --i >= 0;) {
18
+ for (let i = this.mat.n; i-- > 0;) {
19
19
  for (let n of this.neighbors(i)) {
20
20
  if (directed || n > i) {
21
21
  yield [i, n];
package/disjoint-set.js CHANGED
@@ -77,7 +77,7 @@ export class DisjointSet {
77
77
  subsets() {
78
78
  const sets = new Map();
79
79
  const roots = this.roots;
80
- for (let i = roots.length; --i >= 0;) {
80
+ for (let i = roots.length; i-- > 0;) {
81
81
  const id = this.canonical(i);
82
82
  const s = sets.get(id);
83
83
  if (s) {
package/package.json CHANGED
@@ -1,118 +1,123 @@
1
1
  {
2
- "name": "@thi.ng/adjacency",
3
- "version": "2.0.9",
4
- "description": "Sparse & bitwise adjacency matrices and related functions for directed & undirected graphs",
5
- "type": "module",
6
- "module": "./index.js",
7
- "typings": "./index.d.ts",
8
- "sideEffects": false,
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/thi-ng/umbrella.git"
2
+ "name": "@thi.ng/adjacency",
3
+ "version": "2.1.2",
4
+ "description": "Sparse & bitwise adjacency matrices and related functions for directed & undirected graphs",
5
+ "type": "module",
6
+ "module": "./index.js",
7
+ "typings": "./index.d.ts",
8
+ "sideEffects": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/thi-ng/umbrella.git"
12
+ },
13
+ "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/adjacency#readme",
14
+ "funding": [
15
+ {
16
+ "type": "github",
17
+ "url": "https://github.com/sponsors/postspectacular"
12
18
  },
13
- "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/adjacency#readme",
14
- "funding": [
15
- {
16
- "type": "github",
17
- "url": "https://github.com/sponsors/postspectacular"
18
- },
19
- {
20
- "type": "patreon",
21
- "url": "https://patreon.com/thing_umbrella"
22
- }
23
- ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
25
- "license": "Apache-2.0",
26
- "scripts": {
27
- "build": "yarn clean && tsc --declaration",
28
- "clean": "rimraf *.js *.d.ts *.map doc",
29
- "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
- "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
31
- "doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
32
- "doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
33
- "pub": "yarn build && yarn publish --access public",
34
- "test": "testament test"
19
+ {
20
+ "type": "patreon",
21
+ "url": "https://patreon.com/thing_umbrella"
22
+ }
23
+ ],
24
+ "author": "Karsten Schmidt <k+npm@thi.ng>",
25
+ "license": "Apache-2.0",
26
+ "scripts": {
27
+ "build": "yarn clean && tsc --declaration",
28
+ "clean": "rimraf '*.js' '*.d.ts' '*.map' doc",
29
+ "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
+ "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
31
+ "doc:readme": "yarn doc:stats && tools:readme",
32
+ "doc:stats": "tools:module-stats",
33
+ "pub": "yarn npm publish --access public",
34
+ "test": "testament test"
35
+ },
36
+ "dependencies": {
37
+ "@thi.ng/api": "^8.3.2",
38
+ "@thi.ng/arrays": "^2.1.2",
39
+ "@thi.ng/bitfield": "^2.1.2",
40
+ "@thi.ng/dcons": "^3.1.2",
41
+ "@thi.ng/errors": "^2.1.2",
42
+ "@thi.ng/sparse": "^0.3.2"
43
+ },
44
+ "devDependencies": {
45
+ "@microsoft/api-extractor": "^7.18.19",
46
+ "@thi.ng/testament": "^0.2.2",
47
+ "@thi.ng/vectors": "^7.2.2",
48
+ "rimraf": "^3.0.2",
49
+ "tools": "^0.0.1",
50
+ "typedoc": "^0.22.9",
51
+ "typescript": "^4.5.2"
52
+ },
53
+ "keywords": [
54
+ "adjacency",
55
+ "binary",
56
+ "bitwise",
57
+ "datastructure",
58
+ "degree",
59
+ "directed",
60
+ "disjointset",
61
+ "graph",
62
+ "laplacian",
63
+ "list",
64
+ "matrix",
65
+ "neighbors",
66
+ "path",
67
+ "search",
68
+ "span",
69
+ "sparse",
70
+ "tree",
71
+ "typescript",
72
+ "undirected",
73
+ "unionfind",
74
+ "valence",
75
+ "vertex"
76
+ ],
77
+ "publishConfig": {
78
+ "access": "public"
79
+ },
80
+ "engines": {
81
+ "node": ">=12.7"
82
+ },
83
+ "files": [
84
+ "*.js",
85
+ "*.d.ts"
86
+ ],
87
+ "exports": {
88
+ ".": {
89
+ "import": "./index.js"
35
90
  },
36
- "dependencies": {
37
- "@thi.ng/api": "^8.1.0",
38
- "@thi.ng/arrays": "^2.0.7",
39
- "@thi.ng/bitfield": "^2.0.7",
40
- "@thi.ng/dcons": "^3.0.8",
41
- "@thi.ng/errors": "^2.0.6",
42
- "@thi.ng/sparse": "^0.2.7"
91
+ "./api": {
92
+ "import": "./api.js"
43
93
  },
44
- "devDependencies": {
45
- "@thi.ng/testament": "^0.1.6",
46
- "@thi.ng/vectors": "^7.1.0"
94
+ "./bfs": {
95
+ "import": "./bfs.js"
47
96
  },
48
- "keywords": [
49
- "adjacency",
50
- "binary",
51
- "bitwise",
52
- "datastructure",
53
- "degree",
54
- "directed",
55
- "disjointset",
56
- "graph",
57
- "laplacian",
58
- "list",
59
- "matrix",
60
- "neighbors",
61
- "path",
62
- "search",
63
- "span",
64
- "sparse",
65
- "tree",
66
- "typescript",
67
- "undirected",
68
- "unionfind",
69
- "valence",
70
- "vertex"
71
- ],
72
- "publishConfig": {
73
- "access": "public"
97
+ "./binary": {
98
+ "import": "./binary.js"
74
99
  },
75
- "engines": {
76
- "node": ">=12.7"
100
+ "./dfs": {
101
+ "import": "./dfs.js"
77
102
  },
78
- "files": [
79
- "*.js",
80
- "*.d.ts"
81
- ],
82
- "exports": {
83
- ".": {
84
- "import": "./index.js"
85
- },
86
- "./api": {
87
- "import": "./api.js"
88
- },
89
- "./bfs": {
90
- "import": "./bfs.js"
91
- },
92
- "./binary": {
93
- "import": "./binary.js"
94
- },
95
- "./dfs": {
96
- "import": "./dfs.js"
97
- },
98
- "./disjoint-set": {
99
- "import": "./disjoint-set.js"
100
- },
101
- "./list": {
102
- "import": "./list.js"
103
- },
104
- "./mst": {
105
- "import": "./mst.js"
106
- },
107
- "./sparse": {
108
- "import": "./sparse.js"
109
- }
103
+ "./disjoint-set": {
104
+ "import": "./disjoint-set.js"
110
105
  },
111
- "thi.ng": {
112
- "related": [
113
- "dgraph"
114
- ],
115
- "year": 2018
106
+ "./list": {
107
+ "import": "./list.js"
116
108
  },
117
- "gitHead": "d6aca4b4edb697613ed6635b1c0b12f0bf27b1f0"
118
- }
109
+ "./mst": {
110
+ "import": "./mst.js"
111
+ },
112
+ "./sparse": {
113
+ "import": "./sparse.js"
114
+ }
115
+ },
116
+ "thi.ng": {
117
+ "related": [
118
+ "dgraph"
119
+ ],
120
+ "year": 2018
121
+ },
122
+ "gitHead": "e8a7c2a40191b391cef182c2978e5a6c85987a87\n"
123
+ }
package/sparse.js CHANGED
@@ -75,17 +75,17 @@ export class AdjacencyMatrix extends CSR {
75
75
  switch (deg) {
76
76
  case "out":
77
77
  default:
78
- for (let i = this.m; --i >= 0;) {
78
+ for (let i = this.m; i-- > 0;) {
79
79
  res.setAt(i, i, this.nnzRow(i));
80
80
  }
81
81
  break;
82
82
  case "in":
83
- for (let i = this.m; --i >= 0;) {
83
+ for (let i = this.m; i-- > 0;) {
84
84
  res.setAt(i, i, this.nnzCol(i));
85
85
  }
86
86
  break;
87
87
  case "inout":
88
- for (let i = this.m; --i >= 0;) {
88
+ for (let i = this.m; i-- > 0;) {
89
89
  res.setAt(i, i, this.nnzRow(i) + this.nnzCol(i));
90
90
  }
91
91
  break;