DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦06bfd057e⟧ Ada Source

    Length: 4096 (0x1000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Histo, seg_02d2fc

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



package body Histo is
    function Create_Histo return Object is
        Histo : Object := (others => 0);
    begin
        return Histo;
    end Create_Histo;


    procedure Destroy_Histo (Histo : in out Object) is
    begin
        Histo := (others => 0);
    end Destroy_Histo;


    function Get_Item_Occ
                (Item : in Discret; Histo : in Object) return Natural is
    begin
        return Histo (Item);
    end Get_Item_Occ;


    procedure Inc_Item_Occ (Item : in Discret; Histo : in out Object) is
    begin
        Histo (Item) := Histo (Item) + 1;
    end Inc_Item_Occ;


    procedure Dec_Item_Occ (Item : in Discret; Histo : in out Object) is
    begin
        if Histo (Item) > 0 then
            Histo (Item) := Histo (Item) - 1;
        end if;
    end Dec_Item_Occ;

    function Get_Max (Histo : Object) return Natural is
        I : Discret;
        Max : Natural;
    begin  
        for I in Discret'First .. Discret'Last loop
            if Max < Histo (I) then
                Max := Histo (I);
            end if;
        end loop;
        return Max;
    end Get_Max;

    procedure Put (Histo : Object) is
        Max, J : Natural := 0;
        I : Discret;

    begin
        Max := Get_Max (Histo);
        Text_Io.Put_Line ("Classe    Quantite    Histogramme");
        Text_Io.New_Line (2);
        for I in Discret'First .. Discret'Last loop
            Text_Io.Put (Discret'Image (I));
            Text_Io.Set_Col (13);
            Text_Io.Put (Natural'Image (Histo (I)));
            Text_Io.Set_Col (20);
            for J in 1 .. Natural (((80 - 20) * Histo (I)) / Max) loop
                Text_Io.Put ("#");
            end loop;
            Text_Io.New_Line (1);
        end loop;
    end Put;

end Histo;

E3 Meta Data

    nblk1=3
    nid=3
    hdr6=4
        [0x00] rec0=28 rec1=00 rec2=01 rec3=03c
        [0x01] rec0=1d rec1=00 rec2=02 rec3=001
        [0x02] rec0=0b rec1=00 rec2=00 rec3=004
    tail 0x217252cbe843f57f5bab8 0x42a00088462060003
Free Block Chain:
  0x3: 0000  00 00 00 22 00 0c 20 20 20 20 65 6e 64 20 50 75  ┆   "      end Pu┆