pub fn load_model(filename: &str) -> Result<SvmModel> {
    let cfilename = try!(CString::new(filename)
                         .map_err(|_| SvmErr::ModelError("Invalid filename.".to_owned())));
    unsafe {
        let model: *const sys::CSVMModel = sys::svm_load_model(cfilename.as_ptr());
        if model.is_null() {
            Err(SvmErr::ModelError("Failed to load model.".to_owned()))
        } else {
            Ok(SvmModel { c_model: model })
        }
    }
}
/// Load a model from file.
Load a model from file.
Load a model from file .
pub fn load_model(filename: &str) -> Result<SvmModel> {
    let cfilename = try!(CString::new(filename)
                         .map_err(|_| SvmErr::ModelError("Invalid filename.".to_owned())));
    unsafe {
        let model: *const sys::CSVMModel = sys::svm_load_model(cfilename.as_ptr());
        if model.is_null() {
            Err(SvmErr::ModelError("Failed to load model.".to_owned()))
        } else {
            Ok(SvmModel { c_model: model })
        }
    }
}
pub fn load_model ( filename : & str ) -> Result < SvmModel > { let cfilename = try ! ( CString new ( filename ) map_err ( SvmErr ModelError ( " " to_owned ( ) ) ) ) ; unsafe { let model : * const sys :: CSVMModel = sys :: svm_load_model ( cfilename . as_ptr ( ) ) ; if model . is_null ( ) { Err ( SvmErr :: ModelError ( " " . to_owned ( ) ) ) } else { Ok ( SvmModel { c_model : model } ) } } }
Load a model from file.
Load a model from file .
filename
&str
filename
&str