Good day to all!
Faced a problem. I’m not very good with mathematics, but nevertheless, it is necessary for the program to select 2 submatrices (subMatrixA, subMatrixB ) from the matrix (w) according to the following example:
// main matrix
final w = [
[0, 0.6, 0.3, 0.3, 0.5, 0.5],
[0.9, 0, 0.7, 0.8, 0.2, 0.5],
[0.2, 0.8, 0, 0.4, 0.6, 0.3],
[0.1, 0.7, 0.6, 0, 0.7, 0.2],
[0.9, 0.8, 0.5, 0.3, 0, 0.7],
[0.8, 0.6, 0.3, 0.7, 0.7, 0],
];
// a - array of indexes in w matrix (rows and columns)
function selection(a) {...} // need an algorithm
// call function with algorithm
selection([0, 1]) // which means - 0 and 1 line
// result
subMatrixA =
[
[0, 0.6]
[0.9, 0 ]
]
subMatrixB =
[
[0.3, 0.3, 0.5, 0.5]
[0.7, 0.8, 0.2, 0.5]
]
How I can do it? I hope for your help, thanks.
I tried to write code an algorithm, but i very bad in algorithms and math...