// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
// over every element of the matrix and multiply it by c.
188403
func (m1 Mat4) Mul(c float32) Mat4 {
	return Mat4{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c, m1[8] * c, m1[9] * c, m1[10] * c, m1[11] * c, m1[12] * c, m1[13] * c, m1[14] * c, m1[15] * c}
}
1148778
func (v1 Vec3) Mul(c float32) Vec3 {
	return Vec3{v1[0] * c, v1[1] * c, v1[2] * c}
}
1212668
func Mul(a, b []float32) {
	b = b[:len(a)]
	for i, v := range a {
		a[i] = v * b[i]
	}
}
51826
func (mat *T) AssignMul(a, b *T) *T {
	mat[0] = a.MulVec3(&b[0])
	mat[1] = a.MulVec3(&b[1])
	mat[2] = a.MulVec3(&b[2])
	return mat
}
1015268
func (vn *VecN) Mul(dst *VecN, c float32) *VecN {
	if vn == nil {
		return nil
	}
	dst = dst.Resize(len(vn.vec))

	for i, el := range vn.vec {
		dst.vec[i] = el * c
	}

	return dst
}
269891
func Mul(a, b []float64) {
	if len(a) != len(b) {
		panic("vectors must be the same length")
	}
	mulAsm(a, b)
}
616441
func (u *Ugen) Mul(val Input) Input {
	return binOpMul(u.Rate, u, val, u.NumOutputs)
}
1147190
func (m1 Mat3x2) Mul2x3(m2 Mat2x3) Mat3 {
	return Mat3{
		m1[0]*m2[0] + m1[3]*m2[1],
		m1[1]*m2[0] + m1[4]*m2[1],
		m1[2]*m2[0] + m1[5]*m2[1],
		m1[0]*m2[2] + m1[3]*m2[3],
		m1[1]*m2[2] + m1[4]*m2[3],
		m1[2]*m2[2] + m1[5]*m2[3],
		m1[0]*m2[4] + m1[3]*m2[5],
		m1[1]*m2[4] + m1[4]*m2[5],
		m1[2]*m2[4] + m1[5]*m2[5],
	}
}
1243444
func (m1 Mat2) Mul(c float32) Mat2 {
	return Mat2{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c}
}
1015363
func Mul(a, b []float64) {
	b = b[:len(a)]
	for i, v := range a {
		a[i] = v * b[i]
	}
}
1211096
func Mul(a, b *Matrix) (*Matrix, error) {
	if a.Cols != b.Rows {
		return nil, errors.New("Size was wrong")
	}
	res := make([][]float32, a.Rows)
	var wg sync.WaitGroup
	for i := 0; i < int(a.Rows); i++ {
		wg.Add(1)
		go execMul(res, i, a, b, &wg)
	}
	wg.Wait()
	return NewMatrix(res), nil
}
880261
func (m1 Mat2x3) Mul3x1(m2 Vec3) Vec2 {
	return Vec2{
		m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2],
		m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2],
	}
}
1111971
func (m1 Mat4x3) Mul3x2(m2 Mat3x2) Mat4x2 {
	return Mat4x2{
		m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2],
		m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2],
		m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2],
		m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2],
		m1[0]*m2[3] + m1[4]*m2[4] + m1[8]*m2[5],
		m1[1]*m2[3] + m1[5]*m2[4] + m1[9]*m2[5],
		m1[2]*m2[3] + m1[6]*m2[4] + m1[10]*m2[5],
		m1[3]*m2[3] + m1[7]*m2[4] + m1[11]*m2[5],
	}
}
702240
func (p *poly) Mul(q *poly) poly {
	// extra=2 because:
	// * some power of 2 is a K-th root of unity when n is a multiple of K/2.
	// * 2 itself is a square (see fermat.ShiftHalf)
	n := valueSize(p.k, p.m, 2)

	pv, qv := p.Transform(n), q.Transform(n)
	rv := pv.Mul(&qv)
	r := rv.InvTransform()
	r.m = p.m
	return r
}
798677
func (m1 Mat3x2) Mul2x4(m2 Mat2x4) Mat3x4 {
	return Mat3x4{
		m1[0]*m2[0] + m1[3]*m2[1],
		m1[1]*m2[0] + m1[4]*m2[1],
		m1[2]*m2[0] + m1[5]*m2[1],
		m1[0]*m2[2] + m1[3]*m2[3],
		m1[1]*m2[2] + m1[4]*m2[3],
		m1[2]*m2[2] + m1[5]*m2[3],
		m1[0]*m2[4] + m1[3]*m2[5],
		m1[1]*m2[4] + m1[4]*m2[5],
		m1[2]*m2[4] + m1[5]*m2[5],
		m1[0]*m2[6] + m1[3]*m2[7],
		m1[1]*m2[6] + m1[4]*m2[7],
		m1[2]*m2[6] + m1[5]*m2[7],
	}
}
1081113
func (ms *MatStack) LeftMul(m mgl32.Mat4) {
	(*ms)[len(*ms)-1] = m.Mul4((*ms)[len(*ms)-1])
}
478341
func (m1 Mat3x4) Mul(c float64) Mat3x4 {
	return Mat3x4{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c, m1[8] * c, m1[9] * c, m1[10] * c, m1[11] * c}
}