Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 55f35e82 authored by Ricardo Buring's avatar Ricardo Buring
Browse files

Print number of non-zero entries in the matrix

parent 502aefeb
Branches master
No related tags found
No related merge requests found
......@@ -61,6 +61,7 @@ fn main() -> std::io::Result<()> {
let header_line_length: usize = 64;
writeln!(sparse_matrix_file, "{}", "x".repeat(header_line_length))?;
let mut num_nonzeros: usize = 0;
let mut g_idx: usize = 0;
loop {
// dbg!(&g_idx);
......@@ -82,6 +83,7 @@ fn main() -> std::io::Result<()> {
};
// TODO: Make the output lexicographically ordered? Strictly speaking this is not the SMS format right now.
writeln!(sparse_matrix_file, "{} {} {}", dg_idx + 1, g_idx + 1, c)?;
num_nonzeros += 1;
let cg_data: HashMap<UndirectedGraph, HashMap<usize, usize>> =
dg.contractions(&dg_edge_orbits);
......@@ -113,9 +115,10 @@ fn main() -> std::io::Result<()> {
writeln!(sparse_matrix_file, "{}", header_line)?;
eprintln!(
"Matrix size: {} x {}",
"Sparse {} x {} matrix with {} non-zero entries",
cocycle_differential_graphs.len(),
cocycle_graphs.len()
cocycle_graphs.len(),
num_nonzeros
);
// TODO: Also output the ordered bases of graphs.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment