Returns {@code true} if the dimensions in {@code otherDims} occur
occur at the very beginning of this tensor's dimension array.

@param otherDims
@return
177133
public boolean areDimensionsLeftAligned(int[] otherDims) {
    for (int i = 0; i < otherDims.length; i++) {
      if (otherDims[i] != dimensions[i]) {
        return false;
      }
    }
    return true;
  }
223561
public static boolean isScalar(INDArray indexOver, INDArrayIndex... indexes) {
        boolean allOneLength = true;
        for (int i = 0; i < indexes.length; i++) {
            allOneLength = allOneLength && indexes[i].length() == 1;
        }

        int numNewAxes = NDArrayIndex.numNewAxis(indexes);
        if (allOneLength && numNewAxes == 0 && indexes.length == indexOver.rank())
            return true;
        else if (allOneLength && indexes.length == indexOver.rank() - numNewAxes) {
            return allOneLength;
        }

        return allOneLength;
    }
1336360
public boolean hasJoinedEdge(Space other) {
		// aligned vertical edges
		if (inTolerance(x,other.x+other.width) || inTolerance(x+width,other.x)) {
			if ((y >= other.y) && (y <= other.y + other.height)) {
				return true;
			}
			if ((y+height >= other.y) && (y+height <= other.y + other.height)) {
				return true;
			}
			if ((other.y >= y) && (other.y <= y + height)) {
				return true;
			}
			if ((other.y+other.height >= y) && (other.y+other.height <= y + height)) {
				return true;
			}
		}
		// aligned horizontal edges
		if (inTolerance(y, other.y+other.height) || inTolerance(y+height, other.y)) {
			if ((x >= other.x) && (x <= other.x + other.width)) {
				return true;
			}
			if ((x+width >= other.x) && (x+width <= other.x + other.width)) {
				return true;
			}
			if ((other.x >= x) && (other.x <= x + width)) {
				return true;
			}
			if ((other.x+other.width >= x) && (other.x+other.width <= x + width)) {
				return true;
			}
		}
		
		return false;
	}
990233
def is_adjacent(self, other: ops.Qid) -> bool:
        """"""
        return (isinstance(other, GridQubit) and
                abs(self.row - other.row) + abs(self.col - other.col) == 1)
372811
public boolean contains(Shape other) {
    	if (other.intersects(this)) {
    		return false;
    	}
    	
    	for (int i=0;i<other.getPointCount();i++) {
    		float[] pt = other.getPoint(i);
    		if (!contains(pt[0], pt[1])) {
    			return false;
    		}
    	}
    	
    	return true;
    }
1330640
public boolean equals3D(final Coordinate other) {
        return getX() == other.getX() && getY() == other.getY()
                && (getZ() == other.getZ() || Double.isNaN(getZ()) && Double.isNaN(other.getZ()));
    }
86915
function (other) {
        if (other instanceof tree.Dimension) {
            if (other.value > this.value) {
                return -1;
            } else if (other.value < this.value) {
                return 1;
            } else {
                return 0;
            }
        } else {
            return -1;
        }
    }
15772
public void product(IntFloatVector other) {
        // TODO: Add special case for IntFloatDenseVector.
        for (int i=0; i<size; i++) {
            elements[i + start] *= other.get(i);
        }
    }
395592
public boolean intersects(GeoBounds other)
    {
        boolean rv = false;
        for (Rectangle2D r1 : rects)
        {
            for (Rectangle2D r2 : other.rects)
            {
                rv = r1.intersects(r2);
                if (rv)
                {
                    break;
                }
            }
            if (rv)
            {
                break;
            }

        }
        return rv;
    }
202549
public void elemMultiply(Tensor other) {
        checkEqualSize(this, other);
        for (int c = 0; c < this.values.length; c++) {
            multiplyValue(c, other.values[c]);
        }     
    }
