// AddPolygon adds a Polygon to the calculation.
358626
func (calc *LineCentroidCalculator) AddPolygon(polygon *geom.Polygon) *LineCentroidCalculator {
	for i := 0; i < polygon.NumLinearRings(); i++ {
		calc.AddLinearRing(polygon.LinearRing(i))
	}

	return calc
}
1308558
func deriveClonePolygon(src *Polygon) *Polygon {
	if src == nil {
		return nil
	}
	dst := new(Polygon)
	deriveDeepCopy_7(dst, src)
	return dst
}
634718
func (e *G1) Add(a, b *G1) *G1 {
	if e.p == nil {
		e.p = newCurvePoint(nil)
	}
	e.p.Add(a.p, b.p, new(bnPool))
	return e
}
835420
func (t *Polygon) AddCoordinates(coordinates ...Coordinates) {
	t.Coordinates = append(t.Coordinates, coordinates...)
}
163677
func (x Pol) Add(y Pol) Pol {
	r := Pol(uint64(x) ^ uint64(y))
	return r
}
720189
func (p *Polygon) Add(point *Point) {
	p.points = append(p.points, point)
}
1019834
func (a *aggPushDownSolver) addGbyCol(gbyCols []*expression.Column, cols ...*expression.Column) []*expression.Column {
	for _, c := range cols {
		duplicate := false
		for _, gbyCol := range gbyCols {
			if c.Equal(gbyCol, a.ctx) {
				duplicate = true
				break
			}
		}
		if !duplicate {
			gbyCols = append(gbyCols, c)
		}
	}
	return gbyCols
}
732124
func (q *ConvexHullQuery) AddPolyline(p *Polyline) {
	q.bound = q.bound.Union(p.RectBound())
	q.points = append(q.points, (*p)...)
}
394333
func (e *E2eProcessingLatencyAggregate) Add(e2 *E2eProcessingLatencyAggregate) {
	e.Addr = "*"
	p := e.Percentiles
	e.Count += e2.Count
	for _, value := range e2.Percentiles {
		i := -1
		for j, v := range p {
			if value["quantile"] == v["quantile"] {
				i = j
				break
			}
		}
		if i == -1 {
			i = len(p)
			e.Percentiles = append(p, make(map[string]float64))
			p = e.Percentiles
			p[i]["quantile"] = value["quantile"]
		}
		p[i]["max"] = math.Max(value["max"], p[i]["max"])
		p[i]["min"] = math.Min(value["max"], p[i]["max"])
		p[i]["count"] += value["count"]
		if p[i]["count"] == 0 {
			p[i]["average"] = 0
			continue
		}
		delta := value["average"] - p[i]["average"]
		R := delta * value["count"] / p[i]["count"]
		p[i]["average"] = p[i]["average"] + R
	}
	sort.Sort(e)
}
1049515
func (t *GeometryCollection) AddGeometry(g interface{}) error {
	switch c := g.(type) {
	case []interface{}:
		t.AddGeometries(c...)
		break
	case interface{}:
		t.AddGeometries(c)
		break
	default:
		return errors.New(fmt.Sprintf("AssertionError %v", g))
	}
	return nil
}
1083253
func (t *MultiPolygon) AddCoordinates(lines ...MultiLine) {
	t.Coordinates = append(t.Coordinates, lines...)
}
344009
func (r *Result) Add(val int64) {
	r.Count++
	r.Sum += val
	// Sum of squares tends to roll over pretty easily
	r.SumOfSquares += float64(val) * float64(val)
}
96194
func (s *DouglasPeuckerSimplifier) MultiPolygon(mp orb.MultiPolygon) orb.MultiPolygon {
	return multiPolygon(s, mp)
}
897601
func PolygonFromGeom(shell *Geometry, holes ...*Geometry) (*Geometry, error) {
	var ptrHoles **C.GEOSGeometry
	// build c array of geom ptrs
	var holeCPtrs []*C.GEOSGeometry
	for i := range holes {
		holeCPtrs = append(holeCPtrs, holes[i].g)
		// The ownership of the holes becomes that of the new polygon
		runtime.SetFinalizer(holes[i], nil)
	}
	if len(holeCPtrs) > 0 {
		ptrHoles = &holeCPtrs[0]
	}
	// The ownership of the shell becomes that of the new polygon
	runtime.SetFinalizer(shell, nil)
	return geomFromC("NewPolygon", cGEOSGeom_createPolygon(shell.g, ptrHoles, C.uint(len(holeCPtrs))))
}
983873
func (g *Graph) Add(n interface{}) *Graph {

	if g == nil {
		return nil
	}

	if node, ok := n.(*Graph); ok && node != nil {
		g.Out = append(g.Out, node)
		return node
	}

	gg := Graph{n, nil}
	g.Out = append(g.Out, &gg)
	return &gg
}
35280
func (t *Polygon) AddGeometry(g interface{}) error {
	switch c := g.(type) {
	case MultiLine:
		t.AddCoordinates(c...)
		break
	case Coordinates:
		t.AddCoordinates(c)
		break
	default:
		return errors.New(fmt.Sprintf("AssertionError %v", g))
	}
	return nil
}
54367
func addToMultiPolygon(mp orb.MultiPolygon, ring orb.Ring) orb.MultiPolygon {
	for i := range mp {
		if polygonContains(mp[i][0], ring) {
			mp[i] = append(mp[i], ring)
			return mp
		}
	}

	// ring is not in any polygons?
	// skip it, TODO: is this correct?
	// If input is well formed, I think it is. If it isn't, ¯\_(ツ)_/¯

	return mp
}