fn solve(H: DMatrix<f64>, b: &DVector<f64>) -> Result<Vec<f64>, String> {
        // TODO @Daniel: pass matrix as sparse already
        let sparse = CsCholesky::new(&CsMatrix::from(H));
        match sparse.l() {
            None => Err(String::from("H is not positive-definite")),
            Some(l) => Ok(l
                .tr_solve_lower_triangular(&l.solve_lower_triangular(&b).unwrap())
                .unwrap()
                .data
                .into()),
        }
    }
/// Assumes that H is symmetric. Might return wrong result if this is not the case.
Assumes that H is symmetric. Might return wrong result if this is not the case.
Assumes that H is symmetric . Might return wrong result if this is not the case .
fn solve(H: DMatrix<f64>, b: &DVector<f64>) -> Result<Vec<f64>, String> {
        // TODO @Daniel: pass matrix as sparse already
        let sparse = CsCholesky::new(&CsMatrix::from(H));
        match sparse.l() {
            None => Err(String::from("H is not positive-definite")),
            Some(l) => Ok(l
                .tr_solve_lower_triangular(&l.solve_lower_triangular(&b).unwrap())
                .unwrap()
                .data
                .into()),
        }
    }
fn solve ( H : DMatrix < f64 > , b : & DVector < f64 > ) -> Result < Vec < f64 > , String > { // TODO @Daniel: pass matrix as sparse already let sparse = CsCholesky :: new ( & CsMatrix :: from ( H ) ) ; match sparse . l ( ) { None => Err ( String :: from ( " " ) ) , Some ( l ) => Ok ( l . tr_solve_lower_triangular ( & l . solve_lower_triangular ( & b ) . unwrap ( ) ) . unwrap ( ) . data . into ( ) ) , } }
Assumes that H is symmetric.
Assumes that H is symmetric .
H
DMatrix<f64>
b
&DVector<f64>