-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
1040 lines (951 loc) · 27.9 KB
/
Copy pathindex.d.ts
File metadata and controls
1040 lines (951 loc) · 27.9 KB
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
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* TypeScript definitions for node-accelerate
* Apple Accelerate framework bindings for Node.js
*/
/**
* Perform matrix multiplication: C = A × B
* Uses Apple's BLAS (Basic Linear Algebra Subprograms) for hardware-accelerated computation
*
* @param A - First matrix (M × K) as Float64Array in row-major order
* @param B - Second matrix (K × N) as Float64Array in row-major order
* @param C - Output matrix (M × N) as Float64Array in row-major order
* @param M - Number of rows in A and C
* @param K - Number of columns in A and rows in B
* @param N - Number of columns in B and C
* @returns The output matrix C
*
* @example
* const M = 100, K = 100, N = 100;
* const A = new Float64Array(M * K);
* const B = new Float64Array(K * N);
* const C = new Float64Array(M * N);
*
* // Fill A and B with data
* for (let i = 0; i < A.length; i++) A[i] = Math.random();
* for (let i = 0; i < B.length; i++) B[i] = Math.random();
*
* // C = A × B (hardware-accelerated)
* accelerate.matmul(A, B, C, M, K, N);
*/
export function matmul(
A: Float64Array,
B: Float64Array,
C: Float64Array,
M: number,
K: number,
N: number
): Float64Array;
/**
* Compute dot product of two vectors: result = sum(a[i] * b[i])
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - First vector as Float64Array
* @param b - Second vector as Float64Array (must be same length as a)
* @returns The dot product as a number
*
* @example
* const a = new Float64Array([1, 2, 3, 4]);
* const b = new Float64Array([5, 6, 7, 8]);
* const result = accelerate.dot(a, b); // 70
*/
export function dot(a: Float64Array, b: Float64Array): number;
/**
* Compute sum of all elements in a vector: result = sum(vec[i])
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param vec - Input vector as Float64Array
* @returns The sum of all elements
*
* @example
* const vec = new Float64Array([1, 2, 3, 4, 5]);
* const result = accelerate.sum(vec); // 15
*/
export function sum(vec: Float64Array): number;
/**
* Compute mean (average) of all elements in a vector
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param vec - Input vector as Float64Array
* @returns The mean of all elements
*
* @example
* const vec = new Float64Array([1, 2, 3, 4, 5]);
* const result = accelerate.mean(vec); // 3
*/
export function mean(vec: Float64Array): number;
/**
* Element-wise vector addition: out[i] = a[i] + b[i]
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - First vector as Float64Array
* @param b - Second vector as Float64Array (must be same length as a)
* @param out - Output vector as Float64Array (must be same length as a)
* @returns The output vector
*
* @example
* const a = new Float64Array([1, 2, 3]);
* const b = new Float64Array([4, 5, 6]);
* const out = new Float64Array(3);
* accelerate.vadd(a, b, out); // out = [5, 7, 9]
*/
export function vadd(
a: Float64Array,
b: Float64Array,
out: Float64Array
): Float64Array;
/**
* Element-wise vector multiplication: out[i] = a[i] * b[i]
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - First vector as Float64Array
* @param b - Second vector as Float64Array (must be same length as a)
* @param out - Output vector as Float64Array (must be same length as a)
* @returns The output vector
*
* @example
* const a = new Float64Array([2, 3, 4]);
* const b = new Float64Array([5, 6, 7]);
* const out = new Float64Array(3);
* accelerate.vmul(a, b, out); // out = [10, 18, 28]
*/
export function vmul(
a: Float64Array,
b: Float64Array,
out: Float64Array
): Float64Array;
/**
* Vector scaling: out[i] = vec[i] * scalar
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param vec - Input vector as Float64Array
* @param scalar - Scalar value to multiply by
* @param out - Output vector as Float64Array (must be same length as vec)
* @returns The output vector
*
* @example
* const vec = new Float64Array([1, 2, 3]);
* const out = new Float64Array(3);
* accelerate.vscale(vec, 2.0, out); // out = [2, 4, 6]
*/
export function vscale(
vec: Float64Array,
scalar: number,
out: Float64Array
): Float64Array;
/**
* Find maximum value in a vector
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param vec - Input vector as Float64Array
* @returns The maximum value
*
* @example
* const vec = new Float64Array([1, 5, 3, 2, 4]);
* const result = accelerate.max(vec); // 5
*/
export function max(vec: Float64Array): number;
/**
* Find minimum value in a vector
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param vec - Input vector as Float64Array
* @returns The minimum value
*
* @example
* const vec = new Float64Array([1, 5, 3, 2, 4]);
* const result = accelerate.min(vec); // 1
*/
export function min(vec: Float64Array): number;
/**
* Fast Fourier Transform (FFT) of a real signal
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param signal - Input signal as Float64Array (length must be power of 2)
* @returns Object with real and imaginary components of the frequency spectrum
*
* @example
* const signal = new Float64Array(1024);
* for (let i = 0; i < signal.length; i++) {
* signal[i] = Math.sin(2 * Math.PI * i / signal.length);
* }
* const spectrum = accelerate.fft(signal);
* console.log(spectrum.real, spectrum.imag);
*/
export function fft(signal: Float64Array): {
real: Float64Array;
imag: Float64Array;
};
/**
* Matrix-vector multiplication: y = A × x
* Uses Apple's BLAS for hardware-accelerated computation
*
* @param A - Matrix (M × N) as Float64Array in row-major order
* @param x - Vector (N elements) as Float64Array
* @param y - Output vector (M elements) as Float64Array
* @param M - Number of rows in A
* @param N - Number of columns in A
* @returns The output vector y
*/
export function matvec(
A: Float64Array,
x: Float64Array,
y: Float64Array,
M: number,
N: number
): Float64Array;
/**
* AXPY operation: y = alpha*x + y
* Uses Apple's BLAS for hardware-accelerated computation
*
* @param alpha - Scalar multiplier
* @param x - Input vector as Float64Array
* @param y - Input/output vector as Float64Array
* @returns The output vector y
*/
export function axpy(
alpha: number,
x: Float64Array,
y: Float64Array
): Float64Array;
/**
* Vector absolute value: b = |a|
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vabs(a: Float64Array, b: Float64Array): Float64Array;
/**
* Vector square: b = a^2 (element-wise)
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vsquare(a: Float64Array, b: Float64Array): Float64Array;
/**
* Vector square root: b = sqrt(a) (element-wise)
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vsqrt(a: Float64Array, b: Float64Array): Float64Array;
/**
* Normalize vector to unit length: b = a / ||a||
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array (unit vector)
* @returns The output vector b
*/
export function normalize(a: Float64Array, b: Float64Array): Float64Array;
/**
* Euclidean distance between two vectors: sqrt(sum((a - b)^2))
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - First vector as Float64Array
* @param b - Second vector as Float64Array
* @returns The Euclidean distance
*/
export function euclidean(a: Float64Array, b: Float64Array): number;
/**
* Root Mean Square of vector: sqrt(sum(a^2) / n)
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @returns The RMS value
*/
export function rms(a: Float64Array): number;
/**
* Variance of vector elements
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @returns The variance
*/
export function variance(a: Float64Array): number;
/**
* Standard deviation of vector elements
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @returns The standard deviation
*/
export function stddev(a: Float64Array): number;
/**
* Find both minimum and maximum values in a vector
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param vec - Input vector as Float64Array
* @returns Object with min and max values
*/
export function minmax(vec: Float64Array): { min: number; max: number };
/**
* Element-wise sine: b = sin(a)
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vsin(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise cosine: b = cos(a)
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vcos(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise tangent: b = tan(a)
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vtan(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise exponential: b = exp(a)
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vexp(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise natural logarithm: b = log(a)
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vlog(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise base-10 logarithm: b = log10(a)
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vlog10(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise power: c = a^b
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Base vector as Float64Array
* @param b - Exponent vector as Float64Array
* @param c - Output vector as Float64Array
* @returns The output vector c
*/
export function vpow(
a: Float64Array,
b: Float64Array,
c: Float64Array
): Float64Array;
/**
* Clip vector values to range [min, max]
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @param min - Minimum value
* @param max - Maximum value
* @returns The output vector b
*/
export function vclip(
a: Float64Array,
b: Float64Array,
min: number,
max: number
): Float64Array;
/**
* Threshold vector: b[i] = a[i] if a[i] > threshold, else 0
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @param threshold - Threshold value
* @returns The output vector b
*/
export function vthreshold(
a: Float64Array,
b: Float64Array,
threshold: number
): Float64Array;
/**
* 1D Convolution
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param signal - Input signal as Float64Array
* @param kernel - Convolution kernel as Float64Array
* @param result - Output as Float64Array (length = signal.length - kernel.length + 1)
* @returns The output result
*/
export function conv(
signal: Float64Array,
kernel: Float64Array,
result: Float64Array
): Float64Array;
/**
* Cross-correlation of two signals
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - First signal as Float64Array
* @param b - Second signal as Float64Array
* @param result - Output as Float64Array (length = a.length + b.length - 1)
* @returns The output result
*/
export function xcorr(
a: Float64Array,
b: Float64Array,
result: Float64Array
): Float64Array;
/**
* Generate Hamming window
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param length - Window length
* @returns Window coefficients as Float64Array
*/
export function hamming(length: number): Float64Array;
/**
* Generate Hanning window
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param length - Window length
* @returns Window coefficients as Float64Array
*/
export function hanning(length: number): Float64Array;
/**
* Generate Blackman window
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param length - Window length
* @returns Window coefficients as Float64Array
*/
export function blackman(length: number): Float64Array;
/**
* Matrix transpose: B = A^T
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param A - Input matrix (rows × cols) as Float64Array in row-major order
* @param B - Output matrix (cols × rows) as Float64Array in row-major order
* @param rows - Number of rows in A
* @param cols - Number of columns in A
* @returns The output matrix B
*/
export function transpose(
A: Float64Array,
B: Float64Array,
rows: number,
cols: number
): Float64Array;
/**
* Inverse Fast Fourier Transform (IFFT)
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param real - Real part of frequency domain as Float64Array
* @param imag - Imaginary part of frequency domain as Float64Array
* @returns Time domain signal as Float64Array
*/
export function ifft(real: Float64Array, imag: Float64Array): Float64Array;
/**
* Linear interpolation
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param x - X coordinates of data points as Float64Array
* @param y - Y coordinates of data points as Float64Array
* @param xi - X coordinates to interpolate at as Float64Array
* @param yi - Output interpolated Y values as Float64Array
* @returns The output yi
*/
export function interp1d(
x: Float64Array,
y: Float64Array,
xi: Float64Array,
yi: Float64Array
): Float64Array;
/**
* Reverse vector order: b = reverse(a)
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vreverse(a: Float64Array, b: Float64Array): Float64Array;
/**
* Negate vector: b = -a
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vneg(a: Float64Array, b: Float64Array): Float64Array;
/**
* Sum of squares: sum(a[i]^2)
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @returns The sum of squares
*/
export function sumOfSquares(a: Float64Array): number;
/**
* Mean magnitude: mean(|a[i]|)
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @returns The mean magnitude
*/
export function meanMagnitude(a: Float64Array): number;
/**
* Mean square: mean(a[i]^2)
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @returns The mean square
*/
export function meanSquare(a: Float64Array): number;
/**
* Element-wise vector subtraction: out[i] = a[i] - b[i]
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - First vector as Float64Array
* @param b - Second vector as Float64Array (must be same length as a)
* @param out - Output vector as Float64Array (must be same length as a)
* @returns The output vector
*/
export function vsub(
a: Float64Array,
b: Float64Array,
out: Float64Array
): Float64Array;
/**
* Element-wise vector division: out[i] = a[i] / b[i]
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - First vector as Float64Array
* @param b - Second vector as Float64Array (must be same length as a)
* @param out - Output vector as Float64Array (must be same length as a)
* @returns The output vector
*/
export function vdiv(
a: Float64Array,
b: Float64Array,
out: Float64Array
): Float64Array;
/**
* Copy vector: y = x
* Uses Apple's BLAS for hardware-accelerated computation
*
* @param x - Input vector as Float64Array
* @param y - Output vector as Float64Array
* @returns The output vector y
*/
export function copy(x: Float64Array, y: Float64Array): Float64Array;
/**
* Swap two vectors: x <-> y
* Uses Apple's BLAS for hardware-accelerated computation
*
* @param x - First vector as Float64Array
* @param y - Second vector as Float64Array
* @returns The first vector x
*/
export function swap(x: Float64Array, y: Float64Array): Float64Array;
/**
* L2 norm (Euclidean length): ||x||
* Uses Apple's BLAS for hardware-accelerated computation
*
* @param x - Input vector as Float64Array
* @returns The L2 norm
*/
export function norm(x: Float64Array): number;
/**
* Sum of absolute values: sum(|x[i]|)
* Uses Apple's BLAS for hardware-accelerated computation
*
* @param x - Input vector as Float64Array
* @returns The sum of absolute values
*/
export function abssum(x: Float64Array): number;
/**
* Index of maximum absolute value
* Uses Apple's BLAS for hardware-accelerated computation
*
* @param x - Input vector as Float64Array
* @returns The index of the maximum absolute value
*/
export function maxAbsIndex(x: Float64Array): number;
/**
* Givens rotation: apply rotation to vectors x and y
* Uses Apple's BLAS for hardware-accelerated computation
*
* @param x - First vector as Float64Array
* @param y - Second vector as Float64Array
* @param c - Cosine of rotation angle
* @param s - Sine of rotation angle
* @returns The first vector x
*/
export function rot(
x: Float64Array,
y: Float64Array,
c: number,
s: number
): Float64Array;
/**
* Fill vector with scalar value
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param scalar - Value to fill with
* @param vec - Output vector as Float64Array
* @returns The output vector
*/
export function vfill(scalar: number, vec: Float64Array): Float64Array;
/**
* Generate linear ramp: vec[i] = start + i * step
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param start - Starting value
* @param step - Step size
* @param vec - Output vector as Float64Array
* @returns The output vector
*/
export function vramp(
start: number,
step: number,
vec: Float64Array
): Float64Array;
/**
* Add scalar to vector: c[i] = a[i] + scalar
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param scalar - Scalar value to add
* @param c - Output vector as Float64Array
* @returns The output vector c
*/
export function vaddScalar(
a: Float64Array,
scalar: number,
c: Float64Array
): Float64Array;
/**
* Multiply-add: d[i] = (a[i] * b[i]) + c[i]
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - First vector as Float64Array
* @param b - Second vector as Float64Array
* @param c - Third vector as Float64Array
* @param d - Output vector as Float64Array
* @returns The output vector d
*/
export function vma(
a: Float64Array,
b: Float64Array,
c: Float64Array,
d: Float64Array
): Float64Array;
/**
* Multiply-scalar-add: d[i] = (a[i] * b) + c[i]
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Scalar multiplier
* @param c - Vector to add as Float64Array
* @param d - Output vector as Float64Array
* @returns The output vector d
*/
export function vmsa(
a: Float64Array,
b: number,
c: Float64Array,
d: Float64Array
): Float64Array;
/**
* Linear interpolation: c[i] = a[i] + t * (b[i] - a[i])
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Start vector as Float64Array
* @param b - End vector as Float64Array
* @param t - Interpolation parameter (0 to 1)
* @param c - Output vector as Float64Array
* @returns The output vector c
*/
export function vlerp(
a: Float64Array,
b: Float64Array,
t: number,
c: Float64Array
): Float64Array;
/**
* Clear vector (set all elements to zero)
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param vec - Vector to clear as Float64Array
* @returns The cleared vector
*/
export function vclear(vec: Float64Array): Float64Array;
/**
* Limit/saturate values to range [low, high]
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param low - Lower bound
* @param high - Upper bound
* @param c - Output vector as Float64Array
* @returns The output vector c
*/
export function vlimit(
a: Float64Array,
low: number,
high: number,
c: Float64Array
): Float64Array;
/**
* Maximum magnitude (absolute value)
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param vec - Input vector as Float64Array
* @returns The maximum magnitude
*/
export function maxMagnitude(vec: Float64Array): number;
/**
* Minimum magnitude (absolute value)
* Uses Apple's vDSP for hardware-accelerated computation
*
* @param vec - Input vector as Float64Array
* @returns The minimum magnitude
*/
export function minMagnitude(vec: Float64Array): number;
/**
* Element-wise inverse sine: b[i] = asin(a[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vasin(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise inverse cosine: b[i] = acos(a[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vacos(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise inverse tangent: b[i] = atan(a[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vatan(a: Float64Array, b: Float64Array): Float64Array;
/**
* Two-argument arctangent: out[i] = atan2(y[i], x[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param y - Y coordinates as Float64Array
* @param x - X coordinates as Float64Array
* @param out - Output vector as Float64Array
* @returns The output vector
*/
export function vatan2(
y: Float64Array,
x: Float64Array,
out: Float64Array
): Float64Array;
/**
* Element-wise hyperbolic sine: b[i] = sinh(a[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vsinh(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise hyperbolic cosine: b[i] = cosh(a[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vcosh(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise hyperbolic tangent: b[i] = tanh(a[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vtanh(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise reciprocal: b[i] = 1 / a[i]
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vreciprocal(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise inverse square root: b[i] = 1 / sqrt(a[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vrsqrt(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise ceiling: b[i] = ceil(a[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vceil(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise floor: b[i] = floor(a[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vfloor(a: Float64Array, b: Float64Array): Float64Array;
/**
* Element-wise truncate (round toward zero): b[i] = trunc(a[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Input vector as Float64Array
* @param b - Output vector as Float64Array
* @returns The output vector b
*/
export function vtrunc(a: Float64Array, b: Float64Array): Float64Array;
/**
* Copy sign: c[i] = |a[i]| * sign(b[i])
* Uses Apple's vForce for hardware-accelerated computation
*
* @param a - Magnitude vector as Float64Array
* @param b - Sign vector as Float64Array
* @param c - Output vector as Float64Array
* @returns The output vector c
*/
export function vcopysign(
a: Float64Array,
b: Float64Array,
c: Float64Array
): Float64Array;
/**
* All exported functions
*/
declare const accelerate: {
// Matrix operations
matmul: typeof matmul;
matvec: typeof matvec;
transpose: typeof transpose;
// BLAS operations
axpy: typeof axpy;
copy: typeof copy;
swap: typeof swap;
norm: typeof norm;
abssum: typeof abssum;
maxAbsIndex: typeof maxAbsIndex;
rot: typeof rot;
// Vector arithmetic
dot: typeof dot;
sum: typeof sum;
mean: typeof mean;
vadd: typeof vadd;
vsub: typeof vsub;
vmul: typeof vmul;
vdiv: typeof vdiv;
vscale: typeof vscale;
vneg: typeof vneg;
vaddScalar: typeof vaddScalar;
vma: typeof vma;
vmsa: typeof vmsa;
// Vector functions
vabs: typeof vabs;
vsquare: typeof vsquare;
vsqrt: typeof vsqrt;
normalize: typeof normalize;
vreverse: typeof vreverse;
vfill: typeof vfill;
vramp: typeof vramp;
vlerp: typeof vlerp;
vclear: typeof vclear;
vlimit: typeof vlimit;
// Trigonometric
vsin: typeof vsin;
vcos: typeof vcos;
vtan: typeof vtan;
vasin: typeof vasin;
vacos: typeof vacos;
vatan: typeof vatan;
vatan2: typeof vatan2;
// Hyperbolic
vsinh: typeof vsinh;
vcosh: typeof vcosh;
vtanh: typeof vtanh;
// Exponential/Logarithmic
vexp: typeof vexp;
vlog: typeof vlog;
vlog10: typeof vlog10;
vpow: typeof vpow;
vreciprocal: typeof vreciprocal;
vrsqrt: typeof vrsqrt;
// Rounding
vceil: typeof vceil;