@@ -256,35 +256,35 @@ end
256
256
Var (v. offset + idxx (is .- (_start .(v. size) .- 1 ), _length .(v. size)))
257
257
end
258
258
259
- function _bound_check (sizes, i:: I ) where I <: Integer
259
+ function _bound_check (sizes, i:: I ) where {I <: Integer }
260
260
__bound_check (sizes[1 ], i)
261
261
end
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}
263
263
__bound_check (sizes[1 ], is[1 ])
264
264
_bound_check (sizes[2 : end ], is[2 : end ])
265
265
end
266
266
_bound_check (sizes, is) = nothing
267
267
_bound_check (sizes, is:: Tuple{} ) = nothing
268
268
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" )
271
271
end
272
- function __bound_check (a:: UnitRange{Int} ,b:: I ) where I <: Integer
272
+ function __bound_check (a:: UnitRange{Int} , b:: I ) where {I <: Integer }
273
273
@assert (b in a, " Variable index bound error" )
274
274
end
275
275
276
276
277
277
function append! (backend, a, b:: Base.Generator , lb)
278
278
b = _adapt_gen (b)
279
-
279
+
280
280
la = length (a)
281
281
resize! (a, la + lb)
282
282
map! (b. f, view (a, (la+ 1 ): (la+ lb)), convert_array (b. iter, backend))
283
283
return a
284
284
end
285
285
286
286
function append! (backend, a, b:: Base.Generator{UnitRange{I}} , lb) where {I}
287
-
287
+
288
288
la = length (a)
289
289
resize! (a, la + lb)
290
290
map! (b. f, view (a, (la+ 1 ): (la+ lb)), b. iter)
@@ -450,8 +450,8 @@ function constraint(
450
450
start = zero (T),
451
451
lcon = zero (T),
452
452
ucon = zero (T),
453
- ) where {T,C<: ExaCore{T} }
454
-
453
+ ) where {T,C<: ExaCore{T} }
454
+
455
455
gen = _adapt_gen (gen)
456
456
f = SIMDFunction (gen, c. ncon, c. nnzj, c. nnzh)
457
457
pars = gen. iter
@@ -512,7 +512,7 @@ function _constraint(c, f, pars, start, lcon, ucon)
512
512
end
513
513
514
514
function constraint! (c:: C , c1, gen:: Base.Generator ) where {C<: ExaCore }
515
-
515
+
516
516
gen = _adapt_gen (gen)
517
517
f = SIMDFunction (gen, offset0 (c1, 0 ), c. nnzj, c. nnzh)
518
518
pars = gen. iter
@@ -648,7 +648,7 @@ function hess_coord!(
648
648
x:: AbstractVector ,
649
649
y:: AbstractVector ,
650
650
hess:: AbstractVector ;
651
- obj_weight = one (eltype (x)),
651
+ obj_weight = one (eltype (x)),
652
652
)
653
653
654
654
fill! (hess, zero (eltype (hess)))
@@ -707,21 +707,23 @@ end
707
707
@inbounds @inline offset0 (a:: C , i) where {C<: ConstraintAug } = offset0 (a. f, a. itr, i)
708
708
@inbounds @inline offset0 (f:: F , itr, i) where {P<: Pair ,F<: SIMDFunction{P} } =
709
709
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))
711
712
712
713
@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))
714
716
@inline function _idx (n, (vec1, vec... ), (si1, si... ))
715
717
d, r = divrem (n, si1)
716
- return (vec1[r + 1 ], _idx (d, vec, si)... )
718
+ return (vec1[r+ 1 ], _idx (d, vec, si)... )
717
719
end
718
- @inline _idx (n, (vec,), :: Tuple{Int} ) = @inbounds vec[n + 1 ]
720
+ @inline _idx (n, (vec,), :: Tuple{Int} ) = @inbounds vec[n+ 1 ]
719
721
720
722
@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 ])
722
724
@inline _idxx (:: Tuple{} , :: Tuple{} , a) = 0
723
725
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)... )
725
727
@inline coord (itr, i, :: Tuple{} ) = ()
726
728
727
729
for (thing, val) in [(:solution , 1 ), (:multipliers_L , 0 ), (:multipliers_U , 2 )]
801
803
802
804
803
805
_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