@@ -74,7 +74,8 @@ function defaultalg(A::GPUArraysCore.AbstractGPUArray, b, assump::OperatorAssump
7474 end
7575end
7676
77- function defaultalg (A:: GPUArraysCore.AbstractGPUArray , b, assump:: OperatorAssumptions{true,OperatorCondition.IllConditioned} )
77+ function defaultalg (A:: GPUArraysCore.AbstractGPUArray , b,
78+ assump:: OperatorAssumptions{true, OperatorCondition.IllConditioned} )
7879 QRFactorization ()
7980end
8081
@@ -86,7 +87,8 @@ function defaultalg(A, b::GPUArraysCore.AbstractGPUArray, assump::OperatorAssump
8687 end
8788end
8889
89- function defaultalg (A, b:: GPUArraysCore.AbstractGPUArray , assump:: OperatorAssumptions{true,OperatorCondition.IllConditioned} )
90+ function defaultalg (A, b:: GPUArraysCore.AbstractGPUArray ,
91+ assump:: OperatorAssumptions{true, OperatorCondition.IllConditioned} )
9092 QRFactorization ()
9193end
9294
@@ -130,7 +132,7 @@ function defaultalg(A::GPUArraysCore.AbstractGPUArray, b::GPUArraysCore.Abstract
130132end
131133
132134function defaultalg (A:: GPUArraysCore.AbstractGPUArray , b:: GPUArraysCore.AbstractGPUArray ,
133- :: OperatorAssumptions{true,OperatorCondition.IllConditioned} )
135+ :: OperatorAssumptions{true, OperatorCondition.IllConditioned} )
134136 QRFactorization ()
135137end
136138
@@ -155,33 +157,33 @@ function defaultalg(A, b, assump::OperatorAssumptions{true})
155157 # whether MKL or OpenBLAS is being used
156158 if (A === nothing && ! (b isa GPUArraysCore. AbstractGPUArray)) || A isa Matrix
157159 if (A === nothing || eltype (A) <: Union{Float32, Float64, ComplexF32, ComplexF64} ) &&
158- ArrayInterface. can_setindex (b) && ( __conditioning (assump) === OperatorCondition . IllConditioned ||
159- __conditioning (assump) === OperatorCondition. WellConditioned)
160-
160+ ArrayInterface. can_setindex (b) &&
161+ ( __conditioning (assump) === OperatorCondition. IllConditioned ||
162+ __conditioning (assump) === OperatorCondition . WellConditioned)
161163 if length (b) <= 10
162164 pivot = @static if VERSION < v " 1.7beta"
163165 if __conditioning (assump) === OperatorCondition. IllConditioned
164166 Val (true )
165167 else
166168 Val (false )
167169 end
170+ else
171+ if __conditioning (assump) === OperatorCondition. IllConditioned
172+ RowMaximum ()
168173 else
169- if __conditioning (assump) === OperatorCondition. IllConditioned
170- RowMaximum ()
171- else
172- RowNonZero ()
173- end
174+ RowNonZero ()
174175 end
176+ end
175177 alg = GenericLUFactorization (pivot)
176178 elseif (length (b) <= 100 || (isopenblas () && length (b) <= 500 )) &&
177179 (A === nothing ? eltype (b) <: Union{Float32, Float64} :
178180 eltype (A) <: Union{Float32, Float64} )
179- pivot = if __conditioning (assump) === OperatorCondition. IllConditioned
181+ pivot = if __conditioning (assump) === OperatorCondition. IllConditioned
180182 Val (true )
181183 else
182184 Val (false )
183185 end
184- alg = RFLUFactorization (;pivot = pivot)
186+ alg = RFLUFactorization (; pivot = pivot)
185187 # elseif A === nothing || A isa Matrix
186188 # alg = FastLUFactorization()
187189 else
@@ -191,13 +193,13 @@ function defaultalg(A, b, assump::OperatorAssumptions{true})
191193 else
192194 Val (false )
193195 end
196+ else
197+ if __conditioning (assump) === OperatorCondition. IllConditioned
198+ RowMaximum ()
194199 else
195- if __conditioning (assump) === OperatorCondition. IllConditioned
196- RowMaximum ()
197- else
198- RowNonZero ()
199- end
200+ RowNonZero ()
200201 end
202+ end
201203 alg = LUFactorization (pivot)
202204 end
203205 elseif __conditioning (assump) === OperatorCondition. VeryIllConditioned
@@ -220,19 +222,21 @@ function defaultalg(A, b, assump::OperatorAssumptions{true})
220222 alg
221223end
222224
223- function defaultalg (A, b, :: OperatorAssumptions{false,OperatorCondition.WellConditioned} )
225+ function defaultalg (A, b, :: OperatorAssumptions{false, OperatorCondition.WellConditioned} )
224226 NormalCholeskyFactorization ()
225227end
226228
227- function defaultalg (A, b, :: OperatorAssumptions{false,OperatorCondition.IllConditioned} )
229+ function defaultalg (A, b, :: OperatorAssumptions{false, OperatorCondition.IllConditioned} )
228230 QRFactorization ()
229231end
230232
231- function defaultalg (A, b, :: OperatorAssumptions{false,OperatorCondition.VeryIllConditioned} )
233+ function defaultalg (A, b,
234+ :: OperatorAssumptions{false, OperatorCondition.VeryIllConditioned} )
232235 QRFactorization ()
233236end
234237
235- function defaultalg (A, b, :: OperatorAssumptions{false,OperatorCondition.SuperIllConditioned} )
238+ function defaultalg (A, b,
239+ :: OperatorAssumptions{false, OperatorCondition.SuperIllConditioned} )
236240 SVDFactorization (false , LinearAlgebra. QRIteration ())
237241end
238242
0 commit comments