Skip to content

Commit 72e6d7c

Browse files
authored
format and int generic for x86 (#13)
* format and int generic for x86 * replace implementation with dimension
1 parent 4cd3593 commit 72e6d7c

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ SCS = "c946c3f1-0d1f-5ce8-9dea-7daa1f7e2d13"
2020
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2121

2222
[targets]
23-
test = ["Test","SCS","ProxSDP","COSMO"]
23+
test = ["Test", "SCS", "ProxSDP", "COSMO"]

src/MatrixOptInterface.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ _sense(::Type{<:MOI.Interval}) = INTERVAL
1919
_no_upper(bound) = bound != typemax(bound)
2020
_no_lower(bound) = bound != typemin(bound)
2121

22-
function _bound_sense(lb::T, ub::T) where T
22+
function _bound_sense(lb::T, ub::T) where {T}
2323
if _no_upper(ub)
2424
if _no_lower(lb)
2525
if lb == ub
@@ -38,6 +38,7 @@ function _bound_sense(lb::T, ub::T) where T
3838
end
3939
end
4040
end
41+
4142
function _bound_set(lb::T, ub::T) where T
4243
if _no_upper(ub)
4344
if _no_lower(lb)

src/conic_form.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ _set_type(::MOI.ConstraintIndex{F,S}) where {F,S} = S
2626
cons_offset(conic::MOI.Zeros) = conic.dimension
2727
cons_offset(conic::MOI.Nonnegatives) = conic.dimension
2828
cons_offset(conic::MOI.SecondOrderCone) = conic.dimension
29-
cons_offset(conic::MOI.PositiveSemidefiniteConeTriangle) = Int64((conic.side_dimension*(conic.side_dimension+1))/2)
29+
cons_offset(conic::MOI.PositiveSemidefiniteConeTriangle) = MOI.dimension(conic)
3030

3131
function get_conic_form(::Type{T}, model::M, con_idx) where {T, M <: MOI.AbstractOptimizer}
3232
# extract cones
3333
cones = _set_type.(con_idx)
3434
cones = unique(cones)
3535

36-
conic = ConicForm{T, SparseMatrixCSRtoCSC{Int64}, Array{T, 1}}(Tuple(cones))
36+
conic = ConicForm{T, SparseMatrixCSRtoCSC{Int}, Array{T, 1}}(Tuple(cones))
3737

3838
idxmap = MOI.copy_to(conic, model)
3939

src/matrix_input.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ abstract type AbstractLPForm{T} <: MOI.ModelLike end
33
# FIXME Taken from Polyhedra.jl, we should maybe move this to MOIU
44
structural_nonzero_indices(a::SparseArrays.SparseVector) = SparseArrays.nonzeroinds(a)
55
structural_nonzero_indices(a::AbstractVector) = eachindex(a)
6+
67
function _dot_terms(a::AbstractVector{T}) where T
78
return MOI.ScalarAffineTerm{T}[
89
MOI.ScalarAffineTerm{T}(a[i], MOI.VariableIndex(i))

0 commit comments

Comments
 (0)