forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNdArray.QR.cs
More file actions
48 lines (32 loc) · 1.28 KB
/
NdArray.QR.cs
File metadata and controls
48 lines (32 loc) · 1.28 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
namespace NumSharp
{
public partial class NDArray
{
public (NDArray, NDArray) qr()
{
return default;
//return;
//var a = this.Storage.GetData<double>().Clone();
//int m = this.Storage.Shape.Dimensions[0];
//int n = this.Storage.Shape.Dimensions[1];
//int lda = m;
//double[] tau = new double[ Math.Min(m,n) ];
//double[] work = new double[ Math.Max(m,n) ];
//int lwork = m;
//int info = 0;
//LAPACK.dgeqrf_(ref m,ref n, a ,ref lda, tau, work,ref lwork,ref info);
//double[] RDouble = new double[n*n];
//for(int idx = 0; idx < n; idx++)
// for(int jdx = idx;jdx < n;jdx++)
// RDouble[idx+jdx * n] = a[idx+jdx*n];
//var R = new NDArray(typeof(double), new Shape(n, n));
//R.Storage.ReplaceData(RDouble);
//int k = tau.Length;
//LAPACK.dorgqr_(ref m, ref n,ref k ,a, ref lda, tau, work, ref lwork,ref info);
//var Q = new NDArray(typeof(double), new Shape(tau.Length, tau.Length));
//Q.Storage.Allocate(Q.Storage.Shape);
//Q.Storage.ReplaceData(a);
//return (Q,R);
}
}
}