map_config_copyback

Function map_config_copyback 

Source
pub fn map_config_copyback(
    lines: &[CopyLine],
    padding: usize,
    spacing: usize,
    config: &[Vec<usize>],
    doubled_cells: &HashSet<(usize, usize)>,
) -> Vec<usize>
Expand description

Extract original vertex configurations from copyline locations.

For each copyline, count selected nodes handling doubled cells specially:

  • For doubled cells: count 1 if value is 2, or if value is 1 and both neighbors are 0
  • For regular cells: just add the value
  • Result is count - (len(locs) / 2)