jump-dev / ComplexOptInterface.jl

@@ -54,15 +54,15 @@
Loading
54 54
    k12 = MOI.dimension(MOI.PositiveSemidefiniteConeTriangle(n))
55 55
    k21 = MOI.dimension(MOI.PositiveSemidefiniteConeTriangle(2n)) + 1
56 56
    k22 = MOI.dimension(MOI.PositiveSemidefiniteConeTriangle(n))
57 -
    X11() = MOI.SingleVariable(variables[k11])
58 -
    X12() = MOI.SingleVariable(variables[k12])
57 +
    X11() = variables[k11]
58 +
    X12() = variables[k12]
59 59
    function X21(i, j)
60 60
        I = j
61 61
        J = n + i
62 62
        k21 = MOI.dimension(MOI.PositiveSemidefiniteConeTriangle(J - 1)) + I
63 -
        return MOI.SingleVariable(variables[k21])
63 +
        return variables[k21]
64 64
    end
65 -
    X22() = MOI.SingleVariable(variables[k22])
65 +
    X22() = variables[k22]
66 66
    con_11_22 = EQ{T}[]
67 67
    con12diag = EQ{T}[]
68 68
    con_12_21 = EQ{T}[]
@@ -159,7 +159,7 @@
Loading
159 159
    return i, j
160 160
end
161 161
162 -
function _variable_map(idx::MOIB.Variable.IndexInVector, n)
162 +
function _variable_map(idx::MOIB.IndexInVector, n)
163 163
    N = MOI.dimension(MOI.PositiveSemidefiniteConeTriangle(n))
164 164
    if idx.value <= N
165 165
        return idx.value
@@ -168,7 +168,7 @@
Loading
168 168
        return N + j * n + MOI.dimension(MOI.PositiveSemidefiniteConeTriangle(j)) + i
169 169
    end
170 170
end
171 -
function _variable(bridge::HermitianToSymmetricPSDBridge, i::MOIB.Variable.IndexInVector)
171 +
function _variable(bridge::HermitianToSymmetricPSDBridge, i::MOIB.IndexInVector)
172 172
    return bridge.variables[_variable_map(i, length(bridge.con12diag))]
173 173
end
174 174
@@ -177,7 +177,7 @@
Loading
177 177
    values = MOI.get(model, attr, bridge.psd_constraint)
178 178
    M = MOI.dimension(MOI.get(model, MOI.ConstraintSet(), bridge))
179 179
    n = length(bridge.con12diag)
180 -
    return [values[_variable_map(MOIB.Variable.IndexInVector(i), n)] for i in 1:M]
180 +
    return [values[_variable_map(MOIB.IndexInVector(i), n)] for i in 1:M]
181 181
end
182 182
183 183
# See docstring of bridge for why we ignore the dual of the constraints
@@ -217,16 +217,16 @@
Loading
217 217
end
218 218
219 219
function MOI.get(model::MOI.ModelLike, attr::MOI.VariablePrimal,
220 -
                 bridge::HermitianToSymmetricPSDBridge{T}, i::MOIB.Variable.IndexInVector) where T
220 +
                 bridge::HermitianToSymmetricPSDBridge{T}, i::MOIB.IndexInVector) where T
221 221
    value = MOI.get(model, attr, _variable(bridge, i))
222 222
end
223 223
224 -
function MOIB.bridged_function(bridge::HermitianToSymmetricPSDBridge{T}, i::MOIB.Variable.IndexInVector) where T
225 -
    func = MOI.SingleVariable(_variable(bridge, i))
224 +
function MOIB.bridged_function(bridge::HermitianToSymmetricPSDBridge{T}, i::MOIB.IndexInVector) where T
225 +
    func = _variable(bridge, i)
226 226
    return convert(MOI.ScalarAffineFunction{T}, func)
227 227
end
228 228
function MOIB.Variable.unbridged_map(bridge::HermitianToSymmetricPSDBridge{T}, vi::MOI.VariableIndex,
229 -
                       i::MOIB.Variable.IndexInVector) where T
230 -
    func = convert(MOI.ScalarAffineFunction{T}, MOI.SingleVariable(vi))
229 +
                       i::MOIB.IndexInVector) where T
230 +
    func = convert(MOI.ScalarAffineFunction{T}, vi)
231 231
    return (_variable(bridge, i) => func,)
232 232
end

@@ -19,7 +19,7 @@
Loading
19 19
    sym = MOI.PositiveSemidefiniteConeTriangle(set.side_dimension)
20 20
    result = MOI.Utilities.set_dot(x, y, sym)
21 21
    for k in (MOI.dimension(sym) + 1):MOI.dimension(set)
22 -
        result = MA.add_mul!(result, 2, x[k], y[k])
22 +
        result = MA.add_mul!!(result, 2, x[k], y[k])
23 23
    end
24 24
    return result
25 25
end
Files Coverage
src 77.99%
Project Totals (3 files) 77.99%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading