Note that there are some explanatory texts on larger screens.

plurals
  1. POwhat data structure to use for multidimensional mesh grid? (c++)
    text
    copied!<p>I need to code a test platform for testing a specific algorithm. The system is supposed to be definable by input and 3 dimensional - similar to network on chip it has both node and link elements connecting to connect them. Due to the dimensions and links between nodes i have had some hardships on figuring out what data structures to use - a 3 dimensional array like array[x][y][z] is hard to handle as the pointer with drawbacks when adding links to connect the nodes (leaves several null value holes in the structure). Binary search trees are hard to realize since its a grid type. For this reason i have thought about doing a linked list where links are easier to implement. (the final testing platform should look something like the presentation below) where every link is also mapped down as they contain communication schedules</p> <pre><code>01-------02-------03 | \ | \ | \ | 10----|--11----|--12 | | \ | | \ | | \ | | 19-|--|--20-|--|--21 04-------05-------06 | | | \ | | \| | | \| | | 13----|--14----|--15 | | | \| | | \| | | \| | | 22-|--|--23-|--|--24 07-------08-------09 | | \| | \| | \| | 16-------17-------18 | \| \| \| 25-------26-------27 </code></pre> <p>Can any of you offer some help as to what type of structure in c++ would suit this kind of task. The finished program should be able to generate such a structure, given the dimension parameters of x, y and z.</p> <p>currently a the rough outline should look like this</p> <pre><code>&gt;class Node{ &gt; public: &gt; Link* north; &gt; Link* east; &gt; Link* south; &gt; Link* west; &gt; Link* up; &gt; Link* down; &gt; //will contain a node specific scheduler &gt;} &gt; &gt;class Link{ &gt; &gt; Node* A; &gt; Node* B; &gt; //will contain a link specific scheduler &gt;} </code></pre> <p>EDIT 22.01.2013</p> <p>well first of all as its a testing platform simulating a three dimensional network on chip type multiprocessor system. The task this system has to fill is to enable testing certain algorithms to help map tasks onto these nodes (where each node is connected to a processor core). In the light of this, the memory consumption might not be a problem as it is only for testing as i stated, for this reason it is imperative that the system would have both nodes and links as neither of them can be used by two event at the same time (communication on a link will block all other communications etc, this is the reason why i wrote that the class type node/link will have a scheduler in it)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload