@@ -256,35 +256,35 @@ end
256256 Var (v. offset + idxx (is .- (_start .(v. size) .- 1 ), _length .(v. size)))
257257end
258258
259- function _bound_check (sizes, i:: I ) where I <: Integer
259+ function _bound_check (sizes, i:: I ) where {I <: Integer }
260260 __bound_check (sizes[1 ], i)
261261end
262- function _bound_check (sizes, is:: NTuple{N,I} ) where {I <: Integer , N}
262+ function _bound_check (sizes, is:: NTuple{N,I} ) where {I<: Integer ,N}
263263 __bound_check (sizes[1 ], is[1 ])
264264 _bound_check (sizes[2 : end ], is[2 : end ])
265265end
266266_bound_check (sizes, is) = nothing
267267_bound_check (sizes, is:: Tuple{} ) = nothing
268268
269- function __bound_check (a:: I ,b:: I ) where I <: Integer
270- @assert (1 <= b <= a, " Variable index bound error" )
269+ function __bound_check (a:: I , b:: I ) where {I <: Integer }
270+ @assert (1 <= b <= a, " Variable index bound error" )
271271end
272- function __bound_check (a:: UnitRange{Int} ,b:: I ) where I <: Integer
272+ function __bound_check (a:: UnitRange{Int} , b:: I ) where {I <: Integer }
273273 @assert (b in a, " Variable index bound error" )
274274end
275275
276276
277277function append! (backend, a, b:: Base.Generator , lb)
278278 b = _adapt_gen (b)
279-
279+
280280 la = length (a)
281281 resize! (a, la + lb)
282282 map! (b. f, view (a, (la+ 1 ): (la+ lb)), convert_array (b. iter, backend))
283283 return a
284284end
285285
286286function append! (backend, a, b:: Base.Generator{UnitRange{I}} , lb) where {I}
287-
287+
288288 la = length (a)
289289 resize! (a, la + lb)
290290 map! (b. f, view (a, (la+ 1 ): (la+ lb)), b. iter)
@@ -450,8 +450,8 @@ function constraint(
450450 start = zero (T),
451451 lcon = zero (T),
452452 ucon = zero (T),
453- ) where {T,C<: ExaCore{T} }
454-
453+ ) where {T,C<: ExaCore{T} }
454+
455455 gen = _adapt_gen (gen)
456456 f = SIMDFunction (gen, c. ncon, c. nnzj, c. nnzh)
457457 pars = gen. iter
@@ -512,7 +512,7 @@ function _constraint(c, f, pars, start, lcon, ucon)
512512end
513513
514514function constraint! (c:: C , c1, gen:: Base.Generator ) where {C<: ExaCore }
515-
515+
516516 gen = _adapt_gen (gen)
517517 f = SIMDFunction (gen, offset0 (c1, 0 ), c. nnzj, c. nnzh)
518518 pars = gen. iter
@@ -648,7 +648,7 @@ function hess_coord!(
648648 x:: AbstractVector ,
649649 y:: AbstractVector ,
650650 hess:: AbstractVector ;
651- obj_weight = one (eltype (x)),
651+ obj_weight = one (eltype (x)),
652652)
653653
654654 fill! (hess, zero (eltype (hess)))
@@ -707,21 +707,23 @@ end
707707@inbounds @inline offset0 (a:: C , i) where {C<: ConstraintAug } = offset0 (a. f, a. itr, i)
708708@inbounds @inline offset0 (f:: F , itr, i) where {P<: Pair ,F<: SIMDFunction{P} } =
709709 f. o0 + f. f. first (itr[i], nothing )
710- @inbounds @inline offset0 (f:: F , itr, i) where {T<: Tuple ,P<: Pair{T} ,F<: SIMDFunction{P} } = f. o0 + idxx (coord (itr, i, f. f. first), Base. size (itr))
710+ @inbounds @inline offset0 (f:: F , itr, i) where {T<: Tuple ,P<: Pair{T} ,F<: SIMDFunction{P} } =
711+ f. o0 + idxx (coord (itr, i, f. f. first), Base. size (itr))
711712
712713@inline idx (itr, I) = @inbounds itr[I]
713- @inline idx (itr:: Base.Iterators.ProductIterator{V} , I) where V = _idx (I- 1 , itr. iterators, Base. size (itr))
714+ @inline idx (itr:: Base.Iterators.ProductIterator{V} , I) where {V} =
715+ _idx (I - 1 , itr. iterators, Base. size (itr))
714716@inline function _idx (n, (vec1, vec... ), (si1, si... ))
715717 d, r = divrem (n, si1)
716- return (vec1[r + 1 ], _idx (d, vec, si)... )
718+ return (vec1[r+ 1 ], _idx (d, vec, si)... )
717719end
718- @inline _idx (n, (vec,), :: Tuple{Int} ) = @inbounds vec[n + 1 ]
720+ @inline _idx (n, (vec,), :: Tuple{Int} ) = @inbounds vec[n+ 1 ]
719721
720722@inline idxx (coord, si) = _idxx (coord, si, 1 ) + 1
721- @inline _idxx (coord, si, a) = a * (coord[1 ] - 1 ) + _idxx (coord[2 : end ], si[2 : end ], a* si[1 ])
723+ @inline _idxx (coord, si, a) = a * (coord[1 ] - 1 ) + _idxx (coord[2 : end ], si[2 : end ], a * si[1 ])
722724@inline _idxx (:: Tuple{} , :: Tuple{} , a) = 0
723725
724- @inline coord (itr, i, (f,fs... )) = (f (idx (itr,i), nothing ), coord (itr, i, fs)... )
726+ @inline coord (itr, i, (f, fs... )) = (f (idx (itr, i), nothing ), coord (itr, i, fs)... )
725727@inline coord (itr, i, :: Tuple{} ) = ()
726728
727729for (thing, val) in [(:solution , 1 ), (:multipliers_L , 0 ), (:multipliers_U , 2 )]
801803
802804
803805_adapt_gen (gen) = Base. Generator (gen. f, collect (gen. iter))
804- _adapt_gen (gen:: Base.Generator{P} ) where P <: Union{AbstractArray,AbstractRange} = gen
806+ _adapt_gen (gen:: Base.Generator{P} ) where {P <: Union{AbstractArray,AbstractRange} } = gen
0 commit comments