Example #1
0
        private void AddUpAccumulateArray( Integer Result, int HowManyToAdd, int BiggestIndex )
        {
            try
            {
            for( int Count = 0; Count <= (BiggestIndex + 1); Count++ )
              Result.SetD( Count, 0 );

            Result.SetIndex( BiggestIndex );

            for( int Count = 0; Count < HowManyToAdd; Count++ )
              {
              int HowManyDigits = AccumulateArray[Count].GetIndex() + 1;
              for( int CountDigits = 0; CountDigits < HowManyDigits; CountDigits++ )
            {
            ulong Sum = AccumulateArray[Count].GetD( CountDigits ) + Result.GetD( CountDigits );
            Result.SetD( CountDigits, Sum );
            }
              }

            // This is like ax + by + cz + ... = Result.
            // You know what a, b, c... are.
            // But you don't know what x, y, and z are.
            // So how do you reverse this and get x, y and z?
            // Is this reversible?

            Result.OrganizeDigits();
            }
            catch( Exception Except )
              {
              throw( new Exception( "Exception in AddUpAccumulateArray(): " + Except.Message ));
              }
        }