Dealing with MultiDimArray

I think I’ve touched on this topic before, but I’d like to understand the current status.

Let’s say I’m using a library that uses arrays of arrays. I understand that in Gamma this is translated as MultiDimArray. My question then is, is it possible to painlessly create such objects from types available in Gamma and is it possible to painlessly parse such types?


I don’t understand how to create such a type and how to get data from it. I remember doing it once, but how? (Or it could be a false memory)

Do you have any ideas? Or is it just impossible?
Do I need some kind of C# wrapper for these types?

I have done some research and realised that my question needs clarification as it seems to be a non-standard situation.

I’ve been wanting to adapt and experiment with the WFC algorithm for a couple of years now. And fortunately there is almost an “industry standard” for this algorithm in C#.

For successful implementation, we need to supply a set of objects, something like a dictionary for the algorithm. This is an array of arrays that contain the rules.

ITopoArray<char> sample = TopoArray.Create(new[]
    new[]{ '_', '_', '_'},
    new[]{ '_', '*', '_'},
    new[]{ '_', '_', '_'},
}, periodic: false);

There are options of Array, but they are very different constructors and there are other important things that aren’t accessible without dealing with MultiDimArrays in Gamma:


I think the main idea is that this approach allows you, for example, to feed a set of arbitrary arrays. 1x3, 2x2, 4x3 and so on, in a single feed. The simple Array allows you to feed an array containing data that is inherently one-dimensional.

look at the code:

For example, I can’t create GraphTopology without creating MultiDimArray: