create regress_simple for JavaScript
[liba.git] / javascript / liba.d.ts
blob77d792caa0b7a972218e134ff17c0d4f665f4f99
1 declare namespace liba {
2   /**
3    * square root of an unsigned integer
4    * @param x independent variable
5    * @return calculated result
6    */
7   function isqrt(x: number): number;
8   /**
9    * reciprocal of square-root
10    * @param x independent variable
11    * @return calculated result
12    */
13   function rsqrt(x: number): number;
14   /**
15    * a hash function whose prime number is 131
16    * @param block block to be processed
17    * @param value initial value
18    * @return hash value
19    */
20   function hash_bkdr(block: string, value: number): number;
21   /**
22    * a hash function whose prime number is 65599
23    * @param block block to be processed
24    * @param value initial value
25    * @return hash value
26    */
27   function hash_sdbm(block: string, value: number): number;
29   interface crc8 {
30     /** Cyclic Redundancy Check comparison table */
31     readonly table: Uint8Array;
32     /**
33      * generate for 8-bit Cyclic Redundancy Check
34      * @param poly polynomial that is CRC's divisor
35      * @param reversed is reversed?
36      */
37     gen(poly: number, reversed?: boolean): crc8;
38     /**
39      * calculate for 8-bit Cyclic Redundancy Check
40      * @param block block to be processed
41      * @param value initial value
42      * @return output value
43      */
44     eval(block: string, value: number): number;
45     /**
46      * pack a block and its CRC-8 value
47      * @param block block to be processed
48      * @param value initial value
49      * @return packed block
50      */
51     pack(block: string, value: number): Uint8Array;
52     delete(): void;
53   }
54   /** constructor for 8-bit Cyclic Redundancy Check */
55   let crc8: {
56     /**
57      * @param poly polynomial that is CRC's divisor
58      * @param reversed is reversed?
59      */
60     new(poly: number, reversed?: boolean): crc8;
61     readonly prototype: crc8;
62   };
64   interface crc16 {
65     /** Cyclic Redundancy Check comparison table */
66     readonly table: Uint16Array;
67     /**
68      * generate for 16-bit Cyclic Redundancy Check
69      * @param poly polynomial that is CRC's divisor
70      * @param reversed is reversed?
71      */
72     gen(poly: number, reversed?: boolean): crc16;
73     /**
74      * calculate for 16-bit Cyclic Redundancy Check
75      * @param block block to be processed
76      * @param value initial value
77      * @return output value
78      */
79     eval(block: string, value: number): number;
80     /**
81      * pack a block and its CRC-16 value
82      * @param block block to be processed
83      * @param value initial value
84      * @return packed block
85      */
86     pack(block: string, value: number): Uint8Array;
87     delete(): void;
88   }
89   /** constructor for 16-bit Cyclic Redundancy Check */
90   let crc16: {
91     /**
92      * @param poly polynomial that is CRC's divisor
93      * @param reversed is reversed?
94      */
95     new(poly: number, reversed?: boolean): crc16;
96     readonly prototype: crc16;
97   };
99   interface crc32 {
100     /** Cyclic Redundancy Check comparison table */
101     readonly table: Uint32Array;
102     /**
103      * generate for 32-bit Cyclic Redundancy Check
104      * @param poly polynomial that is CRC's divisor
105      * @param reversed is reversed?
106      */
107     gen(poly: number, reversed?: boolean): crc32;
108     /**
109      * calculate for 32-bit Cyclic Redundancy Check
110      * @param block block to be processed
111      * @param value initial value
112      * @return output value
113      */
114     eval(block: string, value: number): number;
115     /**
116      * pack a block and its CRC-32 value
117      * @param block block to be processed
118      * @param value initial value
119      * @return packed block
120      */
121     pack(block: string, value: number): Uint8Array;
122     delete(): void;
123   }
124   /** constructor for 32-bit Cyclic Redundancy Check */
125   let crc32: {
126     /**
127      * @param poly polynomial that is CRC's divisor
128      * @param reversed is reversed?
129      */
130     new(poly: number, reversed?: boolean): crc32;
131     readonly prototype: crc32;
132   };
134   interface crc64 {
135     /** Cyclic Redundancy Check comparison table */
136     readonly table: BigUint64Array;
137     /**
138      * generate for 64-bit Cyclic Redundancy Check
139      * @param poly polynomial that is CRC's divisor
140      * @param reversed is reversed?
141      */
142     gen(poly: bigint, reversed?: boolean): crc64;
143     /**
144      * calculate for 64-bit Cyclic Redundancy Check
145      * @param block block to be processed
146      * @param value initial value
147      * @return output value
148      */
149     eval(block: string, value: bigint): bigint;
150     /**
151      * pack a block and its CRC-64 value
152      * @param block block to be processed
153      * @param value initial value
154      * @return packed block
155      */
156     pack(block: string, value: number): Uint8Array;
157     delete(): void;
158   }
159   /** constructor for 64-bit Cyclic Redundancy Check */
160   let crc64: {
161     /**
162      * @param poly polynomial that is CRC's divisor
163      * @param reversed is reversed?
164      */
165     new(poly: bigint, reversed?: boolean): crc64;
166     readonly prototype: crc64;
167   };
169   interface hpf {
170     /** filter coefficient [0,1] */
171     readonly alpha: number;
172     /** filter output */
173     readonly output: number;
174     /** filter input */
175     readonly input: number;
176     /**
177      * generate for High Pass Filter
178      * @param fc cut-off frequency unit(hz)
179      * @param ts sampling time unit(s)
180      */
181     gen(fc: number, ts: number): hpf;
182     /**
183      * calculate for High Pass Filter
184      * @param x input value
185      * @return output value
186      */
187     iter(x: number): number;
188     /** zeroing for High Pass Filter */
189     zero(): hpf;
190     delete(): void;
191   }
192   /** constructor for High Pass Filter */
193   let hpf: {
194     /**
195      * @param fc cut-off frequency unit(hz)
196      * @param ts sampling time unit(s)
197      */
198     new(fc: number, ts: number): hpf;
199     /**
200      * @param alpha filter coefficient [0,1]
201      */
202     new(alpha: number): hpf;
203     readonly prototype: hpf;
204   };
206   interface lpf {
207     /** filter coefficient [0,1] */
208     readonly alpha: number;
209     /** filter output */
210     readonly output: number;
211     /**
212      * generate for Low Pass Filter
213      * @param fc cut-off frequency unit(hz)
214      * @param ts sampling time unit(s)
215      */
216     gen(fc: number, ts: number): lpf;
217     /**
218      * calculate for Low Pass Filter
219      * @param x input value
220      * @return output value
221      */
222     iter(x: number): number;
223     /** zeroing for Low Pass Filter */
224     zero(): lpf;
225     delete(): void;
226   }
227   /** constructor for Low Pass Filter */
228   let lpf: {
229     /**
230      * @param fc cut-off frequency unit(hz)
231      * @param ts sampling time unit(s)
232      */
233     new(fc: number, ts: number): lpf;
234     /**
235      * @param alpha filter coefficient [0,1]
236      */
237     new(alpha: number): lpf;
238     readonly prototype: lpf;
239   };
241   /** membership function */
242   let mf: {
243     /** none */
244     NUL: number;
245     /** gaussian membership function */
246     GAUSS: number;
247     /** gaussian combination membership function */
248     GAUSS2: number;
249     /** generalized bell-shaped membership function */
250     GBELL: number;
251     /** sigmoidal membership function */
252     SIG: number;
253     /** difference between two sigmoidal membership functions */
254     DSIG: number;
255     /** product of two sigmoidal membership functions */
256     PSIG: number;
257     /** trapezoidal membership function */
258     TRAP: number;
259     /** triangular membership function */
260     TRI: number;
261     /** linear s-shaped saturation membership function */
262     LINS: number;
263     /** linear z-shaped saturation membership function */
264     LINZ: number;
265     /** s-shaped membership function */
266     S: number;
267     /** z-shaped membership function */
268     Z: number;
269     /** pi-shaped membership function */
270     PI: number;
271     /**
272      * gaussian membership function
273      * @param x input value for which to compute membership value.
274      * @param sigma is the standard deviation.
275      * @param c is the mean.
276      * @return membership value.
277      */
278     gauss(x: number, sigma: number, c: number): number;
279     /**
280      * gaussian combination membership function
281      * @param x input value for which to compute membership value.
282      * @param sigma1 is the standard deviation of the left gaussian function.
283      * @param c1 is the mean of the left gaussian function.
284      * @param sigma2 is the standard deviation of the right gaussian function.
285      * @param c2 is the mean of the right gaussian function.
286      * @return membership value.
287      */
288     gauss2(x: number, sigma1: number, c1: number, sigma2: number, c2: number): number;
289     /**
290      * generalized bell-shaped membership function
291      * @param x input value for which to compute membership value.
292      * @param a defines the width of the membership function, where a larger value creates a wider membership function.
293      * @param b defines the shape of the curve on either side of the central plateau, where a larger value creates a more steep transition.
294      * @param c defines the center of the membership function.
295      * @return membership value.
296      */
297     gbell(x: number, a: number, b: number, c: number): number;
298     /**
299      * sigmoidal membership function
300      * @param x input value for which to compute membership value.
301      * @param a defines the width of the transition area.
302      * @param c defines the center of the transition area.
303      * @return membership value.
304      */
305     sig(x: number, a: number, c: number): number;
306     /**
307      * difference between two sigmoidal membership functions
308      * @param x input value for which to compute membership value.
309      * @param a1 defines the width of the first transition area.
310      * @param c1 defines the center of the first transition area.
311      * @param a2 defines the width of the second transition area.
312      * @param c2 defines the center of the second transition area.
313      * @return membership value.
314      */
315     dsig(x: number, a1: number, c1: number, a2: number, c2: number): number;
316     /**
317      * product of two sigmoidal membership functions
318      * @param x input value for which to compute membership value.
319      * @param a1 defines the width of the first transition area.
320      * @param c1 defines the center of the first transition area.
321      * @param a2 defines the width of the second transition area.
322      * @param c2 defines the center of the second transition area.
323      * @return membership value.
324      */
325     psig(x: number, a1: number, c1: number, a2: number, c2: number): number;
326     /**
327      * trapezoidal membership function
328      * @param x input value for which to compute membership value.
329      * @param a defines its left foot.
330      * @param b defines its left shoulder.
331      * @param c defines its right shoulder.
332      * @param d defines its right foot.
333      * @return membership value.
334      */
335     trap(x: number, a: number, b: number, c: number, d: number): number;
336     /**
337      * triangular membership function
338      * @param x input value for which to compute membership value.
339      * @param a defines its left foot.
340      * @param b defines its peak.
341      * @param c defines its right foot.
342      * @return membership value.
343      */
344     tri(x: number, a: number, b: number, c: number): number;
345     /**
346      * linear s-shaped saturation membership function
347      * @param x input value for which to compute membership value.
348      * @param a defines its foot.
349      * @param b defines its shoulder.
350      * @return membership value.
351      */
352     lins(x: number, a: number, b: number): number;
353     /**
354      * linear z-shaped saturation membership function
355      * @param x input value for which to compute membership value.
356      * @param a defines its shoulder.
357      * @param b defines its foot.
358      * @return membership value.
359      */
360     linz(x: number, a: number, b: number): number;
361     /**
362      * s-shaped membership function
363      * @param x input value for which to compute membership value.
364      * @param a defines its foot.
365      * @param b defines its shoulder.
366      * @return membership value.
367      */
368     s(x: number, a: number, b: number): number;
369     /**
370      * z-shaped membership function
371      * @param x input value for which to compute membership value.
372      * @param a defines its shoulder.
373      * @param b defines its foot.
374      * @return membership value.
375      */
376     z(x: number, a: number, b: number): number;
377     /**
378      * pi-shaped membership function
379      * @param x input value for which to compute membership value.
380      * @param a defines its left foot.
381      * @param b defines its left shoulder.
382      * @param c defines its right shoulder.
383      * @param d defines its right foot.
384      * @return membership value.
385      */
386     pi(x: number, a: number, b: number, c: number, d: number): number;
387   };
389   interface pid {
390     /** proportional constant */
391     kp: number;
392     /** integral constant */
393     ki: number;
394     /** derivative constant */
395     kd: number;
396     /** maximum integral output */
397     summax: number;
398     /** minimum integral output */
399     summin: number;
400     /** controller integral output */
401     readonly sum: number;
402     /** maximum final output */
403     outmax: number;
404     /** minimum final output */
405     outmin: number;
406     /** controller final output */
407     readonly out: number;
408     /** cache feedback */
409     readonly fdb: number;
410     /** cache error */
411     readonly err: number;
412     /**
413      * set proportional integral derivative constant for PID controller
414      * @param kp proportional constant
415      * @param ki integral constant
416      * @param kd derivative constant
417      */
418     set_kpid(kp: number, ki: number, kd: number): pid;
419     /**
420      * calculate for PID controller
421      * @param set setpoint value
422      * @param fdb feedback value
423      * @return setpoint value
424      */
425     run(set: number, fdb: number): number;
426     /**
427      * calculate for positional PID controller
428      * @param set setpoint value
429      * @param fdb feedback value
430      * @return output value
431      */
432     pos(set: number, fdb: number): number;
433     /**
434      * calculate for incremental PID controller
435      * @param set setpoint value
436      * @param fdb feedback value
437      * @return output value
438      */
439     inc(set: number, fdb: number): number;
440     /** zeroing for PID controller */
441     zero(): pid;
442     delete(): void;
443   }
444   /** constructor for proportional integral derivative controller */
445   let pid: {
446     new(): pid;
447     readonly prototype: pid;
448   };
450   interface pid_fuzzy {
451     /** proportional constant */
452     kp: number;
453     /** integral constant */
454     ki: number;
455     /** derivative constant */
456     kd: number;
457     /** maximum integral output */
458     summax: number;
459     /** minimum integral output */
460     summin: number;
461     /** controller integral output */
462     readonly sum: number;
463     /** maximum final output */
464     outmax: number;
465     /** minimum final output */
466     outmin: number;
467     /** controller final output */
468     readonly out: number;
469     /** cache feedback */
470     readonly fdb: number;
471     /** cache error */
472     readonly err: number;
473     /** number of order in the square matrix */
474     readonly nrule: number;
475     /** maximum number triggered by the rule */
476     nfuzz: number;
477     /**
478      * set fuzzy relational operator for fuzzy PID controller
479      * @param opr enumeration for fuzzy PID controller operator
480      */
481     set_opr(opr: number): pid_fuzzy;
482     /**
483      * set memory block for fuzzy PID controller
484      * @param num the maximum number triggered by the rule
485      */
486     set_nfuzz(num: number): pid_fuzzy;
487     /**
488      * set rule base for fuzzy PID controller
489      * @param me e's membership function parameter table
490      * @param mec ec's membership function parameter table
491      * @param mkp Kp's rule base table which must be a square matrix
492      * @param mki Ki's rule base table which must be a square matrix
493      * @param mkd Kd's rule base table which must be a square matrix
494      */
495     set_rule(me: number[][], mec: number[][], mkp: number[][], mki: number[][], mkd: number[][]): pid_fuzzy;
496     /**
497      * set proportional integral derivative constant for fuzzy PID controller
498      * @param kp proportional learning constant
499      * @param ki integral learning constant
500      * @param kd derivative learning constant
501      */
502     set_kpid(kp: number, ki: number, kd: number): pid_fuzzy;
503     /**
504      * calculate for fuzzy PID controller
505      * @param set setpoint value
506      * @param fdb feedback value
507      * @return setpoint value
508      */
509     run(set: number, fdb: number): number;
510     /**
511      * calculate for positional fuzzy PID controller
512      * @param set setpoint value
513      * @param fdb feedback value
514      * @return output value
515      */
516     pos(set: number, fdb: number): number;
517     /**
518      * calculate for incremental fuzzy PID controller
519      * @param set setpoint value
520      * @param fdb feedback value
521      * @return output value
522      */
523     inc(set: number, fdb: number): number;
524     /** zeroing for fuzzy PID controller */
525     zero(): pid_fuzzy;
526     delete(): void;
527   }
528   /** constructor for fuzzy PID controller */
529   let pid_fuzzy: {
530     new(): pid_fuzzy;
531     /** min(a,b) */
532     CAP: number;
533     /** a*b */
534     CAP_ALGEBRA: number;
535     /** max(a+b-1,0) */
536     CAP_BOUNDED: number;
537     /** max(a,b) */
538     CUP: number;
539     /** a+b-a*b */
540     CUP_ALGEBRA: number;
541     /** min(a+b,1) */
542     CUP_BOUNDED: number;
543     /** sqrt(a,b)*sqrt(1-(1-a)*(1-b)) */
544     EQU: number;
545     readonly prototype: pid_fuzzy;
546   };
548   interface pid_neuro {
549     /** proportional output coefficient */
550     k: number;
551     /** proportional learning constant */
552     kp: number;
553     /** integral learning constant */
554     ki: number;
555     /** derivative learning constant */
556     kd: number;
557     /** proportional weight */
558     wp: number;
559     /** integral weight */
560     wi: number;
561     /** derivative weight */
562     wd: number;
563     /** maximum final output */
564     outmax: number;
565     /** minimum final output */
566     outmin: number;
567     /** controller final output */
568     readonly out: number;
569     /** cache feedback */
570     readonly fdb: number;
571     /** cache error */
572     readonly err: number;
573     /** error change */
574     readonly ec: number;
575     /**
576      * set proportional integral derivative constant for single neuron PID controller
577      * @param k proportional output coefficient
578      * @param kp proportional learning constant
579      * @param ki integral learning constant
580      * @param kd derivative learning constant
581      */
582     set_kpid(k: number, kp: number, ki: number, kd: number): pid_neuro;
583     /**
584      * set proportional integral derivative weight for single neuron PID controller
585      * @param wp proportional weight
586      * @param wi integral weight
587      * @param wd derivative weight
588      */
589     set_wpid(wp: number, wi: number, wd: number): pid_neuro;
590     /**
591      * calculate for single neuron PID controller
592      * @param set setpoint value
593      * @param fdb feedback value
594      * @return setpoint value
595      */
596     run(set: number, fdb: number): number;
597     /**
598      * calculate for incremental single neuron PID controller
599      * @param set setpoint value
600      * @param fdb feedback value
601      * @return output value
602      */
603     inc(set: number, fdb: number): number;
604     /** zeroing for single neuron PID controller */
605     zero(): pid_neuro;
606     delete(): void;
607   }
608   /** constructor for single neuron PID controller */
609   let pid_neuro: {
610     new(): pid_neuro;
611     readonly prototype: pid_neuro;
612   };
614   interface regress_simple {
615     /** regression coefficient */
616     coef: number;
617     /** intercept */
618     bias: number;
619     /**
620      * calculate predicted value for simple linear regression
621      * @param val independent variable
622      * @return predicted value
623      */
624     eval(val: number): number;
625     /**
626      * calculate predicted value for simple linear regression
627      * @param val dependent variable
628      * @return predicted value
629      */
630     evar(val: number): number;
631     /**
632      * cordinary least squares for simple linear regression
633      * @param x predictor data, specified as a numeric matrix
634      * @param y response data, specified as a numeric vector
635      * @param x_mean mean of predictor data
636      * @param y_mean mean of response data
637      */
638     ols_(x: number[], y: number[], x_mean: number, y_mean: number): regress_simple;
639     /**
640      * cordinary least squares for simple linear regression
641      * @param x predictor data, specified as a numeric matrix
642      * @param y response data, specified as a numeric vector
643      * @param x_mean mean of predictor data
644      */
645     olsx(x: number[], y: number[], x_mean: number): regress_simple;
646     /**
647      * cordinary least squares for simple linear regression
648      * @param x predictor data, specified as a numeric matrix
649      * @param y response data, specified as a numeric vector
650      * @param y_mean mean of response data
651      */
652     olsy(x: number[], y: number[], y_mean: number): regress_simple;
653     /**
654      * cordinary least squares for simple linear regression
655      * @param x predictor data, specified as a numeric matrix
656      * @param y response data, specified as a numeric vector
657      */
658     ols(x: number[], y: number[]): regress_simple;
659     /** zeroing for simple linear regression */
660     zero(): regress_simple;
661     delete(): void;
662   }
663   /** constructor for simple linear regression */
664   let regress_simple: {
665     new(): regress_simple;
666     /**
667      * @param coef regression coefficient
668      */
669     new(coef: number): regress_simple;
670     /**
671      * @param coef regression coefficient
672      * @param bias intercept
673      */
674     new(coef: number, bias: number): regress_simple;
675     readonly prototype: regress_simple;
676   };
678   interface tf {
679     /** input for transfer function */
680     readonly input: Float64Array | Float32Array;
681     /** output for transfer function */
682     readonly output: Float64Array | Float32Array;
683     /** numerator for transfer function */
684     num: Float64Array | Float32Array;
685     /** denominator for transfer function */
686     den: Float64Array | Float32Array;
687     /**
688      * set numerator for transfer function
689      * @param num numerator
690      */
691     set_num(num: number[]): tf;
692     /**
693      * set denominator for transfer function
694      * @param den denominator
695      */
696     set_den(den: number[]): tf;
697     /**
698      * calculate for transfer function
699      * @param x transfer function input
700      * @return transfer function output
701      */
702     iter(x: number): number;
703     /** zeroing for transfer function */
704     zero(): tf;
705     delete(): void;
706   }
707   /** constructor for transfer function */
708   let tf: {
709     /**
710      * @param num numerator
711      * @param den denominator
712      */
713     new(num: number[], den: number[]): tf;
714     readonly prototype: tf;
715   };
717   interface trajbell {
718     /** total duration */
719     readonly t: number;
720     /** constant velocity phase */
721     readonly tv: number;
722     /** acceleration phase */
723     readonly ta: number;
724     /** deceleration phase */
725     readonly td: number;
726     /** time-interval in which the jerk is constant (j max or j min ) during the acceleration phase */
727     readonly taj: number;
728     /** time-interval in which the jerk is constant (j max or j min ) during the deceleration phase */
729     readonly tdj: number;
730     /** initial position */
731     readonly p0: number;
732     /** final position */
733     readonly p1: number;
734     /** initial velocity */
735     readonly v0: number;
736     /** final velocity */
737     readonly v1: number;
738     /** maximum velocity */
739     readonly vm: number;
740     /** maximum jerk */
741     readonly jm: number;
742     /** maximum acceleration */
743     readonly am: number;
744     /** maximum deceleration */
745     readonly dm: number;
746     /**
747      * @param jm defines the maximum jerk during system operation
748      * @param am defines the maximum acceleration during system operation
749      * @param vm defines the maximum velocity during system operation
750      * @param p0 defines the initial position
751      * @param p1 defines the final position
752      * @param v0 defines the initial velocity
753      * @param v1 defines the final velocity
754      * @return total duration
755      */
756     gen(jm: number, am: number, vm: number, p0: number, p1: number, v0: number, v1: number): number;
757     /**
758      * calculate position for bell-shaped velocity trajectory
759      * @param x difference between current time and initial time
760      */
761     pos(x: number): number;
762     /**
763      * calculate velocity for bell-shaped velocity trajectory
764      * @param x difference between current time and initial time
765      */
766     vel(x: number): number;
767     /**
768      * calculate acceleration for bell-shaped velocity trajectory
769      * @param x difference between current time and initial time
770      */
771     acc(x: number): number;
772     /**
773      * calculate jerk for bell-shaped velocity trajectory
774      * @param x difference between current time and initial time
775      */
776     jer(x: number): number;
777     delete(): void;
778   }
779   /** constructor for bell-shaped velocity trajectory */
780   let trajbell: {
781     new(): trajbell;
782     readonly prototype: trajbell;
783   };
785   interface trajpoly3 {
786     /** coefficients of position */
787     readonly p: Float64Array | Float32Array;
788     /** coefficients of velocity */
789     readonly v: Float64Array | Float32Array;
790     /** coefficients of acceleration */
791     readonly a: Float64Array | Float32Array;
792     /**
793      * calculate position for cubic polynomial trajectory
794      * @param x difference between current time and initial time
795      */
796     pos(x: number): number;
797     /**
798      * calculate velocity for cubic polynomial trajectory
799      * @param x difference between current time and initial time
800      */
801     vel(x: number): number;
802     /**
803      * calculate acceleration for cubic polynomial trajectory
804      * @param x difference between current time and initial time
805      */
806     acc(x: number): number;
807     delete(): void;
808   }
809   /** constructor for cubic polynomial trajectory */
810   let trajpoly3: {
811     /**
812      * @param ts difference between final time and initial time
813      * @param p0 initial position
814      * @param p1 final position
815      */
816     new(ts: number, p0: number, p1: number): trajpoly3;
817     /**
818      * @param ts difference between final time and initial time
819      * @param p0 initial position
820      * @param p1 final position
821      * @param v0 initial velocity
822      * @param v1 final velocity
823      */
824     new(ts: number, p0: number, p1: number, v0: number, v1: number): trajpoly3;
825     readonly prototype: trajpoly3;
826   };
828   interface trajpoly5 {
829     /** coefficients of position */
830     readonly p: Float64Array | Float32Array;
831     /** coefficients of velocity */
832     readonly v: Float64Array | Float32Array;
833     /** coefficients of acceleration */
834     readonly a: Float64Array | Float32Array;
835     /**
836      * calculate position for quintic polynomial trajectory
837      * @param x difference between current time and initial time
838      */
839     pos(x: number): number;
840     /**
841      * calculate velocity for quintic polynomial trajectory
842      * @param x difference between current time and initial time
843      */
844     vel(x: number): number;
845     /**
846      * calculate acceleration for quintic polynomial trajectory
847      * @param x difference between current time and initial time
848      */
849     acc(x: number): number;
850     delete(): void;
851   }
852   /** constructor for quintic polynomial trajectory */
853   let trajpoly5: {
854     /**
855      * @param ts difference between final time and initial time
856      * @param p0 initial position
857      * @param p1 final position
858      */
859     new(ts: number, p0: number, p1: number): trajpoly5;
860     /**
861      * @param ts difference between final time and initial time
862      * @param p0 initial position
863      * @param p1 final position
864      * @param v0 initial velocity
865      * @param v1 final velocity
866      */
867     new(ts: number, p0: number, p1: number, v0: number, v1: number): trajpoly5;
868     /**
869      * @param ts difference between final time and initial time
870      * @param p0 initial position
871      * @param p1 final position
872      * @param v0 initial velocity
873      * @param v1 final velocity
874      * @param a0 initial acceleration
875      * @param a1 final acceleration
876      */
877     new(ts: number, p0: number, p1: number, v0: number, v1: number, a0: number, a1: number): trajpoly5;
878     readonly prototype: trajpoly5;
879   };
881   interface trajpoly7 {
882     /** coefficients of position */
883     readonly p: Float64Array | Float32Array;
884     /** coefficients of velocity */
885     readonly v: Float64Array | Float32Array;
886     /** coefficients of acceleration */
887     readonly a: Float64Array | Float32Array;
888     /** coefficients of jerk */
889     readonly j: Float64Array | Float32Array;
890     /**
891      * calculate position for hepta polynomial trajectory
892      * @param x difference between current time and initial time
893      */
894     pos(x: number): number;
895     /**
896      * calculate velocity for hepta polynomial trajectory
897      * @param x difference between current time and initial time
898      */
899     vel(x: number): number;
900     /**
901      * calculate acceleration for hepta polynomial trajectory
902      * @param x difference between current time and initial time
903      */
904     acc(x: number): number;
905     /**
906      * calculate jerk for hepta polynomial trajectory
907      * @param x difference between current time and initial time
908      */
909     jer(x: number): number;
910     delete(): void;
911   }
912   /** constructor for hepta polynomial trajectory */
913   let trajpoly7: {
914     /**
915      * @param ts difference between final time and initial time
916      * @param p0 initial position
917      * @param p1 final position
918      */
919     new(ts: number, p0: number, p1: number): trajpoly7;
920     /**
921      * @param ts difference between final time and initial time
922      * @param p0 initial position
923      * @param p1 final position
924      * @param v0 initial velocity
925      * @param v1 final velocity
926      */
927     new(ts: number, p0: number, p1: number, v0: number, v1: number): trajpoly7;
928     /**
929      * @param ts difference between final time and initial time
930      * @param p0 initial position
931      * @param p1 final position
932      * @param v0 initial velocity
933      * @param v1 final velocity
934      * @param a0 initial acceleration
935      * @param a1 final acceleration
936      */
937     new(ts: number, p0: number, p1: number, v0: number, v1: number, a0: number, a1: number): trajpoly7;
938     /**
939      * @param ts difference between final time and initial time
940      * @param p0 initial position
941      * @param p1 final position
942      * @param v0 initial velocity
943      * @param v1 final velocity
944      * @param a0 initial acceleration
945      * @param a1 final acceleration
946      * @param j0 initial jerk
947      * @param j1 final jerk
948      */
949     new(ts: number, p0: number, p1: number, v0: number, v1: number, a0: number, a1: number, j0: number, j1: number): trajpoly7;
950     readonly prototype: trajpoly7;
951   };
953   interface trajtrap {
954     /** total duration */
955     readonly t: number;
956     /** initial position */
957     readonly p0: number;
958     /** final position */
959     readonly p1: number;
960     /** initial velocity */
961     readonly v0: number;
962     /** final velocity */
963     readonly v1: number;
964     /** constant velocity */
965     readonly vc: number;
966     /** time before constant velocity */
967     readonly ta: number;
968     /** time after constant velocity */
969     readonly td: number;
970     /** position before constant velocity */
971     readonly pa: number;
972     /** position after constant velocity */
973     readonly pd: number;
974     /** acceleration before constant velocity */
975     readonly ac: number;
976     /** acceleration after constant velocity */
977     readonly de: number;
978     /**
979      * @param vm defines the maximum velocity during system operation
980      * @param ac defines the acceleration before constant velocity
981      * @param de defines the acceleration after constant velocity
982      * @param p0 defines the initial position
983      * @param p1 defines the final position
984      * @param v0 defines the initial velocity
985      * @param v1 defines the final velocity
986      * @return total duration
987      */
988     gen(vm: number, ac: number, de: number, p0: number, p1: number, v0: number, v1: number): number;
989     /**
990      * calculate position for trapezoidal velocity trajectory
991      * @param x difference between current time and initial time
992      */
993     pos(x: number): number;
994     /**
995      * calculate velocity for trapezoidal velocity trajectory
996      * @param x difference between current time and initial time
997      */
998     vel(x: number): number;
999     /**
1000      * calculate acceleration for trapezoidal velocity trajectory
1001      * @param x difference between current time and initial time
1002      */
1003     acc(x: number): number;
1004     delete(): void;
1005   }
1006   /** constructor for trapezoidal velocity trajectory */
1007   let trajtrap: {
1008     new(): trajtrap;
1009     readonly prototype: trajtrap;
1010   };
1012   interface version {
1013     /** major number */
1014     major: number;
1015     /** minor number */
1016     minor: number;
1017     /** third number */
1018     third: number;
1019     /** extra number */
1020     extra: number;
1021     /** alphabet */
1022     alpha: string;
1023     /**
1024      * parse for version string
1025      * @param ver version string to be parsed
1026      */
1027     parse(ver: string): version;
1028     /**
1029      * compare this version with that version
1030      * @param ver version to be compared
1031      */
1032     cmp(ver: version): number;
1033     /**
1034      * this version is less than that version
1035      * @param ver version to be compared
1036      */
1037     lt(ver: version): boolean;
1038     /**
1039      * this version is greater than that version
1040      * @param ver version to be compared
1041      */
1042     gt(ver: version): boolean;
1043     /**
1044      * this version is less than or equal to that version
1045      * @param ver version to be compared
1046      */
1047     le(ver: version): boolean;
1048     /**
1049      * this version is greater than or equal to that version
1050      * @param ver version to be compared
1051      */
1052     ge(ver: version): boolean;
1053     /**
1054      * this version is equal to that version
1055      * @param ver version to be compared
1056      */
1057     eq(ver: version): boolean;
1058     /**
1059      * this version is not equal to that version
1060      * @param ver version to be compared
1061      */
1062     ne(ver: version): boolean;
1063     /** return string representation of version */
1064     toString(): string;
1065     delete(): void;
1066   }
1067   /** constructor for version */
1068   let version: {
1069     /**
1070      * @param major major number
1071      * @param minor minor number
1072      * @param third third number
1073      * @param extra extra number
1074      */
1075     new(major?: number, minor?: number, third?: number, extra?: number): version;
1076     /**
1077      * algorithm library version check
1078      * @param major required major number
1079      * @param minor required minor number
1080      * @param patch required patch number
1081      * @returns -3(<major),-2(<minor),-1(<patch),0,+1(>patch),+2(>minor),+3(>major)
1082      */
1083     check(major: number, minor: number, patch: number): number;
1084     /** algorithm library version major */
1085     MAJOR: number;
1086     /** algorithm library version minor */
1087     MINOR: number;
1088     /** algorithm library version patch */
1089     PATCH: number;
1090     /** algorithm library version tweak */
1091     TWEAK: number;
1092     readonly prototype: version;
1093   };
1095   /** algorithm library version string */
1096   const VERSION: string;
1098 export = liba;