995711
public boolean canMergeRemainderOrdering(OrderingScore<S> other) {
        if (this == other || (getHandledCount() == 0 && other.getHandledCount() == 0)) {
            return true;
        }

        if (isIndexClustered() == other.isIndexClustered()
            && getIndexPropertyCount() == other.getIndexPropertyCount()
            && shouldReverseOrder() == other.shouldReverseOrder()
            && getHandledOrdering().equals(other.getHandledOrdering()))
        {
            // The remainder orderings cannot conflict.
            OrderingList<S> thisRemainderOrdering = getRemainderOrdering();
            OrderingList<S> otherRemainderOrdering = other.getRemainderOrdering();

            int size = Math.min(thisRemainderOrdering.size(), otherRemainderOrdering.size());
            for (int i=0; i<size; i++) {
                if (!thisRemainderOrdering.get(i).equals(otherRemainderOrdering.get(i))) {
                    return false;
                }
            }

            return true;
        }

        return false;
    }
815111
private void simpleIncrement(TensorBase other, double multiplier) {
    Preconditions.checkArgument(Arrays.equals(other.getDimensionNumbers(), getDimensionNumbers()));
    if (other instanceof DenseTensorBase) {
      double[] otherTensorValues = ((DenseTensorBase) other).values;
      Preconditions.checkArgument(otherTensorValues.length == values.length);
      int length = values.length;
      for (int i = 0; i < length; i++) {
        values[i] += otherTensorValues[i] * multiplier;
      }
    } else {
      int otherSize = other.size();
      for (int i = 0; i < otherSize; i++) {
        long keyNum = other.indexToKeyNum(i);
        double value = other.getByIndex(i);
        values[keyNumToIndex(keyNum)] += value * multiplier;
      }
    }
  }
345893
def _compare(self, other, method):
        """"""
        # This needs to be updated to take uncertainty into account:
        if isinstance(other, abc_mapping_primitives.Coordinate):
            if self.get_dimensions() != other.get_dimensions():
                return False
            other_values = other.get_values()
            for index in range(self._dimensions):
                if not method(self._values[index], other_values[index]):
                    return False
            return True
        return NotImplemented
357953
public void set(LongDoubleSortedVector other) {
        this.used = other.used;
        this.indices = LongArrays.copyOf(other.indices);
        this.values = DoubleArrays.copyOf(other.values);
    }
225892
def on_separate_dims(self, other_kernel):
        
        if isinstance(self.active_dims, slice) or isinstance(other_kernel.active_dims, slice):
            # Be very conservative for kernels defined over slices of dimensions
            return False

        if np.any(self.active_dims.reshape(-1, 1) == other_kernel.active_dims.reshape(1, -1)):
            return False

        return True
392144
public boolean touches(IndexRange other) {
        checkArgNotNull(other, "other");
        return other.end == start || end == other.start;
    }
1076725
private DenseTensor fastInnerProductRightAligned(Tensor other, long maxKeyNum, long keyNumIncrement, 
      int[] newDims, int[] newSizes) {        
    DenseTensorBuilder resultBuilder = new DenseTensorBuilder(newDims, newSizes);
    int otherSize = other.size();
    double[] otherValues = other.getValues();
    // Iterate over the keys of this, then (hopefully sparsely) iterate over the 
    // keys of {@code other},
    double innerProd;
    int otherIndex;
    int finalIndex = (int) (maxKeyNum / keyNumIncrement);
    long myKeyNum;
    for (int i = 0; i < finalIndex; i++) {
      myKeyNum = i * keyNumIncrement;
      innerProd = 0.0;
      for (otherIndex = 0; otherIndex < otherSize; otherIndex++) {
        long otherKeyNum = other.indexToKeyNum(otherIndex);
        double otherValue = otherValues[otherIndex];
        innerProd += values[(int) (myKeyNum + otherKeyNum)] * otherValue;
      }
      resultBuilder.putByKeyNum(i, innerProd);
    }
    return resultBuilder.buildNoCopy();
  }