liba 0.1.3

An algorithm library based on C/C++ language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
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
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
from typing import Iterable, overload
from array import array

def array_i8(o: object) -> array[int]: ...
def array_u8(o: object) -> array[int]: ...
def array_i16(o: object) -> array[int]: ...
def array_u16(o: object) -> array[int]: ...
def array_i32(o: object) -> array[int]: ...
def array_u32(o: object) -> array[int]: ...
def array_i64(o: object) -> array[int]: ...
def array_u64(o: object) -> array[int]: ...
def array_f32(o: object) -> array[float]: ...
def array_f64(o: object) -> array[float]: ...
def array_num(o: object) -> array[float]: ...
def hash_bkdr(str: bytes, val: int = 0) -> int: ...
def hash_sdbm(str: bytes, val: int = 0) -> int: ...
def isqrt(x: int) -> int: ...
@overload
def sqrt_u32(x: Iterable[int]) -> array[int]: ...
@overload
def sqrt_u32(x: int) -> int: ...
@overload
def sqrt_u64(x: Iterable[int]) -> array[int]: ...
@overload
def sqrt_u64(x: int) -> int: ...
@overload
def rsqrt_f32(x: Iterable[float]) -> array[float]: ...
@overload
def rsqrt_f32(x: float) -> float: ...
@overload
def rsqrt_f64(x: Iterable[float]) -> array[float]: ...
@overload
def rsqrt_f64(x: float) -> float: ...

class crc8:
    def __init__(self, poly: int, reversed=False) -> None: ...
    def gen(self, poly: int, reversed=False) -> crc8: ...
    def __call__(self, block: bytes, value=0) -> int: ...
    def pack(self, block: bytes, value=0) -> bytes: ...
    @property
    def table(self) -> array[int]: ...

class crc16:
    def __init__(self, poly: int, reversed=False) -> None: ...
    def gen(self, poly: int, reversed=False) -> crc16: ...
    def __call__(self, block: bytes, value=0) -> int: ...
    def pack(self, block: bytes, value=0) -> bytes: ...
    @property
    def table(self) -> array[int]: ...

class crc32:
    def __init__(self, poly: int, reversed=False) -> None: ...
    def gen(self, poly: int, reversed=False) -> crc32: ...
    def __call__(self, block: bytes, value=0) -> int: ...
    def pack(self, block: bytes, value=0) -> bytes: ...
    @property
    def table(self) -> array[int]: ...

class crc64:
    def __init__(self, poly: int, reversed=False) -> None: ...
    def gen(self, poly: int, reversed=False) -> crc64: ...
    def __call__(self, block: bytes, value=0) -> int: ...
    def pack(self, block: bytes, value=0) -> bytes: ...
    @property
    def table(self) -> array[int]: ...

class hpf:
    def __init__(self, fc: float, ts: float) -> None: ...
    def gen(self, fc: float, ts: float) -> hpf: ...
    def __call__(self, x: float) -> float: ...
    def zero(self) -> hpf: ...
    @property
    def alpha(self) -> float: ...
    @alpha.setter
    def alpha(self, x: float) -> None: ...
    @property
    def output(self) -> float: ...
    @property
    def input(self) -> float: ...

class lpf:
    def __init__(self, fc: float, ts: float) -> None: ...
    def gen(self, fc: float, ts: float) -> lpf: ...
    def __call__(self, x: float) -> float: ...
    def zero(self) -> lpf: ...
    @property
    def alpha(self) -> float: ...
    @alpha.setter
    def alpha(self, x: float) -> None: ...
    @property
    def output(self) -> float: ...

