You can certainly initialize them all at once, although it sounds like a lot of tedious typing:
float terms[256][4] = {
{ 0, 0, 3, 1 },
{ 0, 0, 13, 1 },
{ 0, 0, 3, 2}
...
};
I simplified it down to an array of 256 4-element arrays, for simplicity. If you wanted to really express the intended nesting, which of course is nice, you need to do:
float terms[256][2][2] = {
{ { 0, 0 }, { 3, 1 } },
{ { 0, 0 }, { 13, 1 } },
{ { 0, 0 }, { 3, 2 }}
...
};
That would be 256 lines, each of which has a "list" of two "lists" of floats. Each list needs braces. But, since C++ supports suppressing braces in things like these, you could also do:
float terms[256][2][2] = {
{ 0, 0, 3, 1 },
{ 0, 0, 13, 1 },
{ 0, 0, 3, 2}
...
};
In fact, you could even remove the braces on each line, they're optional too. I consider relying on the suppression slightly shady, though.
If you want to use higher-level types than a nested array of float
(such as a Matrix<2,2>
type, or something), initialization might become tricker.