DCCL v4
arithmetic.proto
1 // Copyright 2011-2023:
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
5 // File authors:
6 // Toby Schneider <toby@gobysoft.org>
7 // Chris Murphy <cmurphy@aphysci.com>
8 //
9 //
10 // This file is part of the Dynamic Compact Control Language Library
11 // ("DCCL").
12 //
13 // DCCL is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU Lesser General Public License as published by
15 // the Free Software Foundation, either version 2.1 of the License, or
16 // (at your option) any later version.
17 //
18 // DCCL is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Lesser General Public License for more details.
22 //
23 // You should have received a copy of the GNU Lesser General Public License
24 // along with DCCL. If not, see <http://www.gnu.org/licenses/>.
25 syntax = "proto2";
26 import "dccl/option_extensions.proto";
27 
28 package dccl.arith.protobuf;
29 
30 message ArithmeticModel
31 {
32  required string name = 1;
33 
34  repeated uint32 frequency =
35  10; // frequency of the symbol given by the repeated field index
36  // probability is (frequency / sum(frequency))
37  optional uint32 eof_frequency = 11
38  [default = 1]; // frequency of EOF symbol
39  optional uint32 out_of_range_frequency = 12
40  [default =
41  0]; // frequency of the out-of-range value, that is, the value not
42  // within the range defined by [symbol_to_value(0),
43  // maximum_value). This *may* be zero, in this case, out of
44  // range values end encoding and return EOF there.
45 
46  repeated double value_bound =
47  20; // set of bounds of value in double space that maps to symbol given
48  // by repeated field index; upper bound is given by lower bound of
49  // the next symbol. Size must be size(frequency) + 1 (number of
50  // symbols + 1).
51 
52  optional bool is_adaptive = 30 [default = false];
53 }