code: def __init__(self, window: CRWindow):
      self.n = window.n
      self.m = window.m
      self.window = window
      self.offsets = np.empty(self.n + 2, dtype=int)
      self.column_ranges = window.column_ranges
      self.offsets[0] = 0
      np.cumsum(window.column_lengths(), out=self.offsets[1:])
  
      len = self.offsets[-1]
  
      self.offsets = array.array("i", self.offsets)
      self.dense = array.array("f", repeat(np.inf, len))
  
imports: import array
  from abc import ABC, abstractmethod
  from itertools import repeat
  from typing import Tuple
  import numpy
  from .window import CRWindow, Window
label_desc: Use image node_id 1 to create a new SparseCostMatrix object from inherited base classes: CostMatrix with example: obj = SparseCostMatrix(window)