Example #1
0
		public override bool RemoveCell(SupportSet set, Sheet sheet, int col, int row) {
			if (Contains(sheet, col, row)) {
				// To exclude cell at sheet[col, row], split into up to 4 support ranges
				if (rowInt.min < row) // North, column above [col,row]
				{
					set.Add(Make(sheet, new Interval(col, col), new Interval(rowInt.min, row - 1)));
				}
				if (row < rowInt.max) // South, column below [col,row]
				{
					set.Add(Make(sheet, new Interval(col, col), new Interval(row + 1, rowInt.max)));
				}
				if (colInt.min < col) // West, block to the left of [col,row]
				{
					set.Add(Make(sheet, new Interval(colInt.min, col - 1), rowInt));
				}
				if (col < colInt.max) // East, block to the right of [col,row]
				{
					set.Add(Make(sheet, new Interval(col + 1, colInt.max), rowInt));
				}
				return true;
			}
			else {
				return false;
			}
		}
Example #2
0
 public override bool RemoveCell(SupportSet set, Sheet sheet, int col, int row)
 {
     if (Contains(sheet, col, row))
     {
         // To exclude cell at sheet[col, row], split into up to 4 support ranges
         if (rowInt.min < row)                 // North, column above [col,row]
         {
             set.Add(Make(sheet, new Interval(col, col), new Interval(rowInt.min, row - 1)));
         }
         if (row < rowInt.max)                 // South, column below [col,row]
         {
             set.Add(Make(sheet, new Interval(col, col), new Interval(row + 1, rowInt.max)));
         }
         if (colInt.min < col)                 // West, block to the left of [col,row]
         {
             set.Add(Make(sheet, new Interval(colInt.min, col - 1), rowInt));
         }
         if (col < colInt.max)                 // East, block to the right of [col,row]
         {
             set.Add(Make(sheet, new Interval(col + 1, colInt.max), rowInt));
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #3
0
 public override bool RemoveCell(SupportSet set, Sheet sheet, int col, int row)
 {
     return(Contains(sheet, col, row));
 }
Example #4
0
		// Remove cell sheet[col,row] from given support set, possibly adding smaller
		// support ranges at end of supportSet; if so return true
		public abstract bool RemoveCell(SupportSet set, Sheet sheet, int col, int row);
Example #5
0
 // Remove cell sheet[col,row] from given support set, possibly adding smaller
 // support ranges at end of supportSet; if so return true
 public abstract bool RemoveCell(SupportSet set, Sheet sheet, int col, int row);
Example #6
0
		// Clear the cell's support set; in ArrayFormula also clear the supportSetUpdated flag
		public virtual void ResetSupportSet() { supportSet = null; }
Example #7
0
		// Add the support range to the cell, avoiding direct self-support at sheet[col,row]
		public void AddSupport(Sheet sheet,
							   int col,
							   int row,
							   Sheet suppSheet,
							   Interval suppCols,
							   Interval suppRows) {
			if (supportSet == null) {
				supportSet = new SupportSet();
			}
			supportSet.AddSupport(sheet, col, row, suppSheet, suppCols, suppRows);
		}
Example #8
0
		public override bool RemoveCell(SupportSet set, Sheet sheet, int col, int row) { return Contains(sheet, col, row); }