//note: Memory-Size = orArray.length * andArray.length
Pos3D activationArray = new Pos3D[ n ];
Pos3D notArray = new Pos3D[ activationArray.length ];
Pos3D andArray = new Pos3D[ 2^n ];
Pos3D orArray = new Pos3D[ m ];
SMLink linkArray = new SMLink[ (notArray.length * andArray.length)+(andArray.length * orArray.length)];
int itLink = 0;
for( i=0; i<notArray.length; i++ )
{
//activation to NOT
linkArray[ itLink++ ] = new SMLink( activationArray[i], notArray[i] );
//activation&NOT to AND
for( ii=0; ii<andArray.length; ii++ )
{
if( ii=2^i ) linkArray[ itLink++ ] = new SMLink( activationArray[i], andArray[ii] );
else linkArray[ itLink++ ] = new SMLink( notArray[i], andArray[ii] );
//AND to OR
for( iii=0; iii<orArray.length; iii++)
{
byte = inputStream.nextByte();
if( byte &0x01 )linkArray[ itLink++] = new SMLink( andArray[ii], orArray[iii] );
else ++itLink;
if( byte &0x02 )linkArray[ itLink++] = new SMLink( andArray[ii], orArray[iii] );
else ++itLink;
if( byte &0x04 )linkArray[ itLink++] = new SMLink( andArray[ii], orArray[iii] );
else ++itLink;
if( byte &0x08 )linkArray[ itLink++] = new SMLink( andArray[ii], orArray[iii] );
else ++itLink;
if( byte &0x10 )linkArray[ itLink++] = new SMLink( andArray[ii], orArray[iii] );
else ++itLink;
if( byte &0x20 )linkArray[ itLink++] = new SMLink( andArray[ii], orArray[iii] );
else ++itLink;
if( byte &0x40 )linkArray[ itLink++] = new SMLink( andArray[ii], orArray[iii] );
else ++itLink;
if( byte &0x80 )linkArray[ itLink++] = new SMLink( andArray[ii], orArray[iii] );
else ++itLink;
}
}
}