-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdebug-mat.jl
53 lines (47 loc) · 1.63 KB
/
debug-mat.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright (c) 2016: CSDP.jl contributors
#
# Use of this source code is governed by an MIT-style license that can be found
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
function print_block(b::blockrec)
return ccall((:printb, CSDP.libcsdp), Nothing, (blockrec,), b)
end
function printm(A::blockmatrix)
return ccall((:printm, CSDP.libcsdp), Nothing, (blockmatrix,), A)
end
printm(A::BlockMatrix) = printm(A.csdp)
export printm
print_sparseblock(A::sparseblock) = print_sparseblock(pointer_from_objref(A))
function print_sparseblock(a::Ptr{sparseblock})
return ccall(
(:print_sparse_block, CSDP.libcsdp),
Nothing,
(Ptr{sparseblock},),
a,
)
end
function print_sizeof()
return ccall((:print_sizeof, CSDP.libcsdp), Nothing, ())
end
function print_constraints(C::Vector{constraintmatrix})
return ccall(
(:print_constraints, CSDP.libcsdp),
Nothing,
(CSDP_INT, Ptr{constraintmatrix}),
length(C),
fptr(C),
)
end
function Base.show(io::IO, b::sparseblock)
println(io, "\nsparseblock(", pointer_from_objref(b))
println(io, " next : ", b.next)
println(io, " nextbyblock : ", b.nextbyblock)
println(io, " entries : ", b.entries)
println(io, " iindices : ", b.iindices)
println(io, " jindices : ", b.jindices)
println(io, " numentries : ", b.numentries)
println(io, " blocknum : ", b.blocknum)
println(io, " blocksize : ", b.blocksize)
println(io, " constraintnum : ", b.constraintnum)
println(io, " issparse : ", b.issparse)
return println(io, ")")
end