Implement line number matrix computation.