pub fn load_problem(filename: &str) -> Result<SvmProb> {
    let f = try!(File::open(filename).map_err(SvmErr::IoError));
    let file = BufReader::new(&f);

    let mut y = Vec::new();
    let mut x = Vec::new();
    for line in file.lines() {
        let line_str = try!(line.map_err(SvmErr::IoError));
        let (y_line, x_line) = try!(parse_line(&line_str));
        y.push(y_line);
        x.push(x_line);
    }
    sparse_problem(y, x)
}
/// Load a problem from file.
Load a problem from file.
Load a problem from file .
pub fn load_problem(filename: &str) -> Result<SvmProb> {
    let f = try!(File::open(filename).map_err(SvmErr::IoError));
    let file = BufReader::new(&f);
    let mut y = Vec::new();
    let mut x = Vec::new();
    for line in file.lines() {
        let line_str = try!(line.map_err(SvmErr::IoError));
        let (y_line, x_line) = try!(parse_line(&line_str));
        y.push(y_line);
        x.push(x_line);
    }
    sparse_problem(y, x)
}
pub fn load_problem ( filename : & str ) -> Result < SvmProb > { let f = try ! ( File open ( filename ) map_err ( SvmErr IoError ) ) ; let file = BufReader :: new ( & f ) ; let mut y = Vec :: new ( ) ; let mut x = Vec :: new ( ) ; for line in file . lines ( ) { let line_str = try ! ( line map_err ( SvmErr IoError ) ) ; let ( y_line , x_line ) = try ! ( parse_line ( line_str ) ) ; y . push ( y_line ) ; x . push ( x_line ) ; } sparse_problem ( y , x ) }
Load a problem from file.
Load a problem from file .
filename
&str
filename
&str