// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
// with a given epsilon threshold, as if FloatEqualThreshold had been used.
552904
func (m1 Mat2) ApproxEqualThreshold(m2 Mat2, threshold float64) bool {
	for i := range m1 {
		if !FloatEqualThreshold(m1[i], m2[i], threshold) {
			return false
		}
	}
	return true
}
1210911
func Float64Equal(a, b float64) bool {
	return math.Abs(a-b) <= closeFactor || math.Abs(1-a/b) <= closeFactor
}
40960
func (v *Validator) GreaterOrEqual(field string, value float64) *ValidationResult {
	return v.inequality(field, value, greaterOrEqual, "greater than or equal to")
}
1363525
func (s *CloudWatchAlarmConfiguration) SetThreshold(v float64) *CloudWatchAlarmConfiguration {
	s.Threshold = &v
	return s
}
988676
func (s *Notification) SetThresholdType(v string) *Notification {
	s.ThresholdType = &v
	return s
}
760023
func (m1 Mat4x2) ApproxEqual(m2 Mat4x2) bool {
	for i := range m1 {
		if !FloatEqual(m1[i], m2[i]) {
			return false
		}
	}
	return true
}
1132578
func (t *precompilationTypeChecker) AcceptComparison(v tree.Comparison) {
	if v.Op == tree.LT {
		t.result = fmt.Errorf("no less than comparisons allowed - this is probably a programmer error: %s", tree.ExpressionString(v))
	} else if v.Op == tree.LTE {
		t.result = fmt.Errorf("no less than or equals comparisons allowed - this is probably a programmer error: %s", tree.ExpressionString(v))
	} else {
		res := either(
			checkPrecompilationRules(v.Left),
			checkPrecompilationRules(v.Right))
		if res != nil {
			t.result = res
		}
	}
}
133194
func (vn *VecN) ApproxEqualFunc(vn2 *VecN, comp func(float32, float32) bool) bool {
	if vn == nil || vn2 == nil || len(vn.vec) != len(vn2.vec) {
		return false
	}

	for i, el := range vn.vec {
		if !comp(el, vn2.vec[i]) {
			return false
		}
	}

	return true
}
172281
func AttributesToHighlightEqual(o1, o2 *AttributesToHighlightOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
168469
func (s *HealthCheckConfig) SetHealthThreshold(v int64) *HealthCheckConfig {
	s.HealthThreshold = &v
	return s
}
1320974
func (s *HealthCheckPolicy) SetHealthyThreshold(v int64) *HealthCheckPolicy {
	s.HealthyThreshold = &v
	return s
}
1182435
func (sli *serviceLogInfo) GreaterThanOrEqual(value string) bool {
	if sli.Version == "" {
		return false
	} else if value == "" {
		return true
	}

	a := version.Version(sli.Version)
	b := version.Version(value)
	return a.GreaterThanOrEqualTo(b)
}
984155
func (c Cap) ApproxEqual(other Cap) bool {
	const epsilon = 1e-14
	r2 := float64(c.radius)
	otherR2 := float64(other.radius)
	return c.center.ApproxEqual(other.center) &&
		math.Abs(r2-otherR2) <= epsilon ||
		c.IsEmpty() && otherR2 <= epsilon ||
		other.IsEmpty() && r2 <= epsilon ||
		c.IsFull() && otherR2 >= 2-epsilon ||
		other.IsFull() && r2 >= 2-epsilon
}
81272
func (q1 Quat) OrientationEqualThreshold(q2 Quat, epsilon float32) bool {
	return Abs(q1.Normalize().Dot(q2.Normalize())) > 1-epsilon
}
695172
func (v1 Vec3) ApproxEqual(v2 Vec3) bool {
	for i := range v1 {
		if !FloatEqual(v1[i], v2[i]) {
			return false
		}
	}
	return true
}
1153273
func (rlp *RateLimitPolicy) GetThreshold(key string, regID int64) int {
	regOverride, regOverrideExists := rlp.RegistrationOverrides[regID]
	keyOverride, keyOverrideExists := rlp.Overrides[key]

	if regOverrideExists && !keyOverrideExists {
		// If there is a regOverride and no keyOverride use the regOverride
		return regOverride
	} else if !regOverrideExists && keyOverrideExists {
		// If there is a keyOverride and no regOverride use the keyOverride
		return keyOverride
	} else if regOverrideExists && keyOverrideExists {
		// If there is both a regOverride and a keyOverride use whichever is larger.
		if regOverride > keyOverride {
			return regOverride
		} else {
			return keyOverride
		}
	}

	// Otherwise there was no regOverride and no keyOverride, use the base
	// Threshold
	return rlp.Threshold
}
828889
func (mat *MatMxN) ApproxEqual(m2 *MatMxN) bool {
	if mat == m2 {
		return true
	}
	if mat.m != m2.m || mat.n != m2.n {
		return false
	}

	for i, el := range mat.dat {
		if !FloatEqual(el, m2.dat[i]) {
			return false
		}
	}

	return true
}