So, I have a list of lists of lists such as the following:
{{{4}},
{{7, 7}, {7, 7}},
{{5, 5}, {6, 6}},
{{2, 1}, {1, 1}}}
Interpreting the elements of this list as $n\times n$ matrices, I want to iterate through and select matrices where exactly one column and one row consist only of a particular element which only occurs in that column or row.
So, building from the example above, {{4}}
would be selected as there is only one column or row to consider. {{7, 7}, {7, 7}}
would not be selected as, while there is a column and row that each contain only 7, there is also a 7 not contained in that column or row.{{5, 5}, {6, 6}}
would not be selected because, while there are rows that fit our requirement, there are no columns. {{2, 1}, {1, 1}}
would be selected as it satisfies all requirements.
What are some ways that you could put together a function to identify these matrices?
n
, so the whole idea collapses. $\endgroup$