Multiply a matrix by another one.

        Other matrix must be a numpy array, a scalar,
        or another matrix in local mode.

        Parameters
        ----------
        other : Matrix, scalar, or numpy array
            A matrix to multiply with
353101
def times(self, other):
        
        if isinstance(other, ScalarType):
            other = asarray(other)
            index = self.index
        else:
            if isinstance(other, list):
                other = asarray(other)
            if isinstance(other, ndarray) and other.ndim < 2:
                other = expand_dims(other, 1)
            if not self.shape[1] == other.shape[0]:
                raise ValueError('shapes %s and %s are not aligned' % (self.shape, other.shape))
            index = arange(other.shape[1])

        if self.mode == 'local' and isinstance(other, Series) and other.mode == 'spark':
            raise NotImplementedError

        if self.mode == 'spark' and isinstance(other, Series) and other.mode == 'spark':
            raise NotImplementedError

        if self.mode == 'local' and isinstance(other, (ndarray, ScalarType)):
            return self._constructor(dot(self.values, other), index=index)

        if self.mode == 'local' and isinstance(other, Series):
            return self._constructor(dot(self.values, other.values), index=index)

        if self.mode == 'spark' and isinstance(other, (ndarray, ScalarType)):
            return self.map(lambda x: dot(x, other), index=index)

        if self.mode == 'spark' and isinstance(other, Series):
            return self.map(lambda x: dot(x, other.values), index=index)
234716
def iterate(matrix, expansion, inflation):
    
    # Expansion
    matrix = expand(matrix, expansion)

    # Inflation
    matrix = inflate(matrix, inflation)

    return matrix
646285
def matrix_multiply(m0, m1):
    new_matrix = numpy.zeros((m0.shape[0],m1.shape[1]))
    ""
    for i in xrange(m0.shape[0]):
        for j in xrange(m1.shape[1]):
            r=0
            for k in xrange(m1.shape[0]):
                r += m0[i,k]*m1[k,j]
            new_matrix[i,j]=r
    return new_matrix
58817
public void add(ScalableStatistics other) {
    count += other.count;
    min = Math.min(min, other.min);
    max = Math.max(max, other.max);
    sum += other.sum;
    sumOfSquares += other.sumOfSquares;
    tdigest.add(other.tdigest);
    if (other.exactValues != null) {
      for (int i = 0; i < other.numExactValues; i++) {
        addQuantileValue(other.exactValues[i]);
      }
    }
  }
152494
def *(other)
      if Scalar === other || Duration === other
        Duration.new(value * other.value, parts.map { |type, number| [type, number * other.value] })
      elsif Numeric === other
        Duration.new(value * other, parts.map { |type, number| [type, number * other] })
      else
        raise_type_error(other)
      end
    end
23311
def multiply(self, other):
        """"""
        return self.operation(other, lambda x, y: x * y)
337959
def +(other)
      self.class.new(*(
        [
          usage,
          processor_id == other.processor_id ? processor_id : 0,
        ] +
        values_at(2..-3).zip(other.values_at(2..-3)).map { |x, y| x + y } +
        [
          [ start_at, other.start_at ].min,
          [ stop_at, other.stop_at ].max
        ])
      )
    end
263940
public void copyTo(Matrix other)
    {
        if (this.rows() != other.rows() || this.cols() != other.cols())
            throw new ArithmeticException("Matrices are not of the same dimension");
        for(int i = 0; i < rows(); i++)
            this.getRowView(i).copyTo(other.getRowView(i));
    }
683907
public Matrix4f swap(Matrix4f other) {
        MemUtil.INSTANCE.swap(this, other);
        int props = properties;
        this.properties = other.properties();
        other.properties = props;
        return this;
    }
966701
def +(other)
      rgb =
        case other
        when RGB
          compound_by(other.rgb) { |a, b| [a+b, 255].min }
        when Array
          raise ArgumentError, "Invalid size of Array given" unless other.size==3
          compound_by(other) { |a, b| (a + b) % 256 }
        when Integer
          compound_by([other] * 3) { |a, b| (a + b) % 256 }
        else
          raise ArgumentError, "Invalid argument given"
        end
      self.class.new *rgb
    end
395371
public Mat4 add(final Mat4 other) {
            return new Mat4(
                            m00 + other.m00, m01 + other.m01, m02 + other.m02, m03 + other.m03,
                            m10 + other.m10, m11 + other.m11, m12 + other.m12, m13 + other.m13,
                            m20 + other.m20, m21 + other.m21, m22 + other.m22, m23 + other.m23,
                            m30 + other.m30, m31 + other.m31, m32 + other.m32, m33 + other.m33
            );
        }
357786
public void elemAdd(Tensor other) {
        checkEqualSize(this, other);
        for (int c = 0; c < this.values.length; c++) {
            addValue(c, other.values[c]);
        }
    }
523204
public void combine(DoubleSummaryStatistics other) {
        count += other.count;
        simpleSum += other.simpleSum;
        sumWithCompensation(other.sum);
        sumWithCompensation(other.sumCompensation);
        min = Math.min(min, other.min);
        max = Math.max(max, other.max);
    }
1315912
def multiply(self, other, out=None):
        
        return self.space.multiply(self, other, out=out)
1034850
def multiply(self, a, b):
    
    if a is None or b is None: return None
    m, n = len(a), len(b[0])
    if len(b) != n:
        raise Exception("A's column number must be equal to B's row number.")
    l = len(b[0])
    table_a, table_b = {}, {}
    for i, row in enumerate(a):
        for j, ele in enumerate(row):
            if ele:
                if i not in table_a: table_a[i] = {}
                table_a[i][j] = ele
    for i, row in enumerate(b):
        for j, ele in enumerate(row):
            if ele:
                if i not in table_b: table_b[i] = {}
                table_b[i][j] = ele
    c = [[0 for j in range(l)] for i in range(m)]
    for i in table_a:
        for k in table_a[i]:
            if k not in table_b: continue
            for j in table_b[k]:
                c[i][j] += table_a[i][k] * table_b[k][j]
    return c
394792
def *(other)
      case other
      when Mat4    then mul_mat4(other)
      when Mat3    then mul_mat3(other)
      when Vec3    then mul_vec3(other)
      when Vec4    then mul_vec4(other)
      when Numeric then mul_scalar(other)
      else raise ArgumentError, "Don't know how to multiply Mat4 with object: #{other.inspect}"
      end
    end
939324
public Matrix multiply(Matrix B)
    {
        Matrix C = new DenseMatrix(this.rows(), B.cols());
        multiply(B, C);
        return C;
    }