Hi I have 20 'for' loops to create more than 40 million variations with
repetitions. More precisely: I have total of nine factors with three
possible levels (3^9) and 11 factors with 2 possible levels (2^11),
which gives total of 40 310 784 possible variations.
for (a=0; a<3; a++)
{for (b=0; b<2; b++)
{for (c=1; c<3; c++)
{for (d=0; d<3; d++)
{for (e=0; e<3; e++)
{for (f=1; f<3; f++)
{for (g=0; g<3; g++)
{for (h=1; h<3; h++)
{for (i=0; i<3; i+=2)
{for (j=0; j<3; j++)
{for (k=1; k<3; k++)
{for (l=0; l<3; l++)
{for (m=0; m<3; m+=2)
{for (n=0; n<3; n++)
{for (p=0; p<3; p+=2)
{for (q=0; q<3; q++)
{for (t=1; t<3; t++)
{for (u=0; u<3; u++)
{for (x=1; x<3; x++)
{for (y=1; y<3; y++)
Using this approach I have to create a text file which lists all
possible variation and access it for some additional operations.
I was wondering if anyone has an idea how to make this more 'object
oriented' by creating a code which handles the pattern of these
variation and thus give me the ability to skip creation of text file
(requires a lots of memory) and simply create one variation after the
other so that I can do all necessary operation on only one variation at
the time.
I would really appreciate any help or hint where I can find this code.
B