0

I would like to ask if there is a data structure or some sort of dictionary that would help me to solve this problem.

  1. First I create array of arrays of int.

    11,32,21,10; 455,476,465,454; 11,32,476,455; ... 10,32,21,11;

  2. Besides that I am adding points to separate array of arrays

    Pt11,Pt32,Pt21,Pt10; Pt455,Pt476,Pt465,Pt454; Pt11,Pt32,Pt476,Pt455; ... Pt10,Pt32,Pt21,Pt11;

Is there a way to create a dictionary to add array of points by name, and the name is array of integers - 10,32,21,11 - .

But the problem I have, is that I want to add to the same dictionary point array if name is mixed - 11,32,21,10.

So dictionary would point to the same collection - if I call 10,32,21,11 or 11,32,21,10. In other words 10,32,21,11 and 11,32,21,10 is the same name because elements are just ordered differently.

I do not know if it clear as I mixing several things: 1. Is it possible to create at least a dictionary whose name is an array? 2. Then if yes it probably would not point to the same points array if I add elements dictionary.Add(10,32,21,11, pt[]); dictionary.Add(11,32,21,10, pt[]);

Petras Vestartas
  • 136
  • 1
  • 3
  • 10
  • It would be helpful if you actually posted the code for creating the arrays and adding points because that way there is less ambiguity in the question, people can see if there is an error in the code, and there is something people can copy/paste to start an answer with. – Rufus L Jul 11 '17 at 16:43
  • 1
    https://stackoverflow.com/questions/14663168/an-integer-array-as-a-key-for-dictionary and https://stackoverflow.com/questions/3669970/compare-two-listt-objects-for-equality-ignoring-order answer your question. If you looking for more - https://www.bing.com/search?q=C%23%20compare%20array%20ignore%20order and https://www.bing.com/search?q=c%23+array+as+dictionary+key are good searches. – Alexei Levenkov Jul 11 '17 at 16:46
  • Yes, you can do it. Simply, when you will add new items into `Dictionary, IEnumerable>`, you'll be have to `Order` Key(which is `IEnumerable`). – KamikyIT Jul 11 '17 at 16:49
  • Just by the nature of the question, it sounds like you may need to step back and look at the big picture. What do these arrays represent? Why are you storing the related data in separate objects? Would a simple class make this easier? Maybe what you're doing is correct, but it has the potential to become a maintenance nightmare. – Rufus L Jul 11 '17 at 16:49
  • It is basically mesh points of faces, that I am mapping from exploded mesh to previous solid mesh. But I cannot find a method two store two separate points under the same index. It is messed up I am trying to rethink about this problem... – Petras Vestartas Jul 11 '17 at 17:31

0 Answers0