@@ -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)
1111end
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))
1515end
1616export fptr, ptr
@@ -20,7 +20,7 @@ function mywrap(X::blockmatrix)
2020 BlockMatrix (X)
2121end
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 )
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
5353end
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
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)
264264end
265265
266266
267- type ConstraintMatrix <: AbstractMatrix{Cdouble}
267+ mutable struct ConstraintMatrix <: AbstractMatrix{Cdouble}
268268 jblocks:: Vector{SparseBlock}
269269 csdp:: constraintmatrix
270270end
@@ -338,7 +338,7 @@ export free_blockmatrix
338338export BlockMatrix, ConstraintMatrix
339339
340340""" Solver status"""
341- type Csdp
341+ mutable struct Csdp
342342 n:: Cint
343343 k:: Cint
344344 X:: BlockMatrix
0 commit comments