Removal of duplicate matrices from a list

asked 2022-07-27 10:40:33 +0200

sgmth gravatar image

For 'n' different sets of ci's we form list

List_C=[c1,c2,c3,c4]

Similarly for 'n' different sets of di's, ei's we form lists:

List_D=[d1,d2,d3,d4]

List_E=[e1,e2,e3,e4]

And we have coressponding sets of matrices:

MC=matrix(2,2, List_C)

MD=matrix(2,2, List_D)

ME=matrix(2,2, List_E)

Then we form the following list:

List_Mat=[MC,MD,ME].

Now how to remove duplicate list of matrices in List_Mat?

edit retag flag offensive close merge delete

Comments

Use a set instead of a list for List_C. If this is in reference to your other question, it would be more efficient to do this as you construct the lists of elements: since the lists are so long, eliminating some possibilities early should make everything faster. Also, does order matter? Lists are inherently ordered, and is that important? That's was not clear in the other questions, either.

John Palmieri gravatar imageJohn Palmieri ( 2022-07-27 17:59:47 +0200 )edit