void addRow(int[] row, int index) { PrimeImplicantsChartRow temp = new PrimeImplicantsChartRow(); temp.setRow(row, index); table.Add(temp); }
/* * createOneMinimumeCompinationOfNonEssentialTable is a function that calculates one possible minimume compination of the non essential terms * and is faster than the function createMinimumeCompinationOfNonEssentialTable. */ private void createOneMinimumeCompinationOfNonEssentialTable() { List<PrimeImplicantsChartRow> temp_table = non_essential_table; List<int> temp_combine = new List<int>(); int max_n = 0; PrimeImplicantsChartRow max_r = new PrimeImplicantsChartRow(); for (int j = 0; j < temp_table.Count; j++) temp_table[j].setRow(combineNotFirst(satisfied_columns_by_essintial_primes, temp_table[j].Row), temp_table[j].Row_index); while (temp_table.Count > 0) { max_n = calculateRowWithMaximumNumberOfOnes(temp_table); max_r = temp_table[max_n]; temp_combine.Add(max_r.Row_index); temp_table.RemoveAt(max_n); for (int j = 0; j < temp_table.Count; j++) { temp_table[j].setRow(combineNotFirst(max_r.Row, temp_table[j].Row), temp_table[j].Row_index); if (temp_table[j].getNumberOfOnesInRow() == 0) { temp_table.RemoveAt(j); j--; } } } minimume_compination_of_non_essential_table.Add(temp_combine); }