forked from SciSharp/Numpy.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumPy.linalg_fft.gen.cs
More file actions
1080 lines (1059 loc) · 45.2 KB
/
NumPy.linalg_fft.gen.cs
File metadata and controls
1080 lines (1059 loc) · 45.2 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
// Copyright (c) 2019 by the SciSharp Team
// Code generated by CodeMinion: https://github.com/SciSharp/CodeMinion
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Python.Runtime;
using Numpy.Models;
using Python.Included;
namespace Numpy
{
public partial class NumPy
{
/// <summary>
/// Cholesky decomposition.<br></br>
///
/// Return the Cholesky decomposition, L * L.H, of the square matrix a,
/// where L is lower-triangular and .H is the conjugate transpose operator
/// (which is the ordinary transpose if a is real-valued).<br></br>
/// a must be
/// Hermitian (symmetric if real-valued) and positive-definite.<br></br>
/// Only L is
/// actually returned.<br></br>
///
/// Notes
///
/// Broadcasting rules apply, see the numpy.linalg documentation for
/// details.<br></br>
///
/// The Cholesky decomposition is often used as a fast way of solving
///
/// (when A is both Hermitian/symmetric and positive-definite).<br></br>
///
/// First, we solve for in
///
/// and then for in
/// </summary>
/// <param name="a">
/// Hermitian (symmetric if all elements are real), positive-definite
/// input matrix.
/// </param>
/// <returns>
/// Upper or lower-triangular Cholesky factor of a.<br></br>
/// Returns a
/// matrix object if a is a matrix object.
/// </returns>
public NDarray linalg_cholesky(NDarray a)
{
//auto-generated code, do not change
var linalg = self.GetAttr("linalg");
var __self__=linalg;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("cholesky", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Compute the determinant of an array.<br></br>
///
/// Notes
///
/// Broadcasting rules apply, see the numpy.linalg documentation for
/// details.<br></br>
///
/// The determinant is computed via LU factorization using the LAPACK
/// routine z/dgetrf.
/// </summary>
/// <param name="a">
/// Input array to compute determinants for.
/// </param>
/// <returns>
/// Determinant of a.
/// </returns>
public NDarray linalg_det(NDarray a)
{
//auto-generated code, do not change
var linalg = self.GetAttr("linalg");
var __self__=linalg;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("det", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Compute the eigenvalues and right eigenvectors of a square array.<br></br>
///
/// Notes
///
/// Broadcasting rules apply, see the numpy.linalg documentation for
/// details.<br></br>
///
/// This is implemented using the _geev LAPACK routines which compute
/// the eigenvalues and eigenvectors of general square arrays.<br></br>
///
/// The number w is an eigenvalue of a if there exists a vector
/// v such that dot(a,v) = w * v.<br></br>
/// Thus, the arrays a, w, and
/// v satisfy the equations dot(a[:,:], v[:,i]) = w[i] * v[:,i]
/// for .
///
/// The array v of eigenvectors may not be of maximum rank, that is, some
/// of the columns may be linearly dependent, although round-off error may
/// obscure that fact.<br></br>
/// If the eigenvalues are all different, then theoretically
/// the eigenvectors are linearly independent.<br></br>
/// Likewise, the (complex-valued)
/// matrix of eigenvectors v is unitary if the matrix a is normal, i.e.,
/// if dot(a, a.H) = dot(a.H, a), where a.H denotes the conjugate
/// transpose of a.<br></br>
///
/// Finally, it is emphasized that v consists of the right (as in
/// right-hand side) eigenvectors of a.<br></br>
/// A vector y satisfying
/// dot(y.T, a) = z * y.T for some number z is called a left
/// eigenvector of a, and, in general, the left and right eigenvectors
/// of a matrix are not necessarily the (perhaps conjugate) transposes
/// of each other.<br></br>
///
/// References
///
/// G.<br></br>
/// Strang, Linear Algebra and Its Applications, 2nd Ed., Orlando, FL,
/// Academic Press, Inc., 1980, Various pp.
/// </summary>
/// <param name="a">
/// Matrices for which the eigenvalues and right eigenvectors will
/// be computed
/// </param>
/// <returns>
/// A tuple of:
/// w
/// The eigenvalues, each repeated according to its multiplicity.
/// The eigenvalues are not necessarily ordered. The resulting
/// array will be of complex type, unless the imaginary part is
/// zero in which case it will be cast to a real type. When a
/// is real the resulting eigenvalues will be real (0 imaginary
/// part) or occur in conjugate pairs
/// v
/// The normalized (unit “length”) eigenvectors, such that the
/// column v[:,i] is the eigenvector corresponding to the
/// eigenvalue w[i].
/// </returns>
public (NDarray, NDarray) linalg_eig(NDarray a)
{
//auto-generated code, do not change
var linalg = self.GetAttr("linalg");
var __self__=linalg;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("eig", pyargs, kwargs);
var t = py as PyTuple;
return (ToCsharp<NDarray>(t[0]), ToCsharp<NDarray>(t[1]));
}
/// <summary>
/// Return the eigenvalues and eigenvectors of a complex Hermitian
/// (conjugate symmetric) or a real symmetric matrix.<br></br>
///
/// Returns two objects, a 1-D array containing the eigenvalues of a, and
/// a 2-D square array or matrix (depending on the input type) of the
/// corresponding eigenvectors (in columns).<br></br>
///
/// Notes
///
/// Broadcasting rules apply, see the numpy.linalg documentation for
/// details.<br></br>
///
/// The eigenvalues/eigenvectors are computed using LAPACK routines _syevd,
/// _heevd
///
/// The eigenvalues of real symmetric or complex Hermitian matrices are
/// always real.<br></br>
/// [1] The array v of (column) eigenvectors is unitary
/// and a, w, and v satisfy the equations
/// dot(a, v[:, i]) = w[i] * v[:, i].<br></br>
///
/// References
/// </summary>
/// <param name="a">
/// Hermitian or real symmetric matrices whose eigenvalues and
/// eigenvectors are to be computed.
/// </param>
/// <param name="UPLO">
/// Specifies whether the calculation is done with the lower triangular
/// part of a (‘L’, default) or the upper triangular part (‘U’).<br></br>
///
/// Irrespective of this value only the real parts of the diagonal will
/// be considered in the computation to preserve the notion of a Hermitian
/// matrix.<br></br>
/// It therefore follows that the imaginary part of the diagonal
/// will always be treated as zero.
/// </param>
/// <returns>
/// A tuple of:
/// w
/// The eigenvalues in ascending order, each repeated according to
/// its multiplicity.
/// v
/// The column v[:, i] is the normalized eigenvector corresponding
/// to the eigenvalue w[i]. Will return a matrix object if a is
/// a matrix object.
/// </returns>
public (NDarray, NDarray) linalg_eigh(NDarray a, string UPLO = "L")
{
//auto-generated code, do not change
var linalg = self.GetAttr("linalg");
var __self__=linalg;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
if (UPLO!="L") kwargs["UPLO"]=ToPython(UPLO);
dynamic py = __self__.InvokeMethod("eigh", pyargs, kwargs);
var t = py as PyTuple;
return (ToCsharp<NDarray>(t[0]), ToCsharp<NDarray>(t[1]));
}
/// <summary>
/// Compute the eigenvalues of a general matrix.<br></br>
///
/// Main difference between eigvals and eig: the eigenvectors aren’t
/// returned.<br></br>
///
/// Notes
///
/// Broadcasting rules apply, see the numpy.linalg documentation for
/// details.<br></br>
///
/// This is implemented using the _geev LAPACK routines which compute
/// the eigenvalues and eigenvectors of general square arrays.
/// </summary>
/// <param name="a">
/// A complex- or real-valued matrix whose eigenvalues will be computed.
/// </param>
/// <returns>
/// The eigenvalues, each repeated according to its multiplicity.<br></br>
///
/// They are not necessarily ordered, nor are they necessarily
/// real for real matrices.
/// </returns>
public NDarray linalg_eigvals(NDarray a)
{
//auto-generated code, do not change
var linalg = self.GetAttr("linalg");
var __self__=linalg;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("eigvals", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Compute the eigenvalues of a complex Hermitian or real symmetric matrix.<br></br>
///
/// Main difference from eigh: the eigenvectors are not computed.<br></br>
///
/// Notes
///
/// Broadcasting rules apply, see the numpy.linalg documentation for
/// details.<br></br>
///
/// The eigenvalues are computed using LAPACK routines _syevd, _heevd
/// </summary>
/// <param name="a">
/// A complex- or real-valued matrix whose eigenvalues are to be
/// computed.
/// </param>
/// <param name="UPLO">
/// Specifies whether the calculation is done with the lower triangular
/// part of a (‘L’, default) or the upper triangular part (‘U’).<br></br>
///
/// Irrespective of this value only the real parts of the diagonal will
/// be considered in the computation to preserve the notion of a Hermitian
/// matrix.<br></br>
/// It therefore follows that the imaginary part of the diagonal
/// will always be treated as zero.
/// </param>
/// <returns>
/// The eigenvalues in ascending order, each repeated according to
/// its multiplicity.
/// </returns>
public NDarray linalg_eigvalsh(NDarray a, string UPLO = "L")
{
//auto-generated code, do not change
var linalg = self.GetAttr("linalg");
var __self__=linalg;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
if (UPLO!="L") kwargs["UPLO"]=ToPython(UPLO);
dynamic py = __self__.InvokeMethod("eigvalsh", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Compute the (multiplicative) inverse of a matrix.<br></br>
///
/// Given a square matrix a, return the matrix ainv satisfying
/// dot(a, ainv) = dot(ainv, a) = eye(a.shape[0]).<br></br>
///
/// Notes
///
/// Broadcasting rules apply, see the numpy.linalg documentation for
/// details.
/// </summary>
/// <param name="a">
/// Matrix to be inverted.
/// </param>
/// <returns>
/// (Multiplicative) inverse of the matrix a.
/// </returns>
public NDarray linalg_inv(NDarray a)
{
//auto-generated code, do not change
var linalg = self.GetAttr("linalg");
var __self__=linalg;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("inv", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Return the least-squares solution to a linear matrix equation.<br></br>
///
/// Solves the equation a x = b by computing a vector x that
/// minimizes the Euclidean 2-norm || b - a x ||^2. The equation may
/// be under-, well-, or over- determined (i.e., the number of
/// linearly independent rows of a can be less than, equal to, or
/// greater than its number of linearly independent columns).<br></br>
/// If a
/// is square and of full rank, then x (but for round-off error) is
/// the “exact” solution of the equation.<br></br>
///
/// Notes
///
/// If b is a matrix, then all array results are returned as matrices.
/// </summary>
/// <param name="a">
/// “Coefficient” matrix.
/// </param>
/// <param name="b">
/// Ordinate or “dependent variable” values.<br></br>
/// If b is two-dimensional,
/// the least-squares solution is calculated for each of the K columns
/// of b.
/// </param>
/// <param name="rcond">
/// Cut-off ratio for small singular values of a.<br></br>
///
/// For the purposes of rank determination, singular values are treated
/// as zero if they are smaller than rcond times the largest singular
/// value of a.
/// </param>
/// <returns>
/// A tuple of:
/// x
/// Least-squares solution. If b is two-dimensional,
/// the solutions are in the K columns of x.
/// residuals
/// Sums of residuals; squared Euclidean 2-norm for each column in
/// b - a*x.
/// If the rank of a is < N or M <= N, this is an empty array.
/// If b is 1-dimensional, this is a (1,) shape array.
/// Otherwise the shape is (K,).
/// rank
/// Rank of matrix a.
/// s
/// Singular values of a.
/// </returns>
public (NDarray, NDarray, int, NDarray) linalg_lstsq(NDarray a, NDarray b, float? rcond = null)
{
//auto-generated code, do not change
var linalg = self.GetAttr("linalg");
var __self__=linalg;
var pyargs=ToTuple(new object[]
{
a,
b,
});
var kwargs=new PyDict();
if (rcond!=null) kwargs["rcond"]=ToPython(rcond);
dynamic py = __self__.InvokeMethod("lstsq", pyargs, kwargs);
var t = py as PyTuple;
return (ToCsharp<NDarray>(t[0]), ToCsharp<NDarray>(t[1]), ToCsharp<int>(t[2]), ToCsharp<NDarray>(t[3]));
}
/// <summary>
/// Compute the (Moore-Penrose) pseudo-inverse of a matrix.<br></br>
///
/// Calculate the generalized inverse of a matrix using its
/// singular-value decomposition (SVD) and including all
/// large singular values.<br></br>
///
/// Notes
///
/// The pseudo-inverse of a matrix A, denoted , is
/// defined as: “the matrix that ‘solves’ [the least-squares problem]
/// ,” i.e., if is said solution, then
/// is that matrix such that .
///
/// It can be shown that if is the singular
/// value decomposition of A, then
/// , where are
/// orthogonal matrices, is a diagonal matrix consisting
/// of A’s so-called singular values, (followed, typically, by
/// zeros), and then is simply the diagonal matrix
/// consisting of the reciprocals of A’s singular values
/// (again, followed by zeros).<br></br>
/// [1]
///
/// References
/// </summary>
/// <param name="a">
/// Matrix or stack of matrices to be pseudo-inverted.
/// </param>
/// <param name="rcond">
/// Cutoff for small singular values.<br></br>
///
/// Singular values smaller (in modulus) than
/// rcond * largest_singular_value (again, in modulus)
/// are set to zero.<br></br>
/// Broadcasts against the stack of matrices
/// </param>
/// <returns>
/// The pseudo-inverse of a.<br></br>
/// If a is a matrix instance, then so
/// is B.
/// </returns>
public NDarray linalg_pinv(NDarray a, float rcond = 1e-15f)
{
//auto-generated code, do not change
var linalg = self.GetAttr("linalg");
var __self__=linalg;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
if (rcond!=1e-15f) kwargs["rcond"]=ToPython(rcond);
dynamic py = __self__.InvokeMethod("pinv", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Solve a linear matrix equation, or system of linear scalar equations.<br></br>
///
/// Computes the “exact” solution, x, of the well-determined, i.e., full
/// rank, linear matrix equation ax = b.<br></br>
///
/// Notes
///
/// Broadcasting rules apply, see the numpy.linalg documentation for
/// details.<br></br>
///
/// The solutions are computed using LAPACK routine _gesv
///
/// a must be square and of full-rank, i.e., all rows (or, equivalently,
/// columns) must be linearly independent; if either is not true, use
/// lstsq for the least-squares best “solution” of the
/// system/equation.<br></br>
///
/// References
/// </summary>
/// <param name="a">
/// Coefficient matrix.
/// </param>
/// <param name="b">
/// Ordinate or “dependent variable” values.
/// </param>
/// <returns>
/// Solution to the system a x = b.<br></br>
/// Returned shape is identical to b.
/// </returns>
public NDarray linalg_solve(NDarray a, NDarray b)
{
//auto-generated code, do not change
var linalg = self.GetAttr("linalg");
var __self__=linalg;
var pyargs=ToTuple(new object[]
{
a,
b,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("solve", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Singular Value Decomposition.<br></br>
///
/// When a is a 2D array, it is factorized as u @ np.diag(s) @ vh
/// = (u * s) @ vh, where u and vh are 2D unitary arrays and s is a 1D
/// array of a’s singular values.<br></br>
/// When a is higher-dimensional, SVD is
/// applied in stacked mode as explained below.<br></br>
///
/// Notes
///
/// The decomposition is performed using LAPACK routine _gesdd.<br></br>
///
/// SVD is usually described for the factorization of a 2D matrix .
/// The higher-dimensional case will be discussed below.<br></br>
/// In the 2D case, SVD is
/// written as , where , ,
/// and . The 1D array s
/// contains the singular values of a and u and vh are unitary.<br></br>
/// The rows
/// of vh are the eigenvectors of and the columns of u are
/// the eigenvectors of . In both cases the corresponding
/// (possibly non-zero) eigenvalues are given by s**2.
///
/// If a has more than two dimensions, then broadcasting rules apply, as
/// explained in Linear algebra on several matrices at once.<br></br>
/// This means that SVD is
/// working in “stacked” mode: it iterates over all indices of the first
/// a.ndim - 2 dimensions and for each combination SVD is applied to the
/// last two indices.<br></br>
/// The matrix a can be reconstructed from the
/// decomposition with either (u * s[..., None, :]) @ vh or
/// u @ (s[..., None] * vh).<br></br>
/// (The @ operator can be replaced by the
/// function np.matmul for python versions below 3.5.)
///
/// If a is a matrix object (as opposed to an ndarray), then so are
/// all the return values.
/// </summary>
/// <param name="a">
/// A real or complex array with a.ndim >= 2.
/// </param>
/// <param name="full_matrices">
/// If True (default), u and vh have the shapes (..., M, M) and
/// (..., N, N), respectively.<br></br>
/// Otherwise, the shapes are
/// (..., M, K) and (..., K, N), respectively, where
/// K = min(M, N).
/// </param>
/// <param name="compute_uv">
/// Whether or not to compute u and vh in addition to s.<br></br>
/// True
/// by default.
/// </param>
/// <returns>
/// A tuple of:
/// u
/// Unitary array(s). The first a.ndim - 2 dimensions have the same
/// size as those of the input a. The size of the last two dimensions
/// depends on the value of full_matrices. Only returned when
/// compute_uv is True.
/// s
/// Vector(s) with the singular values, within each vector sorted in
/// descending order. The first a.ndim - 2 dimensions have the same
/// size as those of the input a.
/// vh
/// Unitary array(s). The first a.ndim - 2 dimensions have the same
/// size as those of the input a. The size of the last two dimensions
/// depends on the value of full_matrices. Only returned when
/// compute_uv is True.
/// </returns>
public (NDarray, NDarray, NDarray) linalg_svd(NDarray a, bool? full_matrices = true, bool? compute_uv = true)
{
//auto-generated code, do not change
var linalg = self.GetAttr("linalg");
var __self__=linalg;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
if (full_matrices!=true) kwargs["full_matrices"]=ToPython(full_matrices);
if (compute_uv!=true) kwargs["compute_uv"]=ToPython(compute_uv);
dynamic py = __self__.InvokeMethod("svd", pyargs, kwargs);
var t = py as PyTuple;
return (ToCsharp<NDarray>(t[0]), ToCsharp<NDarray>(t[1]), ToCsharp<NDarray>(t[2]));
}
/// <summary>
/// Compute the one-dimensional discrete Fourier Transform.<br></br>
///
/// This function computes the one-dimensional n-point discrete Fourier
/// Transform (DFT) with the efficient Fast Fourier Transform (FFT)
/// algorithm [CT].<br></br>
///
/// Notes
///
/// FFT (Fast Fourier Transform) refers to a way the discrete Fourier
/// Transform (DFT) can be calculated efficiently, by using symmetries in the
/// calculated terms.<br></br>
/// The symmetry is highest when n is a power of 2, and
/// the transform is therefore most efficient for these sizes.<br></br>
///
/// The DFT is defined, with the conventions used in this implementation, in
/// the documentation for the numpy.fft module.<br></br>
///
/// References
/// </summary>
/// <param name="a">
/// Input array, can be complex.
/// </param>
/// <param name="n">
/// Length of the transformed axis of the output.<br></br>
///
/// If n is smaller than the length of the input, the input is cropped.<br></br>
///
/// If it is larger, the input is padded with zeros.<br></br>
/// If n is not given,
/// the length of the input along the axis specified by axis is used.
/// </param>
/// <param name="axis">
/// Axis over which to compute the FFT.<br></br>
/// If not given, the last axis is
/// used.
/// </param>
/// <param name="norm">
/// Normalization mode (see numpy.fft).<br></br>
/// Default is None.
/// </param>
/// <returns>
/// The truncated or zero-padded input, transformed along the axis
/// indicated by axis, or the last one if axis is not specified.
/// </returns>
public NDarray fft_fft(NDarray a, int? n = null, int? axis = -1, string norm = null)
{
//auto-generated code, do not change
var fft = self.GetAttr("fft");
var __self__=fft;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
if (n!=null) kwargs["n"]=ToPython(n);
if (axis!=-1) kwargs["axis"]=ToPython(axis);
if (norm!=null) kwargs["norm"]=ToPython(norm);
dynamic py = __self__.InvokeMethod("fft", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Compute the 2-dimensional discrete Fourier Transform
///
/// This function computes the n-dimensional discrete Fourier Transform
/// over any axes in an M-dimensional array by means of the
/// Fast Fourier Transform (FFT).<br></br>
/// By default, the transform is computed over
/// the last two axes of the input array, i.e., a 2-dimensional FFT.<br></br>
///
/// Notes
///
/// fft2 is just fftn with a different default for axes.<br></br>
///
/// The output, analogously to fft, contains the term for zero frequency in
/// the low-order corner of the transformed axes, the positive frequency terms
/// in the first half of these axes, the term for the Nyquist frequency in the
/// middle of the axes and the negative frequency terms in the second half of
/// the axes, in order of decreasingly negative frequency.<br></br>
///
/// See fftn for details and a plotting example, and numpy.fft for
/// definitions and conventions used.
/// </summary>
/// <param name="a">
/// Input array, can be complex
/// </param>
/// <param name="s">
/// Shape (length of each transformed axis) of the output
/// (s[0] refers to axis 0, s[1] to axis 1, etc.).<br></br>
///
/// This corresponds to n for fft(x, n).<br></br>
///
/// Along each axis, if the given shape is smaller than that of the input,
/// the input is cropped.<br></br>
/// If it is larger, the input is padded with zeros.<br></br>
///
/// if s is not given, the shape of the input along the axes specified
/// by axes is used.
/// </param>
/// <param name="axes">
/// Axes over which to compute the FFT.<br></br>
/// If not given, the last two
/// axes are used.<br></br>
/// A repeated index in axes means the transform over
/// that axis is performed multiple times.<br></br>
/// A one-element sequence means
/// that a one-dimensional FFT is performed.
/// </param>
/// <param name="norm">
/// Normalization mode (see numpy.fft).<br></br>
/// Default is None.
/// </param>
/// <returns>
/// The truncated or zero-padded input, transformed along the axes
/// indicated by axes, or the last two axes if axes is not given.
/// </returns>
public NDarray fft_fft2(NDarray a, int[] s = null, int[] axes = null, string norm = null)
{
//auto-generated code, do not change
var fft = self.GetAttr("fft");
var __self__=fft;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
if (s!=null) kwargs["s"]=ToPython(s);
if (axes!=null) kwargs["axes"]=ToPython(axes);
if (norm!=null) kwargs["norm"]=ToPython(norm);
dynamic py = __self__.InvokeMethod("fft2", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Compute the N-dimensional discrete Fourier Transform.<br></br>
///
/// This function computes the N-dimensional discrete Fourier Transform over
/// any number of axes in an M-dimensional array by means of the Fast Fourier
/// Transform (FFT).<br></br>
///
/// Notes
///
/// The output, analogously to fft, contains the term for zero frequency in
/// the low-order corner of all axes, the positive frequency terms in the
/// first half of all axes, the term for the Nyquist frequency in the middle
/// of all axes and the negative frequency terms in the second half of all
/// axes, in order of decreasingly negative frequency.<br></br>
///
/// See numpy.fft for details, definitions and conventions used.
/// </summary>
/// <param name="a">
/// Input array, can be complex.
/// </param>
/// <param name="s">
/// Shape (length of each transformed axis) of the output
/// (s[0] refers to axis 0, s[1] to axis 1, etc.).<br></br>
///
/// This corresponds to n for fft(x, n).<br></br>
///
/// Along any axis, if the given shape is smaller than that of the input,
/// the input is cropped.<br></br>
/// If it is larger, the input is padded with zeros.<br></br>
///
/// if s is not given, the shape of the input along the axes specified
/// by axes is used.
/// </param>
/// <param name="axes">
/// Axes over which to compute the FFT.<br></br>
/// If not given, the last len(s)
/// axes are used, or all axes if s is also not specified.<br></br>
///
/// Repeated indices in axes means that the transform over that axis is
/// performed multiple times.
/// </param>
/// <param name="norm">
/// Normalization mode (see numpy.fft).<br></br>
/// Default is None.
/// </param>
/// <returns>
/// The truncated or zero-padded input, transformed along the axes
/// indicated by axes, or by a combination of s and a,
/// as explained in the parameters section above.
/// </returns>
public NDarray fft_fftn(NDarray a, int[] s = null, int[] axes = null, string norm = null)
{
//auto-generated code, do not change
var fft = self.GetAttr("fft");
var __self__=fft;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
if (s!=null) kwargs["s"]=ToPython(s);
if (axes!=null) kwargs["axes"]=ToPython(axes);
if (norm!=null) kwargs["norm"]=ToPython(norm);
dynamic py = __self__.InvokeMethod("fftn", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Compute the one-dimensional inverse discrete Fourier Transform.<br></br>
///
/// This function computes the inverse of the one-dimensional n-point
/// discrete Fourier transform computed by fft.<br></br>
/// In other words,
/// ifft(fft(a)) == a to within numerical accuracy.<br></br>
///
/// For a general description of the algorithm and definitions,
/// see numpy.fft.<br></br>
///
/// The input should be ordered in the same way as is returned by fft,
/// i.e.,
///
/// For an even number of input points, A[n//2] represents the sum of
/// the values at the positive and negative Nyquist frequencies, as the two
/// are aliased together.<br></br>
/// See numpy.fft for details.<br></br>
///
/// Notes
///
/// If the input parameter n is larger than the size of the input, the input
/// is padded by appending zeros at the end.<br></br>
/// Even though this is the common
/// approach, it might lead to surprising results.<br></br>
/// If a different padding is
/// desired, it must be performed before calling ifft.
/// </summary>
/// <param name="a">
/// Input array, can be complex.
/// </param>
/// <param name="n">
/// Length of the transformed axis of the output.<br></br>
///
/// If n is smaller than the length of the input, the input is cropped.<br></br>
///
/// If it is larger, the input is padded with zeros.<br></br>
/// If n is not given,
/// the length of the input along the axis specified by axis is used.<br></br>
///
/// See notes about padding issues.
/// </param>
/// <param name="axis">
/// Axis over which to compute the inverse DFT.<br></br>
/// If not given, the last
/// axis is used.
/// </param>
/// <param name="norm">
/// Normalization mode (see numpy.fft).<br></br>
/// Default is None.
/// </param>
/// <returns>
/// The truncated or zero-padded input, transformed along the axis
/// indicated by axis, or the last one if axis is not specified.
/// </returns>
public NDarray fft_ifft(NDarray a, int? n = null, int? axis = -1, string norm = null)
{
//auto-generated code, do not change
var fft = self.GetAttr("fft");
var __self__=fft;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
if (n!=null) kwargs["n"]=ToPython(n);
if (axis!=-1) kwargs["axis"]=ToPython(axis);
if (norm!=null) kwargs["norm"]=ToPython(norm);
dynamic py = __self__.InvokeMethod("ifft", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Compute the 2-dimensional inverse discrete Fourier Transform.<br></br>
///
/// This function computes the inverse of the 2-dimensional discrete Fourier
/// Transform over any number of axes in an M-dimensional array by means of
/// the Fast Fourier Transform (FFT).<br></br>
/// In other words, ifft2(fft2(a)) == a
/// to within numerical accuracy.<br></br>
/// By default, the inverse transform is
/// computed over the last two axes of the input array.<br></br>
///
/// The input, analogously to ifft, should be ordered in the same way as is
/// returned by fft2, i.e.<br></br>
/// it should have the term for zero frequency
/// in the low-order corner of the two axes, the positive frequency terms in
/// the first half of these axes, the term for the Nyquist frequency in the
/// middle of the axes and the negative frequency terms in the second half of
/// both axes, in order of decreasingly negative frequency.<br></br>
///
/// Notes
///
/// ifft2 is just ifftn with a different default for axes.<br></br>
///
/// See ifftn for details and a plotting example, and numpy.fft for
/// definition and conventions used.<br></br>
///
/// Zero-padding, analogously with ifft, is performed by appending zeros to
/// the input along the specified dimension.<br></br>
/// Although this is the common
/// approach, it might lead to surprising results.<br></br>
/// If another form of zero
/// padding is desired, it must be performed before ifft2 is called.
/// </summary>
/// <param name="a">
/// Input array, can be complex.
/// </param>
/// <param name="s">
/// Shape (length of each axis) of the output (s[0] refers to axis 0,
/// s[1] to axis 1, etc.).<br></br>
/// This corresponds to n for ifft(x, n).<br></br>
///
/// Along each axis, if the given shape is smaller than that of the input,
/// the input is cropped.<br></br>
/// If it is larger, the input is padded with zeros.<br></br>
///
/// if s is not given, the shape of the input along the axes specified
/// by axes is used.<br></br>
/// See notes for issue on ifft zero padding.
/// </param>
/// <param name="axes">
/// Axes over which to compute the FFT.<br></br>
/// If not given, the last two
/// axes are used.<br></br>
/// A repeated index in axes means the transform over
/// that axis is performed multiple times.<br></br>
/// A one-element sequence means
/// that a one-dimensional FFT is performed.
/// </param>
/// <param name="norm">
/// Normalization mode (see numpy.fft).<br></br>
/// Default is None.
/// </param>
/// <returns>
/// The truncated or zero-padded input, transformed along the axes
/// indicated by axes, or the last two axes if axes is not given.
/// </returns>
public NDarray fft_ifft2(NDarray a, int[] s = null, int[] axes = null, string norm = null)
{
//auto-generated code, do not change
var fft = self.GetAttr("fft");
var __self__=fft;
var pyargs=ToTuple(new object[]
{
a,
});
var kwargs=new PyDict();
if (s!=null) kwargs["s"]=ToPython(s);
if (axes!=null) kwargs["axes"]=ToPython(axes);
if (norm!=null) kwargs["norm"]=ToPython(norm);
dynamic py = __self__.InvokeMethod("ifft2", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Compute the N-dimensional inverse discrete Fourier Transform.<br></br>
///
/// This function computes the inverse of the N-dimensional discrete
/// Fourier Transform over any number of axes in an M-dimensional array by
/// means of the Fast Fourier Transform (FFT).<br></br>
/// In other words,
/// ifftn(fftn(a)) == a to within numerical accuracy.<br></br>
///
/// For a description of the definitions and conventions used, see numpy.fft.<br></br>
///
/// The input, analogously to ifft, should be ordered in the same way as is
/// returned by fftn, i.e.<br></br>
/// it should have the term for zero frequency
/// in all axes in the low-order corner, the positive frequency terms in the
/// first half of all axes, the term for the Nyquist frequency in the middle
/// of all axes and the negative frequency terms in the second half of all
/// axes, in order of decreasingly negative frequency.<br></br>
///
/// Notes
///
/// See numpy.fft for definitions and conventions used.<br></br>
///
/// Zero-padding, analogously with ifft, is performed by appending zeros to
/// the input along the specified dimension.<br></br>
/// Although this is the common
/// approach, it might lead to surprising results.<br></br>
/// If another form of zero
/// padding is desired, it must be performed before ifftn is called.
/// </summary>
/// <param name="a">
/// Input array, can be complex.
/// </param>
/// <param name="s">
/// Shape (length of each transformed axis) of the output
/// (s[0] refers to axis 0, s[1] to axis 1, etc.).<br></br>
///
/// This corresponds to n for ifft(x, n).<br></br>
///
/// Along any axis, if the given shape is smaller than that of the input,
/// the input is cropped.<br></br>