class mf:
    NUL: int
    GAUSS: int
    GAUSS2: int
    GBELL: int
    SIG: int
    DSIG: int
    PSIG: int
    TRAP: int
    TRI: int
    LINS: int
    LINZ: int
    S: int
    Z: int
    PI: int
    @staticmethod
    @overload
    def __call__(e: int, x: Iterable[float], a: Iterable[float]) -> array[float]: ...
    @staticmethod
    @overload
    def __call__(e: int, x: float, a: Iterable[float]) -> float: ...
    @staticmethod
    @overload
    def gauss(x: Iterable[float], sigma: float, c: float) -> array[float]: ...
    @staticmethod
    @overload
    def gauss(x: float, sigma: float, c: float) -> float: ...
    @staticmethod
    @overload
    def gauss2(
        x: Iterable[float], sigma1: float, c1: float, sigma2: float, c2: float
    ) -> array[float]: ...
    @staticmethod
    @overload
    def gauss2(x: float, sigma1: float, c1: float, sigma2: float, c2: float) -> float: ...
    @staticmethod
    @overload
    def gbell(x: Iterable[float], a: float, b: float, c: float) -> array[float]: ...
    @staticmethod
    @overload
    def gbell(x: float, a: float, b: float, c: float) -> float: ...
    @staticmethod
    @overload
    def sig(x: Iterable[float], a: float, c: float) -> array[float]: ...
    @staticmethod
    @overload
    def sig(x: float, a: float, c: float) -> float: ...
    @staticmethod
    @overload
    def dsig(x: Iterable[float], a1: float, c1: float, a2: float, c2: float) -> array[float]: ...
    @staticmethod
    @overload
    def dsig(x: float, a1: float, c1: float, a2: float, c2: float) -> float: ...
    @staticmethod
    @overload
    def psig(x: Iterable[float], a1: float, c1: float, a2: float, c2: float) -> array[float]: ...
    @staticmethod
    @overload
    def psig(x: float, a1: float, c1: float, a2: float, c2: float) -> float: ...
    @staticmethod
    @overload
    def trap(x: Iterable[float], a: float, b: float, c: float, d: float) -> array[float]: ...
    @staticmethod
    @overload
    def trap(x: float, a: float, b: float, c: float, d: float) -> float: ...
    @staticmethod
    @overload
    def tri(x: Iterable[float], a: float, b: float, c: float) -> array[float]: ...
    @staticmethod
    @overload
    def tri(x: float, a: float, b: float, c: float) -> float: ...
    @staticmethod
    @overload
    def lins(x: Iterable[float], a: float, b: float) -> array[float]: ...
    @staticmethod
    @overload
    def lins(x: float, a: float, b: float) -> float: ...
    @staticmethod
    @overload
    def linz(x: Iterable[float], a: float, b: float) -> array[float]: ...
    @staticmethod
    @overload
    def linz(x: float, a: float, b: float) -> float: ...
    @staticmethod
    @overload
    def s(x: Iterable[float], a: float, b: float) -> array[float]: ...
    @staticmethod
    @overload
    def s(x: float, a: float, b: float) -> float: ...
    @staticmethod
    @overload
    def z(x: Iterable[float], a: float, b: float) -> array[float]: ...
    @staticmethod
    @overload
    def z(x: float, a: float, b: float) -> float: ...
    @staticmethod
    @overload
    def pi(x: Iterable[float], a: float, b: float, c: float, d: float) -> array[float]: ...
    @staticmethod
    @overload
    def pi(x: float, a: float, b: float, c: float, d: float) -> float: ...

class pid:
    RUN: int
    POS: int
    INC: int
    def __init__(self) -> None: ...
    def kpid(self, kp: float, ki: float, kd: float) -> pid: ...
    def run(self, set: float, fdb: float) -> float: ...
    def pos(self, set: float, fdb: float) -> float: ...
    def inc(self, set: float, fdb: float) -> float: ...
    def zero(self) -> pid: ...
    @property
    def kp(self) -> float: ...
    @kp.setter
    def kp(self, kp: float) -> None: ...
    @property
    def ki(self) -> float: ...
    @ki.setter
    def ki(self, ki: float) -> None: ...
    @property
    def kd(self) -> float: ...
    @kd.setter
    def kd(self, kd: float) -> None: ...
    @property
    def summax(self) -> float: ...
    @summax.setter
    def summax(self, summax: float) -> None: ...
    @property
    def summin(self) -> float: ...
    @summin.setter
    def summin(self, summin: float) -> None: ...
    @property
    def outmax(self) -> float: ...
    @outmax.setter
    def outmax(self, outmax: float) -> None: ...
    @property
    def outmin(self) -> float: ...
    @outmin.setter
    def outmin(self, outmin: float) -> None: ...
    @property
    def out(self) -> float: ...
    @property
    def fdb(self) -> float: ...
    @property
    def err(self) -> float: ...

