// TransformVec2 multiplies v with mat and saves the result in v.
425933
func (mat *T) TransformVec2(v *vec2.T) {
	// Use intermediate variables to not alter further computations.
	x := mat[0][0]*v[0] + mat[1][0]*v[1]
	v[1] = mat[0][1]*v[0] + mat[1][1]*v[1]
	v[0] = x
}
1158003
func (u *Ugen) Wrap2(val Input) Input {
	return binOpWrap2(u.Rate, u, val, u.NumOutputs)
}
205118
func (c C) Fold2(val Input) Input {
	if v, ok := val.(C); ok {
		return C(fold2(float32(c), float32(v)))
	}
	return c // TODO: fix this
}
1096292
func (mat *T) Translate(v *vec2.T) *T {
	mat[2][0] += v[0]
	mat[2][1] += v[1]
	return mat
}
246943
func (m1 Mat2) Mul2x1(m2 Vec2) Vec2 {
	return Vec2{
		m1[0]*m2[0] + m1[2]*m2[1],
		m1[1]*m2[0] + m1[3]*m2[1],
	}
}
367197
func applyTransform(str string, transform sf) (out string) {
	out = ""

	for idx, line := range strings.Split(str, "\n") {
		out += transform(idx, line)
	}

	return
}
31596
func (v1 Vec2) Sub(v2 Vec2) Vec2 {
	return Vec2{v1[0] - v2[0], v1[1] - v2[1]}
}
1003478
func TransformVars(x interface{}, f func(Var) (Value, error)) (interface{}, error) {
	t := &GenericTransformer{func(x interface{}) (interface{}, error) {
		if v, ok := x.(Var); ok {
			return f(v)
		}
		return x, nil
	}}
	return Transform(t, x)
}
1248960
func Add(v1, v2 Vect) Vect {
	return Vect{v1.X + v2.X, v1.Y + v2.Y}
}
989746
func (t *transformer) transform(key string, fn func(string) string) bool {
	t.mut.Lock()
	defer t.mut.Unlock()
	val, found := t.cache[key]
	if !found {
		return false
	}
	str, ok := val.(string)
	if !ok {
		return false
	}
	newStr := fn(str)
	t.cache[key] = newStr
	return true
}
143976
func (t *envelopeTransformer) TransformToStorage(data []byte, context value.Context) ([]byte, error) {
	newKey, err := generateKey(32)
	if err != nil {
		return nil, err
	}

	encKey, err := t.envelopeService.Encrypt(newKey)
	if err != nil {
		return nil, err
	}

	transformer, err := t.addTransformer(encKey, newKey)
	if err != nil {
		return nil, err
	}

	result, err := transformer.TransformToStorage(data, context)
	if err != nil {
		return nil, err
	}
	// Append the length of the encrypted DEK as the first 2 bytes.
	b := cryptobyte.NewBuilder(nil)
	b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) {
		b.AddBytes([]byte(encKey))
	})
	b.AddBytes(result)

	return b.Bytes()
}
1004827
func (f *Fpdf) TransformRotate(angle, x, y float64) {
	y = (f.h - y) * f.k
	x *= f.k
	angle = angle * math.Pi / 180
	var tm TransformMatrix
	tm.A = math.Cos(angle)
	tm.B = math.Sin(angle)
	tm.C = -tm.B
	tm.D = tm.A
	tm.E = x + tm.B*y - tm.A*x
	tm.F = y - tm.A*y - tm.B*x
	f.Transform(tm)
}
1059064
func (mat *T) SetTranslation(v *vec2.T) *T {
	mat[2][0] = v[0]
	mat[2][1] = v[1]
	return mat
}
8437
func (o *MigrateImageReferenceOptions) transform(obj runtime.Object) (migrate.Reporter, error) {
	fn := o.Mappings.MapReference
	switch t := obj.(type) {
	case *imagev1.Image:
		var changed bool
		if updated := fn(t.DockerImageReference); updated != t.DockerImageReference {
			changed = true
			t.DockerImageReference = updated
		}
		return migrate.ReporterBool(changed), nil
	case *imagev1.ImageStream:
		var info imageChangeInfo
		if len(t.Spec.DockerImageRepository) > 0 {
			info.spec = updateString(&t.Spec.DockerImageRepository, fn)
		}
		for _, ref := range t.Spec.Tags {
			if ref.From == nil || ref.From.Kind != "DockerImage" {
				continue
			}
			info.spec = updateString(&ref.From.Name, fn) || info.spec
		}
		for _, events := range t.Status.Tags {
			for i := range events.Items {
				info.status = updateString(&events.Items[i].DockerImageReference, fn) || info.status
			}
		}
		return info, nil
	case *corev1.Secret:
		switch t.Type {
		case corev1.SecretTypeDockercfg:
			var v credentialprovider.DockerConfig
			if err := json.Unmarshal(t.Data[corev1.DockerConfigKey], &v); err != nil {
				return nil, err
			}
			if !updateDockerConfig(v, o.Mappings.MapDockerAuthKey) {
				return migrate.ReporterBool(false), nil
			}
			data, err := json.Marshal(v)
			if err != nil {
				return nil, err
			}
			t.Data[corev1.DockerConfigKey] = data
			return migrate.ReporterBool(true), nil
		case corev1.SecretTypeDockerConfigJson:
			var v credentialprovider.DockerConfigJson
			if err := json.Unmarshal(t.Data[corev1.DockerConfigJsonKey], &v); err != nil {
				return nil, err
			}
			if !updateDockerConfig(v.Auths, o.Mappings.MapDockerAuthKey) {
				return migrate.ReporterBool(false), nil
			}
			data, err := json.Marshal(v)
			if err != nil {
				return nil, err
			}
			t.Data[corev1.DockerConfigJsonKey] = data
			return migrate.ReporterBool(true), nil
		default:
			return migrate.ReporterBool(false), nil
		}
	case *buildv1.BuildConfig:
		var changed bool
		if to := t.Spec.Output.To; to != nil && to.Kind == "DockerImage" {
			changed = updateString(&to.Name, fn) || changed
		}
		for i, image := range t.Spec.Source.Images {
			if image.From.Kind == "DockerImage" {
				changed = updateString(&t.Spec.Source.Images[i].From.Name, fn) || changed
			}
		}
		if c := t.Spec.Strategy.CustomStrategy; c != nil && c.From.Kind == "DockerImage" {
			changed = updateString(&c.From.Name, fn) || changed
		}
		if c := t.Spec.Strategy.DockerStrategy; c != nil && c.From != nil && c.From.Kind == "DockerImage" {
			changed = updateString(&c.From.Name, fn) || changed
		}
		if c := t.Spec.Strategy.SourceStrategy; c != nil && c.From.Kind == "DockerImage" {
			changed = updateString(&c.From.Name, fn) || changed
		}
		return migrate.ReporterBool(changed), nil
	default:
		if o.UpdatePodSpecFn != nil {
			var changed bool
			supports, err := o.UpdatePodSpecFn(obj, func(spec *corev1.PodSpec) error {
				changed = updatePodSpec(spec, fn)
				return nil
			})
			if !supports {
				return nil, nil
			}
			if err != nil {
				return nil, err
			}
			return migrate.ReporterBool(changed), nil
		}
	}
	// TODO: implement use of the generic PodTemplate accessor from the factory to handle
	// any object with a pod template
	return nil, nil
}
300523
func (c *ChiMergeFilter) Transform(a base.Attribute, n base.Attribute, field []byte) []byte {
	// Do we use this Attribute?
	if !c.attrs[a] {
		return field
	}
	// Find the Attribute value in the table
	table := c.tables[a]
	dis := 0
	val := base.UnpackBytesToFloat(field)
	for j, k := range table {
		if k.Value < val {
			dis = j
			continue
		}
		break
	}

	return base.PackU64ToBytes(uint64(dis))
}
938414
func (mat *T) AssignMat2x2(m *mat2.T) *T {
	*mat = T{
		vec4.T{m[0][0], m[1][0], 0, 0},
		vec4.T{m[0][1], m[1][1], 0, 0},
		vec4.T{0, 0, 1, 0},
		vec4.T{0, 0, 0, 1},
	}
	return mat
}
335337
func (mat *T) Translate(v *vec3.T) *T {
	mat[3][0] += v[0]
	mat[3][1] += v[1]
	mat[3][2] += v[2]
	return mat
}