n dimensional - C++ Generate and store the co-ordinates of an n-cube -


I want to write a function to create and store the coordinates of an N-cube and I do not know how to start . In particular, I want to generate coordinates for this N-cube or similarly randomly distributed cloud for the cube and want to store them. What would be a good way to start with this, or if possible, a quick solution?

T wants to give C ++ source code for this problem, however, here it is thought How can you prepare it.

In a hypervisque, all the bit-strings of length are n . Thus, there are 2 ^ n possibilities for coordinates in the total

How can you do this again and again:

  • If you want to create a coordinate for n = 1 , simply enter 0 and 1

  • < P> If you select n> 1, , then include all the possible coordinates for 0 and n '= n-1 , then 1 < / Code> and insert it into all possible coordinates for n '= N-1


Comments