class pid_fuzzy:
    CAP: int
    CAP_ALGEBRA: int
    CAP_BOUNDED: int
    CUP: int
    CUP_ALGEBRA: int
    CUP_BOUNDED: int
    EQU: int
    def __init__(self) -> None: ...
    def op(self, op: int) -> pid_fuzzy: ...
    def rule(
        self,
        me: Iterable[Iterable[float]],
        mec: Iterable[Iterable[float]],
        mkp: Iterable[Iterable[float]],
        mki: Iterable[Iterable[float]],
        mkd: Iterable[Iterable[float]],
    ) -> pid_fuzzy: ...
    def set_joint(self, num: int) -> pid_fuzzy: ...
    def kpid(self, kp: float, ki: float, kd: float) -> pid_fuzzy: ...
    def run(self, set: float, fdb: float) -> float: ...
    def pos(self, set: float, fdb: float) -> float: ...
    def inc(self, set: float, fdb: float) -> float: ...
    def zero(self) -> pid_fuzzy: ...
    @property
    def joint(self) -> int: ...
    @joint.setter
    def joint(self, joint: int) -> None: ...
    @property
    def kp(self) -> float: ...
    @kp.setter
    def kp(self, kp: float) -> None: ...
    @property
    def ki(self) -> float: ...
    @ki.setter
    def ki(self, ki: float) -> None: ...
    @property
    def kd(self) -> float: ...
    @kd.setter
    def kd(self, kd: float) -> None: ...
    @property
    def summax(self) -> float: ...
    @summax.setter
    def summax(self, summax: float) -> None: ...
    @property
    def summin(self) -> float: ...
    @summin.setter
    def summin(self, summin: float) -> None: ...
    @property
    def outmax(self) -> float: ...
    @outmax.setter
    def outmax(self, outmax: float) -> None: ...
    @property
    def outmin(self) -> float: ...
    @outmin.setter
    def outmin(self, outmin: float) -> None: ...
    @property
    def out(self) -> float: ...
    @property
    def fdb(self) -> float: ...
    @property
    def err(self) -> float: ...
    @property
    def order(self) -> int: ...

class pid_neuro:
    def __init__(self) -> None: ...
    def kpid(self, k: float, kp: float, ki: float, kd: float) -> pid_neuro: ...
    def wpid(self, wp: float, wi: float, wd: float) -> pid_neuro: ...
    def run(self, set: float, fdb: float) -> float: ...
    def inc(self, set: float, fdb: float) -> float: ...
    def zero(self) -> pid_neuro: ...
    @property
    def k(self) -> float: ...
    @k.setter
    def k(self, k: float) -> None: ...
    @property
    def kp(self) -> float: ...
    @kp.setter
    def kp(self, kp: float) -> None: ...
    @property
    def ki(self) -> float: ...
    @ki.setter
    def ki(self, ki: float) -> None: ...
    @property
    def kd(self) -> float: ...
    @kd.setter
    def kd(self, kd: float) -> None: ...
    @property
    def wp(self) -> float: ...
    @wp.setter
    def wp(self, wp: float) -> None: ...
    @property
    def wi(self) -> float: ...
    @wi.setter
    def wi(self, wi: float) -> None: ...
    @property
    def wd(self) -> float: ...
    @wd.setter
    def wd(self, wd: float) -> None: ...
    @property
    def summax(self) -> float: ...
    @summax.setter
    def summax(self, summax: float) -> None: ...
    @property
    def summin(self) -> float: ...
    @summin.setter
    def summin(self, summin: float) -> None: ...
    @property
    def outmax(self) -> float: ...
    @outmax.setter
    def outmax(self, outmax: float) -> None: ...
    @property
    def outmin(self) -> float: ...
    @outmin.setter
    def outmin(self, outmin: float) -> None: ...
    @property
    def out(self) -> float: ...
    @property
    def fdb(self) -> float: ...
    @property
    def err(self) -> float: ...
    @property
    def ec(self) -> float: ...

@overload
def poly_eval(x: Iterable[float], *a: float) -> array[float]: ...
@overload
def poly_eval(x: float, *a: float) -> float: ...
@overload
def poly_evar(x: Iterable[float], *a: float) -> array[float]: ...
@overload
def poly_evar(x: float, *a: float) -> float: ...

