()
| 259 | // return index; |
| 260 | } |
| 261 | |
| 262 | get isSquare(): boolean { |
| 263 | const shape = this.shape; |
| 264 | return shape.length === 2 && shape[0] === shape[1]; |
| 265 | } |
| 266 | |
| 267 | // A square matrix that is equal to its transpose. A^T = A |
| 268 | get isSymmetric(): boolean { |
| 269 | if (!this.isSquare) return false; |
| 270 | const n = this.shape[0]; |
| 271 | const data = this.data; |
| 272 | const eq = this.field.equals.bind(this.field); |
| 273 | for (let i = 0; i < n; i++) |
| 274 | for (let j = i + 1; j < n; j++) |