lbfgsbrs 0.1.1

Rust port of L-BFGS-B-C
Documentation
// Function to print a matrix
use log::debug;

pub fn print_matrix(matrix: &[f64], rows: usize, cols: usize, name: &str) {
    debug!("Matrix {}:", name);
    for i in 0..rows {
        let mut row_str = String::new();
        for j in 0..cols {
            row_str.push_str(&format!("{:8.6} ", matrix[i * cols + j]));
        }
        debug!("{}", row_str);
    }
}

// Function to print a vector
pub fn print_fvector(vector: &[f64], len: usize, name: &str) {
    debug!("Vector {}:", name);
    let mut row_str = String::new();
    for i in 0..len {
        row_str.push_str(&format!("{:8.6} ", vector[i]));
    }
    debug!("{}", row_str);
}

// Function to print a vector
pub fn print_ivector(vector: &mut [i32], len: usize, name: &str) {
    debug!("Vector {}:", name);
    let mut row_str = String::new();
    for i in 0..len {
        row_str.push_str(&format!("{:8.6} ", vector[i]));
    }
    debug!("{}", row_str);
}