pub const LIBSVM_VERSION: u32 = 324;
extern "C" {
pub static mut libsvm_version: ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct svm_node {
pub index: ::std::os::raw::c_int,
pub value: f64,
}
#[test]
fn bindgen_test_layout_svm_node() {
assert_eq!(
::std::mem::size_of::<svm_node>(),
16usize,
concat!("Size of: ", stringify!(svm_node))
);
assert_eq!(
::std::mem::align_of::<svm_node>(),
8usize,
concat!("Alignment of ", stringify!(svm_node))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_node>())).index as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(svm_node),
"::",
stringify!(index)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_node>())).value as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(svm_node),
"::",
stringify!(value)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct svm_problem {
pub l: ::std::os::raw::c_int,
pub y: *mut f64,
pub x: *mut *mut svm_node,
}
#[test]
fn bindgen_test_layout_svm_problem() {
assert_eq!(
::std::mem::size_of::<svm_problem>(),
24usize,
concat!("Size of: ", stringify!(svm_problem))
);
assert_eq!(
::std::mem::align_of::<svm_problem>(),
8usize,
concat!("Alignment of ", stringify!(svm_problem))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_problem>())).l as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(svm_problem),
"::",
stringify!(l)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_problem>())).y as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(svm_problem),
"::",
stringify!(y)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_problem>())).x as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(svm_problem),
"::",
stringify!(x)
)
);
}
pub const C_SVC: _bindgen_ty_1 = 0;
pub const NU_SVC: _bindgen_ty_1 = 1;
pub const ONE_CLASS: _bindgen_ty_1 = 2;
pub const EPSILON_SVR: _bindgen_ty_1 = 3;
pub const NU_SVR: _bindgen_ty_1 = 4;
pub type _bindgen_ty_1 = u32;
pub const LINEAR: _bindgen_ty_2 = 0;
pub const POLY: _bindgen_ty_2 = 1;
pub const RBF: _bindgen_ty_2 = 2;
pub const SIGMOID: _bindgen_ty_2 = 3;
pub const PRECOMPUTED: _bindgen_ty_2 = 4;
pub type _bindgen_ty_2 = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct svm_parameter {
pub svm_type: ::std::os::raw::c_int,
pub kernel_type: ::std::os::raw::c_int,
pub degree: ::std::os::raw::c_int,
pub gamma: f64,
pub coef0: f64,
pub cache_size: f64,
pub eps: f64,
pub C: f64,
pub nr_weight: ::std::os::raw::c_int,
pub weight_label: *mut ::std::os::raw::c_int,
pub weight: *mut f64,
pub nu: f64,
pub p: f64,
pub shrinking: ::std::os::raw::c_int,
pub probability: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_svm_parameter() {
assert_eq!(
::std::mem::size_of::<svm_parameter>(),
104usize,
concat!("Size of: ", stringify!(svm_parameter))
);
assert_eq!(
::std::mem::align_of::<svm_parameter>(),
8usize,
concat!("Alignment of ", stringify!(svm_parameter))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).svm_type as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(svm_type)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).kernel_type as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(kernel_type)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).degree as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(degree)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).gamma as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(gamma)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).coef0 as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(coef0)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).cache_size as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(cache_size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).eps as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(eps)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).C as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(C)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).nr_weight as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(nr_weight)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).weight_label as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(weight_label)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).weight as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(weight)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).nu as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(nu)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).p as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(p)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).shrinking as *const _ as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(shrinking)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_parameter>())).probability as *const _ as usize },
100usize,
concat!(
"Offset of field: ",
stringify!(svm_parameter),
"::",
stringify!(probability)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct svm_model {
pub param: svm_parameter,
pub nr_class: ::std::os::raw::c_int,
pub l: ::std::os::raw::c_int,
pub SV: *mut *mut svm_node,
pub sv_coef: *mut *mut f64,
pub rho: *mut f64,
pub probA: *mut f64,
pub probB: *mut f64,
pub sv_indices: *mut ::std::os::raw::c_int,
pub label: *mut ::std::os::raw::c_int,
pub nSV: *mut ::std::os::raw::c_int,
pub free_sv: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_svm_model() {
assert_eq!(
::std::mem::size_of::<svm_model>(),
184usize,
concat!("Size of: ", stringify!(svm_model))
);
assert_eq!(
::std::mem::align_of::<svm_model>(),
8usize,
concat!("Alignment of ", stringify!(svm_model))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).param as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(param)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).nr_class as *const _ as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(nr_class)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).l as *const _ as usize },
108usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(l)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).SV as *const _ as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(SV)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).sv_coef as *const _ as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(sv_coef)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).rho as *const _ as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(rho)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).probA as *const _ as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(probA)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).probB as *const _ as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(probB)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).sv_indices as *const _ as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(sv_indices)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).label as *const _ as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(label)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).nSV as *const _ as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(nSV)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<svm_model>())).free_sv as *const _ as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(svm_model),
"::",
stringify!(free_sv)
)
);
}
extern "C" {
pub fn svm_train(prob: *const svm_problem, param: *const svm_parameter) -> *mut svm_model;
}
extern "C" {
pub fn svm_cross_validation(
prob: *const svm_problem,
param: *const svm_parameter,
nr_fold: ::std::os::raw::c_int,
target: *mut f64,
);
}
extern "C" {
pub fn svm_save_model(
model_file_name: *const ::std::os::raw::c_char,
model: *const svm_model,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn svm_load_model(model_file_name: *const ::std::os::raw::c_char) -> *mut svm_model;
}
extern "C" {
pub fn svm_get_svm_type(model: *const svm_model) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn svm_get_nr_class(model: *const svm_model) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn svm_get_labels(model: *const svm_model, label: *mut ::std::os::raw::c_int);
}
extern "C" {
pub fn svm_get_sv_indices(model: *const svm_model, sv_indices: *mut ::std::os::raw::c_int);
}
extern "C" {
pub fn svm_get_nr_sv(model: *const svm_model) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn svm_get_svr_probability(model: *const svm_model) -> f64;
}
extern "C" {
pub fn svm_predict_values(
model: *const svm_model,
x: *const svm_node,
dec_values: *mut f64,
) -> f64;
}
extern "C" {
pub fn svm_predict(model: *const svm_model, x: *const svm_node) -> f64;
}
extern "C" {
pub fn svm_predict_probability(
model: *const svm_model,
x: *const svm_node,
prob_estimates: *mut f64,
) -> f64;
}
extern "C" {
pub fn svm_free_model_content(model_ptr: *mut svm_model);
}
extern "C" {
pub fn svm_free_and_destroy_model(model_ptr_ptr: *mut *mut svm_model);
}
extern "C" {
pub fn svm_destroy_param(param: *mut svm_parameter);
}
extern "C" {
pub fn svm_check_parameter(
prob: *const svm_problem,
param: *const svm_parameter,
) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn svm_check_probability_model(model: *const svm_model) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn svm_set_print_string_function(
print_func: ::std::option::Option<
unsafe extern "C" fn(arg1: *const ::std::os::raw::c_char),
>,
);
}