|
32 | 32 | "column": 0
|
33 | 33 | },
|
34 | 34 | "end": {
|
35 |
| - "line": 60, |
| 35 | + "line": 65, |
36 | 36 | "column": 1
|
37 | 37 | }
|
38 | 38 | },
|
|
237 | 237 | },
|
238 | 238 | {
|
239 | 239 | "title": "example",
|
240 |
| - "description": "const M = new eig.Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]);\nconst lu = eig.Decompositions.lu(M);\nconst I = eig.Matrix.identity(3, 3);\nconst M2 = lu.P.inverse().matMul(lu.L.matAdd(I)).matMul(lu.U).matMul(lu.Q.inverse());\nreturn { ...lu, M2 };", |
| 240 | + "description": "const M = new eig.Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]);\nconst lu = eig.Decompositions.lu(M);\n// Reconstruct M from its LU decomposition\nconst I = eig.Matrix.identity(3, 3);\nconst M2 = lu.P.inverse().matMul(lu.L.matAdd(I)).matMul(lu.U).matMul(lu.Q.inverse());\nreturn { ...lu, M2 };", |
241 | 241 | "lineNumber": 6
|
242 | 242 | }
|
243 | 243 | ],
|
|
247 | 247 | "column": 2
|
248 | 248 | },
|
249 | 249 | "end": {
|
250 |
| - "line": 31, |
| 250 | + "line": 32, |
251 | 251 | "column": 5
|
252 | 252 | }
|
253 | 253 | },
|
254 | 254 | "context": {
|
255 | 255 | "loc": {
|
256 | 256 | "start": {
|
257 |
| - "line": 32, |
| 257 | + "line": 33, |
258 | 258 | "column": 2
|
259 | 259 | },
|
260 | 260 | "end": {
|
261 |
| - "line": 32, |
| 261 | + "line": 33, |
262 | 262 | "column": 18
|
263 | 263 | }
|
264 | 264 | },
|
|
267 | 267 | "augments": [],
|
268 | 268 | "examples": [
|
269 | 269 | {
|
270 |
| - "description": "const M = new eig.Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]);\nconst lu = eig.Decompositions.lu(M);\nconst I = eig.Matrix.identity(3, 3);\nconst M2 = lu.P.inverse().matMul(lu.L.matAdd(I)).matMul(lu.U).matMul(lu.Q.inverse());\nreturn { ...lu, M2 };" |
| 270 | + "description": "const M = new eig.Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]);\nconst lu = eig.Decompositions.lu(M);\n// Reconstruct M from its LU decomposition\nconst I = eig.Matrix.identity(3, 3);\nconst M2 = lu.P.inverse().matMul(lu.L.matAdd(I)).matMul(lu.U).matMul(lu.Q.inverse());\nreturn { ...lu, M2 };" |
271 | 271 | }
|
272 | 272 | ],
|
273 | 273 | "implements": [],
|
|
377 | 377 | ],
|
378 | 378 | "loc": {
|
379 | 379 | "start": {
|
380 |
| - "line": 34, |
| 380 | + "line": 35, |
381 | 381 | "column": 2
|
382 | 382 | },
|
383 | 383 | "end": {
|
384 |
| - "line": 43, |
| 384 | + "line": 44, |
385 | 385 | "column": 5
|
386 | 386 | }
|
387 | 387 | },
|
388 | 388 | "context": {
|
389 | 389 | "loc": {
|
390 | 390 | "start": {
|
391 |
| - "line": 44, |
| 391 | + "line": 45, |
392 | 392 | "column": 2
|
393 | 393 | },
|
394 | 394 | "end": {
|
395 |
| - "line": 44, |
| 395 | + "line": 45, |
396 | 396 | "column": 18
|
397 | 397 | }
|
398 | 398 | },
|
|
515 | 515 | },
|
516 | 516 | {
|
517 | 517 | "title": "example",
|
518 |
| - "description": "const M = new eig.Matrix([[1, 2, 3], [4, 5, 6]]);\nconst svd = eig.Decompositions.svd(M, true);\nreturn svd;", |
| 518 | + "description": "const M = new eig.Matrix([[1, 2, 3], [4, 5, 6]]);\nconst svd = eig.Decompositions.svd(M, true);\n// Reconstruct M from its SVD decomposition\nlet sigma = new eig.Matrix(svd.U.cols(), svd.V.cols());\nsigma.setBlock(0, 0, eig.Matrix.diagonal(svd.sv));\nconst M2 = svd.U.matMul(sigma.transpose()).matMul(svd.V.transpose());\nreturn {...svd, M2}", |
519 | 519 | "lineNumber": 8
|
520 | 520 | }
|
521 | 521 | ],
|
522 | 522 | "loc": {
|
523 | 523 | "start": {
|
524 |
| - "line": 46, |
| 524 | + "line": 47, |
525 | 525 | "column": 2
|
526 | 526 | },
|
527 | 527 | "end": {
|
528 |
| - "line": 58, |
| 528 | + "line": 63, |
529 | 529 | "column": 5
|
530 | 530 | }
|
531 | 531 | },
|
532 | 532 | "context": {
|
533 | 533 | "loc": {
|
534 | 534 | "start": {
|
535 |
| - "line": 59, |
| 535 | + "line": 64, |
536 | 536 | "column": 2
|
537 | 537 | },
|
538 | 538 | "end": {
|
539 |
| - "line": 59, |
| 539 | + "line": 64, |
540 | 540 | "column": 25
|
541 | 541 | }
|
542 | 542 | },
|
|
545 | 545 | "augments": [],
|
546 | 546 | "examples": [
|
547 | 547 | {
|
548 |
| - "description": "const M = new eig.Matrix([[1, 2, 3], [4, 5, 6]]);\nconst svd = eig.Decompositions.svd(M, true);\nreturn svd;" |
| 548 | + "description": "const M = new eig.Matrix([[1, 2, 3], [4, 5, 6]]);\nconst svd = eig.Decompositions.svd(M, true);\n// Reconstruct M from its SVD decomposition\nlet sigma = new eig.Matrix(svd.U.cols(), svd.V.cols());\nsigma.setBlock(0, 0, eig.Matrix.diagonal(svd.sv));\nconst M2 = svd.U.matMul(sigma.transpose()).matMul(svd.V.transpose());\nreturn {...svd, M2}" |
549 | 549 | }
|
550 | 550 | ],
|
551 | 551 | "implements": [],
|
|
0 commit comments