// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
// over every element of the matrix and multiply it by c.
491977
func (m1 Mat4x2) Mul(c float32) Mat4x2 {
	return Mat4x2{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c}
}
94026
func (m *Matrix) Multiply(m2 *Matrix) (m3 *Matrix, err error) {
	if m.stride*m2.stride != len(m2.elements) {
		return nil, ErrDimensionMismatch
	}

	m3 = &Matrix{epsilon: m.epsilon, stride: m2.stride, elements: make([]float64, (len(m.elements)/m.stride)*m2.stride)}
	for m1c0, m3x := 0, 0; m1c0 < len(m.elements); m1c0 += m.stride {
		for m2r0 := 0; m2r0 < m2.stride; m2r0++ {
			for m1x, m2x := m1c0, m2r0; m2x < len(m2.elements); m2x += m2.stride {
				m3.elements[m3x] += m.elements[m1x] * m2.elements[m2x]
				m1x++
			}
			m3x++
		}
	}
	return
}
187689
func (s0 Span) Mul(s1 Span) Span {
	return toIntern(toExtern(s0).Mul(toExtern(s1)))
}
200512
func Mult(v1 Vect, s Float) Vect {
	return Vect{v1.X * s, v1.Y * s}
}
569704
func (m1 Mat2) Mul2x3(m2 Mat2x3) Mat2x3 {
	return Mat2x3{
		m1[0]*m2[0] + m1[2]*m2[1],
		m1[1]*m2[0] + m1[3]*m2[1],
		m1[0]*m2[2] + m1[2]*m2[3],
		m1[1]*m2[2] + m1[3]*m2[3],
		m1[0]*m2[4] + m1[2]*m2[5],
		m1[1]*m2[4] + m1[3]*m2[5],
	}
}
802217
func (m1 Mat4x2) Mul2x3(m2 Mat2x3) Mat4x3 {
	return Mat4x3{
		m1[0]*m2[0] + m1[4]*m2[1],
		m1[1]*m2[0] + m1[5]*m2[1],
		m1[2]*m2[0] + m1[6]*m2[1],
		m1[3]*m2[0] + m1[7]*m2[1],
		m1[0]*m2[2] + m1[4]*m2[3],
		m1[1]*m2[2] + m1[5]*m2[3],
		m1[2]*m2[2] + m1[6]*m2[3],
		m1[3]*m2[2] + m1[7]*m2[3],
		m1[0]*m2[4] + m1[4]*m2[5],
		m1[1]*m2[4] + m1[5]*m2[5],
		m1[2]*m2[4] + m1[6]*m2[5],
		m1[3]*m2[4] + m1[7]*m2[5],
	}
}
433419
func (m1 Mat4x2) Mul2(m2 Mat2) Mat4x2 {
	return Mat4x2{
		m1[0]*m2[0] + m1[4]*m2[1],
		m1[1]*m2[0] + m1[5]*m2[1],
		m1[2]*m2[0] + m1[6]*m2[1],
		m1[3]*m2[0] + m1[7]*m2[1],
		m1[0]*m2[2] + m1[4]*m2[3],
		m1[1]*m2[2] + m1[5]*m2[3],
		m1[2]*m2[2] + m1[6]*m2[3],
		m1[3]*m2[2] + m1[7]*m2[3],
	}
}
235674
func mul(vec []float64, factor float64) []float64 {
	ret := make([]float64, len(vec))
	for i := range vec {
		ret[i] = vec[i] * factor
	}
	return ret
}
1286085
func (m1 Mat2x3) Mul3x2(m2 Mat3x2) Mat2 {
	return Mat2{
		m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2],
		m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2],
		m1[0]*m2[3] + m1[2]*m2[4] + m1[4]*m2[5],
		m1[1]*m2[3] + m1[3]*m2[4] + m1[5]*m2[5],
	}
}
525778
func (m1 Mat4x2) Mul2x4(m2 Mat2x4) Mat4 {
	return Mat4{
		m1[0]*m2[0] + m1[4]*m2[1],
		m1[1]*m2[0] + m1[5]*m2[1],
		m1[2]*m2[0] + m1[6]*m2[1],
		m1[3]*m2[0] + m1[7]*m2[1],
		m1[0]*m2[2] + m1[4]*m2[3],
		m1[1]*m2[2] + m1[5]*m2[3],
		m1[2]*m2[2] + m1[6]*m2[3],
		m1[3]*m2[2] + m1[7]*m2[3],
		m1[0]*m2[4] + m1[4]*m2[5],
		m1[1]*m2[4] + m1[5]*m2[5],
		m1[2]*m2[4] + m1[6]*m2[5],
		m1[3]*m2[4] + m1[7]*m2[5],
		m1[0]*m2[6] + m1[4]*m2[7],
		m1[1]*m2[6] + m1[5]*m2[7],
		m1[2]*m2[6] + m1[6]*m2[7],
		m1[3]*m2[6] + m1[7]*m2[7],
	}
}
599501
func (m1 Mat2x4) Mul(c float32) Mat2x4 {
	return Mat2x4{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c}
}
1142525
func (a Affine) Mul(b Affine) Affine {
	return Affine{
		a[0]*b[0] + a[1]*b[3] + a[2]*b[6],
		a[0]*b[1] + a[1]*b[4] + a[2]*b[7],
		a[0]*b[2] + a[1]*b[5] + a[2]*b[8],
		a[3]*b[0] + a[4]*b[3] + a[5]*b[6],
		a[3]*b[1] + a[4]*b[4] + a[5]*b[7],
		a[3]*b[2] + a[4]*b[5] + a[5]*b[8],
		a[6]*b[0] + a[7]*b[3] + a[8]*b[6],
		a[6]*b[1] + a[7]*b[4] + a[8]*b[7],
		a[6]*b[2] + a[7]*b[5] + a[8]*b[8],
	}
}
54489
func ComputeMul(a, b Datum) (d Datum, err error) {
	switch a.Kind() {
	case KindInt64:
		switch b.Kind() {
		case KindInt64:
			r, err1 := MulInt64(a.GetInt64(), b.GetInt64())
			d.SetInt64(r)
			return d, errors.Trace(err1)
		case KindUint64:
			r, err1 := MulInteger(b.GetUint64(), a.GetInt64())
			d.SetUint64(r)
			return d, errors.Trace(err1)
		}
	case KindUint64:
		switch b.Kind() {
		case KindInt64:
			r, err1 := MulInteger(a.GetUint64(), b.GetInt64())
			d.SetUint64(r)
			return d, errors.Trace(err1)
		case KindUint64:
			r, err1 := MulUint64(a.GetUint64(), b.GetUint64())
			d.SetUint64(r)
			return d, errors.Trace(err1)
		}
	case KindFloat64:
		switch b.Kind() {
		case KindFloat64:
			r := a.GetFloat64() * b.GetFloat64()
			d.SetFloat64(r)
			return d, nil
		}
	case KindMysqlDecimal:
		switch b.Kind() {
		case KindMysqlDecimal:
			r := new(MyDecimal)
			err = DecimalMul(a.GetMysqlDecimal(), b.GetMysqlDecimal(), r)
			d.SetMysqlDecimal(r)
			return d, nil
		}
	}

	_, err = InvOp2(a.GetValue(), b.GetValue(), opcode.Mul)
	return d, errors.Trace(err)
}
499661
func (as ArraySpec) Mul(val Input) Input {
	return as.proc(func(i Input) Input {
		return i.Mul(val)
	})
}
1015363
func Mul(a, b []float64) {
	b = b[:len(a)]
	for i, v := range a {
		a[i] = v * b[i]
	}
}
388824
func (mat *T) Mul(f float32) *T {
	for i, col := range mat {
		for j := range col {
			mat[i][j] *= f
		}
	}
	return mat
}
1168202
func (result *Matrix) Multiply(a, b *Matrix) {
	C.cairo_matrix_multiply((*C.cairo_matrix_t)(unsafe.Pointer(result)), (*C.cairo_matrix_t)(unsafe.Pointer(a)), (*C.cairo_matrix_t)(unsafe.Pointer(b)))
}