forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNdArray.SVD.cs
More file actions
56 lines (42 loc) · 1.66 KB
/
NdArray.SVD.cs
File metadata and controls
56 lines (42 loc) · 1.66 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
using System;
namespace NumSharp
{
public partial class NDArray
{
public (NDArray, NDArray, NDArray) svd()
{
return default;
//return;
//double[] A = Data<double>();
//int m = this.shape[0];
//int n = this.shape[1];
//int lda = m;
//int ldu = m;
//int ldvt = n;
//int info = 0;
//int lwork = -1;
//double[] work = new double[Math.Max(m,n)];
//double[] s = new double[n];
//double[] u = new double[m*m];
//double[] vt = new double[n*n];
//LAPACK.dgesvd_("ALL".ToCharArray(),"All".ToCharArray(),ref m, ref n, A, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, ref info );
//lwork = (int)work[0];
//work = new double[lwork];
//LAPACK.dgesvd_("ALL".ToCharArray(),"All".ToCharArray(),ref m, ref n, A, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, ref info );
//var uNDArr = new NDArray(typeof(double), new Shape(m, n));
//var vtNDArr = new NDArray(typeof(double), new Shape(n, n));
//var sNDArr = new NDArray(typeof(double), n);
//// set variables
//double[] uDouble = uNDArr.Storage.GetData<double>();
//for (int idx = 0; idx < uNDArr.size;idx++)
// uDouble[idx] = u[idx];
//vtNDArr.Storage.ReplaceData(vt);
//sNDArr.Storage.ReplaceData(s);
//return (uNDArr,sNDArr,vtNDArr);
}
public void SetData(object p)
{
throw new NotImplementedException();
}
}
}