// Scale generates an OptionsFunc which applies the input X and Y axis scaling
// factors to an input Waveform struct.
//
// This value indicates how a generated waveform image will be scaled, for both
// its X and Y axes.
519777
func Scale(x uint, y uint) OptionsFunc {
	return func(w *Waveform) error {
		return w.setScale(x, y)
	}
}
385623
func Rescale(input, fromMin, fromMax, toMin, toMax float64) float64 {
	return (input-fromMin)*(toMax-toMin)/(fromMax-fromMin) + toMin
}
500441
func normalizeFunc(edges []*lnrpc.ChannelEdge, scaleFactor float64) func(int64) float64 {
	var (
		min float64 = math.MaxInt64
		max float64
	)

	for _, edge := range edges {
		// In order to obtain saner values, we reduce the capacity of a
		// channel to its base 2 logarithm.
		z := math.Log2(float64(edge.Capacity))

		if z < min {
			min = z
		}
		if z > max {
			max = z
		}
	}

	return func(x int64) float64 {
		y := math.Log2(float64(x))

		// TODO(roasbeef): results in min being zero
		return (y - min) / (max - min) * scaleFactor
	}
}
636959
func (scaler *ReplicaSetScaler) Scale(namespace, name string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams) error {
	if preconditions == nil {
		preconditions = &ScalePrecondition{-1, ""}
	}
	if retry == nil {
		// Make it try only once, immediately
		retry = &RetryParams{Interval: time.Millisecond, Timeout: time.Millisecond}
	}
	cond := ScaleCondition(scaler, preconditions, namespace, name, newSize)
	if err := wait.Poll(retry.Interval, retry.Timeout, cond); err != nil {
		return err
	}
	if waitForReplicas != nil {
		rs, err := scaler.c.ReplicaSets(namespace).Get(name)
		if err != nil {
			return err
		}
		return wait.Poll(waitForReplicas.Interval, waitForReplicas.Timeout,
			client.ReplicaSetHasDesiredReplicas(scaler.c, rs))
	}
	return nil
}
1070532
func (u Vec) Scaled(c float64) Vec {
	return Vec{u.X * c, u.Y * c}
}
1134872
func (vec *T) Scaled(f float64) T {
	return T{vec[0] * f, vec[1] * f, vec[2] * f, vec[3]}
}
865399
func Resolution(resolution uint) OptionsFunc {
	return func(w *Waveform) error {
		return w.setResolution(resolution)
	}
}
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)})
}
1215901
func (m *Matrix) ScaleComponent() (x, y float32) {
	return m.Val[m00], m.Val[m11]
}
921397
func (p *Profile) Scale(ratio float64) {
	if ratio == 1 {
		return
	}
	ratios := make([]float64, len(p.SampleType))
	for i := range p.SampleType {
		ratios[i] = ratio
	}
	p.ScaleN(ratios)
}
991352
func makeScale(x1, x2 float64, y1, y2 int) scale.QQ {
	return scale.QQ{
		Src:  &scale.Linear{Min: x1, Max: x2, Clamp: true},
		Dest: &scale.Linear{Min: float64(y1), Max: float64(y2) - 1e-10},
	}
}
874079
func (matrix *Matrix) Scale(sx, sy float64) {
	C.cairo_matrix_scale((*C.cairo_matrix_t)(unsafe.Pointer(matrix)), C.double(sx), C.double(sy))
}
200102
func (p *Project) Scale(service string, count int) error {
	return p.composeProject.Scale(context.Background(), 10, map[string]int{
		service: count,
	})
}
729558
func Scale(a []float32, s float32) {
	for i, v := range a {
		a[i] = v * s
	}
}
1341207
func (self *Service) Scale() error {

	url := "service/" + self.Uuid + "/scale/"
	request := "POST"
	//Empty Body Request
	body := []byte(`{}`)
	var response Service

	data, err := TutumCall(url, request, body)
	if err != nil {
		return err
	}

	err = json.Unmarshal(data, &response)
	if err != nil {
		return err
	}

	return nil
}
709776
func (renderer *Renderer) GetScale() (scaleX, scaleY float32) {
	C.SDL_RenderGetScale(
		renderer.cptr(),
		(*C.float)(unsafe.Pointer(&scaleX)),
		(*C.float)(unsafe.Pointer(&scaleY)))
	return
}
787821
func (mat *T) Scaled(f float32) T {
	result := *mat
	result.Scale(f)
	return result
}