class polytraj3:
    def __init__(
        self,
        ts: float,
        q0: float,
        q1: float,
        v0: float = 0,
        v1: float = 0,
    ) -> None: ...
    def gen(
        self,
        ts: float,
        q0: float,
        q1: float,
        v0: float = 0,
        v1: float = 0,
    ) -> polytraj3: ...
    @overload
    def pos(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def pos(self, dt: float) -> float: ...
    @overload
    def vel(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def vel(self, dt: float) -> float: ...
    @overload
    def acc(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def acc(self, dt: float) -> float: ...
    @property
    def q(self) -> array[float]: ...
    @property
    def v(self) -> array[float]: ...
    @property
    def a(self) -> array[float]: ...

class polytraj5:
    def __init__(
        self,
        ts: float,
        q0: float,
        q1: float,
        v0: float = 0,
        v1: float = 0,
        a0: float = 0,
        a1: float = 0,
    ) -> None: ...
    def gen(
        self,
        ts: float,
        q0: float,
        q1: float,
        v0: float = 0,
        v1: float = 0,
        a0: float = 0,
        a1: float = 0,
    ) -> polytraj5: ...
    @overload
    def pos(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def pos(self, dt: float) -> float: ...
    @overload
    def vel(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def vel(self, dt: float) -> float: ...
    @overload
    def acc(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def acc(self, dt: float) -> float: ...
    @property
    def q(self) -> array[float]: ...
    @property
    def v(self) -> array[float]: ...
    @property
    def a(self) -> array[float]: ...

class polytraj7:
    def __init__(
        self,
        ts: float,
        q0: float,
        q1: float,
        v0: float = 0,
        v1: float = 0,
        a0: float = 0,
        a1: float = 0,
        j0: float = 0,
        j1: float = 0,
    ) -> None: ...
    def gen(
        self,
        ts: float,
        q0: float,
        q1: float,
        v0: float = 0,
        v1: float = 0,
        a0: float = 0,
        a1: float = 0,
        j0: float = 0,
        j1: float = 0,
    ) -> polytraj7: ...
    @overload
    def pos(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def pos(self, dt: float) -> float: ...
    @overload
    def vel(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def vel(self, dt: float) -> float: ...
    @overload
    def acc(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def acc(self, dt: float) -> float: ...
    @overload
    def jer(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def jer(self, dt: float) -> float: ...
    @property
    def q(self) -> array[float]: ...
    @property
    def v(self) -> array[float]: ...
    @property
    def a(self) -> array[float]: ...
    @property
    def j(self) -> array[float]: ...

class tf:
    def __init__(self, num: Iterable[float], den: Iterable[float]) -> None: ...
    @property
    def input(self) -> array[float]: ...
    @property
    def num(self) -> array[float]: ...
    @num.setter
    def num(self, num: Iterable[float]) -> None: ...
    @property
    def output(self) -> array[float]: ...
    @property
    def den(self) -> array[float]: ...
    @den.setter
    def den(self, den: Iterable[float]) -> None: ...
    def __call__(self, x: float) -> float: ...
    def zero(self) -> tf: ...

class traptraj:
    def __init__(
        self,
        qm: float,
        vm: float,
        ac: float,
        de: float,
        vs: float = 0,
        ve: float = 0,
    ) -> None: ...
    def gen(
        self,
        qm: float,
        vm: float,
        ac: float,
        de: float,
        vs: float = 0,
        ve: float = 0,
    ) -> float: ...
    @overload
    def pos(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def pos(self, dt: float) -> float: ...
    @overload
    def vel(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def vel(self, dt: float) -> float: ...
    @overload
    def acc(self, dt: Iterable[float]) -> array[float]: ...
    @overload
    def acc(self, dt: float) -> float: ...
    @property
    def ac(self) -> float: ...
    @property
    def de(self) -> float: ...
    @property
    def ta(self) -> float: ...
    @property
    def qa(self) -> float: ...
    @property
    def tc(self) -> float: ...
    @property
    def qc(self) -> float: ...
    @property
    def td(self) -> float: ...
    @property
    def qd(self) -> float: ...
    @property
    def vs(self) -> float: ...
    @property
    def vc(self) -> float: ...
    @property
    def ve(self) -> float: ...

class version:
    @staticmethod
    def check(major: int = 0, minor: int = 0, patch: int = 0) -> int: ...
    def __init__(self, major: int = 0, minor: int = 0, third: int = 0, extra: int = 0) -> None: ...
    def compare(self, other: version) -> int: ...
    def __lt__(self, other: version) -> bool: ...
    def __gt__(self, other: version) -> bool: ...
    def __le__(self, other: version) -> bool: ...
    def __ge__(self, other: version) -> bool: ...
    def __eq__(self, other: version) -> bool: ...
    def __ne__(self, other: version) -> bool: ...
    def parse(self, ver: bytes) -> version: ...
    @property
    def major(self) -> int: ...
    @major.setter
    def major(self, major: int) -> None: ...
    @property
    def minor(self) -> int: ...
    @minor.setter
    def minor(self, minor: int) -> None: ...
    @property
    def third(self) -> int: ...
    @third.setter
    def third(self, third: int) -> None: ...
    @property
    def extra(self) -> int: ...
    @extra.setter
    def extra(self, extra: int) -> None: ...
    MAJOR: int
    MINOR: int
    PATCH: int
    TWEAK: int

VERSION: str