File : reps.ads



package Reps is

  type Rep is new Long_Long_Float;

  type RepVector is array(Integer range <>) of Rep;
  type RepMatrix is array(Integer range <>, Integer range <>) of Rep;

  function RMin(R1,R2: Rep) return Rep renames Rep'Min;
  function RMax(R1,R2: Rep) return Rep renames Rep'Max;
  function RMin(R1,R2,R3: Rep) return Rep;
  function RMax(R1,R2,R3: Rep) return Rep;
  procedure Fill(R: in Rep; V: out RepVector);
  function ZeroRepVec(N: in Natural) return RepVector;
  procedure Fill(R: in Rep; M: out RepMatrix);
  function ZeroRepMat(N: in Natural) return RepMatrix;

  Zero:     constant Rep := Rep(0);
  One:      constant Rep := Rep(1);
  Two:      constant Rep := Rep(2);
  Three:    constant Rep := Rep(3);
  Four:     constant Rep := Rep(4);
  Five:     constant Rep := Rep(5);
  Half:     constant Rep := One/Two;
  Quarter:  constant Rep := One/Four;

  subtype Radius is Rep range Rep(0) .. Rep'Last;
  type RadVector is array(Integer range <>) of Radius;
  subtype RadPair is RadVector(1..2);

  function Min(R1,R2: RadPair) return RadPair;
  function Between(R1,R2: RadPair; S: Rep := Half) return RadPair;

  pragma Inline (RMin,RMax,Min);

  Some_Radius:  constant Radius  := Five;
  Some_RadPair: constant RadPair := (Some_Radius,Some_Radius);

  Undefined: exception;

end Reps;