150
150
151
151
svmnoprint (str:: Ptr{UInt8} ):: Cvoid = nothing
152
152
153
+ const libsvm_version = Ref {Cint} (0 )
154
+
153
155
function __init__ ()
154
156
ccall ((:svm_set_print_string_function , libsvm), Cvoid,
155
157
(Ptr{Cvoid},), @cfunction (svmnoprint, Cvoid, (Ptr{UInt8},)))
158
+
159
+ libsvm_version[] = unsafe_load (cglobal ((:libsvm_version , libsvm), Cint))
156
160
end
157
161
158
162
@@ -172,7 +176,7 @@ function grp2idx(::Type{S}, labels::AbstractVector,
172
176
idx
173
177
end
174
178
175
- function instances2nodes (instances:: AbstractMatrix{U} ) where U <: Real
179
+ function instances2nodes (instances:: AbstractMatrix{<:Real} )
176
180
nfeatures = size (instances, 1 )
177
181
ninstances = size (instances, 2 )
178
182
nodeptrs = Array {Ptr{SVMNode}} (undef, ninstances)
@@ -191,7 +195,7 @@ function instances2nodes(instances::AbstractMatrix{U}) where U<:Real
191
195
(nodes, nodeptrs)
192
196
end
193
197
194
- function instances2nodes (instances:: SparseMatrixCSC{U} ) where U <: Real
198
+ function instances2nodes (instances:: SparseMatrixCSC{<:Real} )
195
199
ninstances = size (instances, 2 )
196
200
nodeptrs = Array {Ptr{SVMNode}} (undef, ninstances)
197
201
nodes = Array {SVMNode} (undef, nnz (instances)+ ninstances)
0 commit comments