@@ -159,8 +159,8 @@ function _optimizerrlu!(
159
159
addpivot! (lu, A, newpivot)
160
160
end
161
161
162
- lu. L = tril (A[:, 1 : lu. npivot])
163
- lu. U = triu (A[1 : lu. npivot, :])
162
+ lu. L = tril (@view A[:, 1 : lu. npivot])
163
+ lu. U = triu (@view A[1 : lu. npivot, :])
164
164
if any (isnan .(lu. L))
165
165
error (" lu.L contains NaNs" )
166
166
end
@@ -277,16 +277,16 @@ function arrlu(
277
277
I2 = setdiff (1 : matrixsize[1 ], I0)
278
278
lu. rowpermutation = vcat (I0, I2)
279
279
L2 = _batchf (I2, J0)
280
- cols2Lmatrix! (L2, lu. U[1 : lu. npivot, 1 : lu. npivot], leftorthogonal)
281
- lu. L = vcat (lu. L[1 : lu. npivot, 1 : lu. npivot], L2)
280
+ cols2Lmatrix! (L2, ( @view lu. U[1 : lu. npivot, 1 : lu. npivot]) , leftorthogonal)
281
+ lu. L = vcat (( @view lu. L[1 : lu. npivot, 1 : lu. npivot]) , L2)
282
282
end
283
283
284
284
if size (lu. U, 2 ) < matrixsize[2 ]
285
285
J2 = setdiff (1 : matrixsize[2 ], J0)
286
286
lu. colpermutation = vcat (J0, J2)
287
287
U2 = _batchf (I0, J2)
288
- rows2Umatrix! (U2, lu. L[1 : lu. npivot, 1 : lu. npivot], leftorthogonal)
289
- lu. U = hcat (lu. U[1 : lu. npivot, 1 : lu. npivot], U2)
288
+ rows2Umatrix! (U2, ( @view lu. L[1 : lu. npivot, 1 : lu. npivot]) , leftorthogonal)
289
+ lu. U = hcat (( @view lu. U[1 : lu. npivot, 1 : lu. npivot]) , U2)
290
290
end
291
291
292
292
return lu
0 commit comments