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`.
394394```jldoctest 
395395julia> A = [1 2.2 4; 3.1 0.2 3; 4 1 2]; 
396396
397- julia> X  = [1;  2.5;  3]; 
397+ julia> B  = [1,  2.5,  3]; 
398398
399- julia> Y = zero(X);  
399+ julia> Y = similar(B); # use similar since there is no need to read from it  
400400
401- julia> ldiv!(Y, qr(A), X);  
401+ julia> ldiv!(Y, qr(A), B); # you may also try qr!(A) to further reduce allocation  
402402
403- julia> Y ≈ A\\ X  
403+ julia> Y ≈ A  \\  B  
404404true 
405405``` 
406406""" 
@@ -426,13 +426,13 @@ control over the factorization of `A`.
426426```jldoctest 
427427julia> A = [1 2.2 4; 3.1 0.2 3; 4 1 2]; 
428428
429- julia> X  = [1;  2.5;  3]; 
429+ julia> B  = [1,  2.5,  3]; 
430430
431- julia> Y  = copy(X);  
431+ julia> B0  = copy(B); # a backup copy to facilitate testing  
432432
433- julia> ldiv!(qr (A), X);  
433+ julia> ldiv!(lu (A), B); # you may also try lu!(A) to further reduce allocation  
434434
435- julia> X  ≈ A\\ Y  
435+ julia> B  ≈ A  \\  B0  
436436true 
437437``` 
438438""" 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments