forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNdArray.Inv.cs
More file actions
50 lines (42 loc) · 1.68 KB
/
NdArray.Inv.cs
File metadata and controls
50 lines (42 loc) · 1.68 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
namespace NumSharp
{
public partial class NDArray
{
public NDArray inv()
{
return null;
//var npInv = new NDArray(this.Storage.DType, this.shape);
//Array matrixStorage = this.Storage.GetData();
//Array invStorage = Arrays.Create(npInv.Storage.DType, matrixStorage.Length);
//switch (matrixStorage)
//{
// case double[] np:
// {
// double[][] matrix = new double[this.Storage.Shape.Dimensions[0]][];
// for (int idx = 0; idx < matrix.Length; idx++)
// {
// matrix[idx] = new double[this.Storage.Shape.Dimensions[1]];
// for (int jdx = 0; jdx < matrix[idx].Length; jdx++)
// matrix[idx][jdx] = np[this.Storage.Shape.GetOffset(slice, idx, jdx)];
// }
// double[][] matrixInv = MatrixInv.InverseMatrix(matrix);
// double[] invArray = invStorage as double[];
// for (int idx = 0; idx < npInv.shape[0]; idx++)
// {
// for (int jdx = 0; jdx < npInv.shape[1]; jdx++)
// {
// invArray[this.Storage.Shape.GetOffset(slice, idx, jdx)] = matrixInv[idx][jdx];
// }
// }
// break;
// }
// default:
// {
// throw new IncorrectTypeException();
// }
//}
//npInv.Storage.ReplaceData(invStorage);
//return npInv;
}
}
}