Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | smaz_generic-tools: new version of Worst_Index limited to a range |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
579aa9f314d0ed28c5c7b4b79f6e5387 |
User & Date: | nat 2017-05-15 21:34:37 |
Context
2017-05-16
| ||
21:25 | smaz-tools: new version of Worst_Index limited to a range check-in: 5388213f83 user: nat tags: trunk | |
2017-05-15
| ||
21:34 | smaz_generic-tools: new version of Worst_Index limited to a range check-in: 579aa9f314 user: nat tags: trunk | |
2017-05-14
| ||
20:16 | tools/smaz: implement forced words for unoptimized dictionary generation check-in: bb325e8d12 user: nat tags: trunk | |
Changes
Changes to src/natools-smaz_generic-tools.adb.
︙ | ︙ | |||
513 514 515 516 517 518 519 | end loop; end Evaluate_Dictionary_Partial; function Worst_Index (Dict : in Dictionary; Counts : in Dictionary_Counts; | | > | | < < | 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | end loop; end Evaluate_Dictionary_Partial; function Worst_Index (Dict : in Dictionary; Counts : in Dictionary_Counts; Method : in Smaz_Tools.Methods.Enum; First, Last : in Dictionary_Code) return Dictionary_Code is use type Smaz_Tools.Score_Value; Result : Dictionary_Code := First; Worst_Score : Smaz_Tools.Score_Value := Score (Dict, Counts, Result, Method); S : Smaz_Tools.Score_Value; begin for I in Dictionary_Code'Succ (First) .. Last loop S := Score (Dict, Counts, I, Method); if S < Worst_Score then Result := I; Worst_Score := S; end if; end loop; return Result; end Worst_Index; end Natools.Smaz_Generic.Tools; |
Changes to src/natools-smaz_generic-tools.ads.
︙ | ︙ | |||
121 122 123 124 125 126 127 128 129 130 131 | Corpus_Entry : in String; Compressed_Size : in out Ada.Streams.Stream_Element_Count; Counts : in out Dictionary_Counts); -- Compress all strings of Corpus, returning the total number of -- compressed bytes and the number of uses for each dictionary -- element. function Worst_Index (Dict : in Dictionary; Counts : in Dictionary_Counts; Method : in Smaz_Tools.Methods.Enum) | > > > > > > > > > | > > | | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | Corpus_Entry : in String; Compressed_Size : in out Ada.Streams.Stream_Element_Count; Counts : in out Dictionary_Counts); -- Compress all strings of Corpus, returning the total number of -- compressed bytes and the number of uses for each dictionary -- element. function Worst_Index (Dict : in Dictionary; Counts : in Dictionary_Counts; Method : in Smaz_Tools.Methods.Enum; First, Last : in Dictionary_Code) return Dictionary_Code with Pre => Last in First .. Dict.Last_Code; -- Return the element from the given interval with worst score function Worst_Index (Dict : in Dictionary; Counts : in Dictionary_Counts; Method : in Smaz_Tools.Methods.Enum) return Dictionary_Code is (Worst_Index (Dict, Counts, Method, Dictionary_Code'First, Dict.Last_Code)); -- Return the element with worst score in the whole directionary function Score_Encoded (Dict : in Dictionary; Counts : in Dictionary_Counts; E : in Dictionary_Code) return Smaz_Tools.Score_Value |
︙ | ︙ |