Skip to content

Commit c4f0a0f

Browse files
committed
2 parents 5ca5806 + 32c38b4 commit c4f0a0f

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/MOIWrapper.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ MOI = MathOptInterface
66

77
export CSDPOptimizer
88

9-
type CSDPSDOptimizer <: SDOI.AbstractSDOptimizer
9+
mutable struct CSDPSDOptimizer <: SDOI.AbstractSDOptimizer
1010
C
1111
b
1212
As

src/MPBWrapper.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ importall SemidefiniteModels
33

44
export CSDPMathProgModel, CSDPSolver
55

6-
immutable CSDPSolver <: AbstractMathProgSolver
6+
struct CSDPSolver <: AbstractMathProgSolver
77
options::Dict{Symbol,Any}
88
end
99
CSDPSolver(;kwargs...) = CSDPSolver(checkoptions(Dict{Symbol,Any}(kwargs)))
1010

11-
type CSDPMathProgModel <: AbstractSDModel
11+
mutable struct CSDPMathProgModel <: AbstractSDModel
1212
C
1313
b
1414
As

src/blockmat.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import Base.convert, Base.size, Base.getindex, Base.setindex!
55

66
# Utils
77

8-
function fptr{T}(x::Vector{T})
8+
function fptr(x::Vector{T}) where T
99
# CSDP starts indexing at 1 so we need to do "- sizeof(T)"
1010
pointer(x) - sizeof(T)
1111
end
1212

13-
function ptr{X}(x::X)
13+
function ptr(x::X) where X
1414
Base.reinterpret(Base.Ptr{X}, Base.pointer_from_objref(x))
1515
end
1616
export fptr, ptr
@@ -20,7 +20,7 @@ function mywrap(X::blockmatrix)
2020
BlockMatrix(X)
2121
end
2222

23-
function mywrap{T}(x::Ptr{T}, len)
23+
function mywrap(x::Ptr{T}, len) where T
2424
# I give false to unsafe_wrap to specify that Julia do not own the array so it should not free it
2525
# because the pointer it has has an offset
2626
y = unsafe_wrap(Array, x + sizeof(T), len, false)
@@ -47,7 +47,7 @@ end
4747
# * blockmatrix contains the number of blocks and a vector containing the blocks (blockrec) (1-indexed)
4848

4949
# blockrec
50-
type BlockRec <: AbstractMatrix{Cdouble}
50+
mutable struct BlockRec <: AbstractMatrix{Cdouble}
5151
_blockdatarec::Vector{Cdouble}
5252
csdp::blockrec
5353
end
@@ -110,7 +110,7 @@ end
110110

111111

112112
# blockmatrix
113-
type BlockMatrix <: AbstractMatrix{Cdouble}
113+
mutable struct BlockMatrix <: AbstractMatrix{Cdouble}
114114
jblocks::Vector{BlockRec}
115115
blocks::Vector{blockrec}
116116
csdp::blockmatrix
@@ -171,7 +171,7 @@ end
171171
# * sparseblock contains a sparse description of the entries of a block
172172
# * constraintmatrix contains a linked list of the blocks
173173

174-
type SparseBlock <: AbstractMatrix{Cdouble}
174+
mutable struct SparseBlock <: AbstractMatrix{Cdouble}
175175
i::Vector{csdpshort}
176176
j::Vector{csdpshort}
177177
v::Vector{Cdouble}
@@ -264,7 +264,7 @@ function setindex!(A::SparseBlock, v, i, j)
264264
end
265265

266266

267-
type ConstraintMatrix <: AbstractMatrix{Cdouble}
267+
mutable struct ConstraintMatrix <: AbstractMatrix{Cdouble}
268268
jblocks::Vector{SparseBlock}
269269
csdp::constraintmatrix
270270
end
@@ -338,7 +338,7 @@ export free_blockmatrix
338338
export BlockMatrix, ConstraintMatrix
339339

340340
"""Solver status"""
341-
type Csdp
341+
mutable struct Csdp
342342
n::Cint
343343
k::Cint
344344
X::BlockMatrix

test/jl_ref.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ const OP1 = UInt32(0)
1212
const OP2 = UInt32(1)
1313

1414
"""Simple type containing an enum and Ptr"""
15-
type S
15+
mutable struct S
1616
c::UInt32
1717
n::Cint
1818
e::Ptr{Cdouble}
1919
end
2020

2121

2222
"""Use Ref instead of Ptr"""
23-
type R
23+
mutable struct R
2424
c::UInt32
2525
n::Cint
2626
e::Ref{Cdouble}

0 commit comments

Comments
 (0)