I have a ilnumerics logical symetric matrix like that
0 0 0 0 0 0 1 1 1 1
0 0 0 0 0 1 0 1 1 1
0 0 0 0 0 1 1 0 1 1
0 0 0 0 0 1 1 0 0 1
0 0 0 0 0 1 1 1 1 0
0 1 1 1 1 0 0 0 0 0
1 0 1 1 1 0 0 0 0 0
1 1 0 0 1 0 0 0 0 0
1 1 1 0 1 0 0 0 0 0
1 1 1 1 0 0 0 0 0 0
I want to obtain all dimensions (row & column) where value == 1
result = (0,6), (0,7), (0,8), (0,9) (1,5), (1,7), (1,8), (1,9) (2,5), (2,6), (2,8), (1,9) (3,5), (3,6), (3,9) (4,5), (4,6), (4,7), (4,8)
Is there a quicker way of doing this with ilnumerics library in C#?
EDIT: Here is my solution
ILNumerics.ILLogical matrixThreshold;
..... Some C# code
for (int i = 0; i < matrixThreshold.Length; i++)
for (int j = i + 1; j < matrixThreshold.Length; j++)
if (matrixThreshold.GetValue(i, j) == 1) Console.Write("({0},{1}){2}", i, j, Environment.NewLine);