// ScaleXYs aggregates the XY values together in a dense form.
// Empty slots between two Xs are left nil to represent
// the absence of data. The values are scaled using s.
327006
func (p *BarChart) ScaleXYs(xWidth int, s ScaleFunc) []XYf {

	diff := p.MaxX - p.MinX
	scaleX := float64(diff) / float64(xWidth-1)

	buckets := make([]XYf, xWidth)
	for i := range buckets {
		buckets[i] = XYf{
			X:       float64(i)*scaleX + float64(p.MinX),
			Y:       nil,
			ScaledY: nil,
		}
	}

	miny, maxy := float64(p.xy[0].Y), float64(p.xy[0].Y)

	for _, val := range p.xy {
		minx := float64(p.MinX)
		xdiff := float64(val.X) - minx
		bi := int(xdiff / scaleX)

		slot := buckets[bi]
		if slot.Y == nil {
			slot.Y = new(float64)
			slot.ScaledY = new(float64)
		}
		y := float64(val.Y)
		*slot.Y += y
		miny = math.Min(*slot.Y, miny)
		maxy = math.Max(*slot.Y, maxy)
		buckets[bi] = slot
	}

	for _, val := range buckets {
		if val.Y == nil {
			continue
		}
		*val.ScaledY = s(miny, maxy, *val.Y)
	}

	return buckets
}
965523
func (f *Fpdf) TransformScale(scaleWd, scaleHt, x, y float64) {
	if scaleWd == 0 || scaleHt == 0 {
		f.err = fmt.Errorf("scale factor cannot be zero")
		return
	}
	y = (f.h - y) * f.k
	x *= f.k
	scaleWd /= 100
	scaleHt /= 100
	f.Transform(TransformMatrix{scaleWd, 0, 0,
		scaleHt, x * (1 - scaleWd), y * (1 - scaleHt)})
}
539227
func (m *Model) Coses(pairs [][2]Expr) ([]float32, error) {
	out := make([]float32, len(pairs))
	for i, p := range pairs {
		c, err := m.Cos(p[0], p[1])
		if err != nil {
			return nil, err
		}
		out[i] = c
	}
	return out, nil
}
1259731
func (mat *T) Scaled(f float64) T {
	r := *mat
	return *r.Scale(f)
}
1019427
func Scale(o, d time.Duration) float64 {
	return float64(o) / float64(d)
}
100513
func (m *matrix3x3) scale(f float64) *matrix3x3 {
	return &matrix3x3{
		[3]float64{f * m[0][0], f * m[0][1], f * m[0][2]},
		[3]float64{f * m[1][0], f * m[1][1], f * m[1][2]},
		[3]float64{f * m[2][0], f * m[2][1], f * m[2][2]},
	}
}
65156
func (mat *T) Scaling() vec4.T {
	return vec4.T{mat[0][0], mat[1][1], mat[2][2], mat[3][3]}
}
881359
func (vec *T) Scale(f float32) *T {
	vec[0] *= f
	vec[1] *= f
	vec[2] *= f
	return vec
}
246179
func (s *SizeType) ScaleBy(factor float64) SizeType {
	return SizeType{s.Wd * factor, s.Ht * factor}
}
626643
func (p *Point) MultiplyScalar(s float32) *Point {
	p.X *= s
	p.Y *= s
	return p
}
1194750
func (dc *Context) Scale(x, y float64) {
	dc.matrix = dc.matrix.Scale(x, y)
}
108950
func (p *BarChart) XYs() []*XY {
	xys := make([]*XY, p.MaxX-p.MinX)
	for _, xy := range p.xy {
		slot := xys[xy.X-p.MinX]
		if slot == nil {
			slot = &XY{xy.X, xy.Y}
		} else {
			slot.Y += xy.Y
		}
	}
	return xys
}
331770
func (mat *T) Scaling() vec3.T {
	return vec3.T{mat[0][0], mat[1][1], mat[2][2]}
}
1051262
func (tr *Matrix) Scale(sx, sy float64) {
	tr[0] = sx * tr[0]
	tr[1] = sx * tr[1]
	tr[2] = sy * tr[2]
	tr[3] = sy * tr[3]
}
771813
func (s *ListXssMatchSetsOutput) SetXssMatchSets(v []*XssMatchSetSummary) *ListXssMatchSetsOutput {
	s.XssMatchSets = v
	return s
}
790459
func (c Client) Coses(pairs [][2]Expr) ([]float32, error) {
	req := cosesQuery{
		A: make([]Expr, len(pairs)),
		B: make([]Expr, len(pairs)),
	}
	for i, pair := range pairs {
		req.A[i] = pair[0]
		req.B[i] = pair[1]
	}

	body, err := c.fetch(req, "coses")
	if err != nil {
		return nil, err
	}

	var data cosesResponse
	err = json.Unmarshal(body, &data)
	if err != nil {
		return nil, fmt.Errorf("error unmarshalling result: %v", err)
	}
	return data.Values, nil
}
1126480
func (m *MockExtensionsV1beta1Interface) Scales(arg0 string) v1beta10.ScaleInterface {
	ret := m.ctrl.Call(m, "Scales", arg0)
	ret0, _ := ret[0].(v1beta10.ScaleInterface)
	return ret0
}