File : lin.ads


with Reps;
use Reps;

package Lin is

  pragma Pure;

  type Trip is
    record
      I: Integer;
      J: Integer;
      R: Rep;
  end record;

  type Sparse is array(Integer range <>) of Trip;                             -- range needs to start at 0

  Matrix_Full: exception;

  function Length(W: in Sparse) return Integer;                               -- Number of filled elements
  procedure SetZero(W: out Sparse);                                           -- W := 0
  procedure AddComponent(U: in Trip; W : in out Sparse; Cut: in Rep := Zero); -- Add R to W(i,j) if |R|>Cut

end Lin;