1 | <?php |
||
18 | class Polynomial{ |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | public $num = []; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $EXP_TABLE = []; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $LOG_TABLE = []; |
||
34 | |||
35 | /** |
||
36 | * Polynomial constructor. |
||
37 | * |
||
38 | * @param array $num |
||
39 | * @param int $shift |
||
40 | */ |
||
41 | public function __construct(array $num = [1], $shift = 0){ |
||
44 | |||
45 | /** |
||
46 | * @param array $num |
||
47 | * @param int $shift |
||
48 | * |
||
49 | * @return $this |
||
50 | */ |
||
51 | public function setNum(array $num, $shift = 0){ |
||
69 | |||
70 | /** |
||
71 | * |
||
72 | */ |
||
73 | protected function setTables(){ |
||
95 | |||
96 | /** |
||
97 | * @param array $e |
||
98 | */ |
||
99 | public function multiply(array $e){ |
||
110 | |||
111 | /** |
||
112 | * @param array $e |
||
113 | */ |
||
114 | public function mod(array $e){ |
||
128 | |||
129 | /** |
||
130 | * @param int $n |
||
131 | * |
||
132 | * @return int |
||
133 | * @throws \chillerlan\QRCode\QRCodeException |
||
134 | */ |
||
135 | public function glog($n){ |
||
143 | |||
144 | /** |
||
145 | * @param int $n |
||
146 | * |
||
147 | * @return int |
||
148 | */ |
||
149 | public function gexp($n){ |
||
160 | |||
161 | } |
||
162 |