File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -156,28 +156,13 @@ export class SparseMatrix {
156
156
return this ;
157
157
}
158
158
159
- add ( other ) {
160
- if ( typeof other === 'number' ) return this . addS ( other ) ;
161
- if ( this . rows !== other . rows || this . columns !== other . columns ) {
162
- throw new RangeError ( 'Matrices dimensions must be equal' ) ;
163
- }
164
-
165
- other . withEachNonZero ( ( i , j , v ) => {
166
- this . set ( i , j , v + this . get ( i , j ) ) ;
167
- } ) ;
168
-
169
- return this ;
170
- }
171
-
172
159
mul ( other ) {
173
160
if ( typeof other !== 'number' ) {
174
161
throw new RangeError ( 'the argument should be a number' ) ;
175
162
}
176
163
177
164
if ( other === 0 ) {
178
- return new SparseMatrix ( this . rows , this . columns , {
179
- initialCapacity : this . cardinality ,
180
- } ) ;
165
+ return new SparseMatrix ( this . rows , this . columns ) ;
181
166
}
182
167
183
168
this . withEachNonZero ( ( i , j , v ) => {
You can’t perform that action at this time.
0 commit comments