File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -394,13 +394,13 @@ control over the factorization of `A`.
394
394
```jldoctest
395
395
julia> A = [1 2.2 4; 3.1 0.2 3; 4 1 2];
396
396
397
- julia> X = [1; 2.5; 3];
397
+ julia> B = [1, 2.5, 3];
398
398
399
- julia> Y = zero(X);
399
+ julia> Y = similar(B); # use similar since there is no need to read from it
400
400
401
- julia> ldiv!(Y, qr(A), X);
401
+ julia> ldiv!(Y, qr(A), B); # you may also try qr!(A) to further reduce allocation
402
402
403
- julia> Y ≈ A\\ X
403
+ julia> Y ≈ A \\ B
404
404
true
405
405
```
406
406
"""
@@ -426,13 +426,13 @@ control over the factorization of `A`.
426
426
```jldoctest
427
427
julia> A = [1 2.2 4; 3.1 0.2 3; 4 1 2];
428
428
429
- julia> X = [1; 2.5; 3];
429
+ julia> B = [1, 2.5, 3];
430
430
431
- julia> Y = copy(X);
431
+ julia> B0 = copy(B); # a backup copy to facilitate testing
432
432
433
- julia> ldiv!(qr (A), X);
433
+ julia> ldiv!(lu (A), B); # you may also try lu!(A) to further reduce allocation
434
434
435
- julia> X ≈ A\\ Y
435
+ julia> B ≈ A \\ B0
436
436
true
437
437
```
438
438
"""
You can’t perform that action at this time.
0 commit comments