|
15 | 15 |
|
16 | 16 | isdense(data::QPDataCOO) = false
|
17 | 17 |
|
18 |
| -mutable struct QPData{T, S, M1 <: Union{AbstractMatrix{T}, AbstractLinearOperator{T}}, |
19 |
| - M2 <: Union{AbstractMatrix{T}, AbstractLinearOperator{T}}} <: AbstractQPData{T, S} |
| 18 | +mutable struct QPData{ |
| 19 | + T, |
| 20 | + S, |
| 21 | + M1 <: Union{AbstractMatrix{T}, AbstractLinearOperator{T}}, |
| 22 | + M2 <: Union{AbstractMatrix{T}, AbstractLinearOperator{T}}, |
| 23 | +} <: AbstractQPData{T, S} |
20 | 24 | c0::T # constant term in objective
|
21 | 25 | c::S # linear term
|
22 | 26 | H::M1
|
|
25 | 29 |
|
26 | 30 | isdense(data::QPData{T, S, M1, M2}) where {T, S, M1, M2} = M1 <: DenseMatrix || M2 <: DenseMatrix
|
27 | 31 |
|
28 |
| -function get_QPDataCOO(c0::T, c ::S, H::SparseMatrixCSC{T}, A::AbstractMatrix{T}) where {T, S} |
| 32 | +function get_QPDataCOO(c0::T, c::S, H::SparseMatrixCSC{T}, A::AbstractMatrix{T}) where {T, S} |
29 | 33 | ncon, nvar = size(A)
|
30 | 34 | tril!(H)
|
31 | 35 | nnzh, Hrows, Hcols, Hvals = nnz(H), findnz(H)...
|
@@ -451,12 +455,12 @@ function slackdata(data::QPDataCOO{T}, meta::NLPModelMeta{T}, ns::Int) where {T}
|
451 | 455 | )
|
452 | 456 | end
|
453 | 457 |
|
454 |
| -function prodPermutedMinusOnes!(res, v, α, β::T, p::Vector{Int}) where T |
| 458 | +function prodPermutedMinusOnes!(res, v, α, β::T, p::Vector{Int}) where {T} |
455 | 459 | res .= β == zero(T) ? zero(T) : β .* res
|
456 | 460 | res[p] .-= α .* v
|
457 | 461 | return res
|
458 | 462 | end
|
459 |
| -function tprodPermutedMinusOnes!(res, v, α, β::T, p::Vector{Int}) where T |
| 463 | +function tprodPermutedMinusOnes!(res, v, α, β::T, p::Vector{Int}) where {T} |
460 | 464 | res .= β == zero(T) ? zero(T) : β .* res
|
461 | 465 | res .-= @views α .* v[p]
|
462 | 466 | return res
|
|
0 commit comments