Invokes the 9 relational predicates of area vs area.
191633
private boolean areaAreaPredicates_(int half_edge, int id_a, int id_b) {
		boolean bRelationKnown = true;

		if (m_perform_predicates[MatrixPredicate.InteriorInterior]) {
			interiorAreaInteriorArea_(half_edge, id_a, id_b);
			bRelationKnown &= isPredicateKnown_(
					MatrixPredicate.InteriorInterior);
		}

		if (m_perform_predicates[MatrixPredicate.InteriorBoundary]) {
			interiorAreaBoundaryArea_(half_edge, id_a,
					MatrixPredicate.InteriorBoundary);
			bRelationKnown &= isPredicateKnown_(
					MatrixPredicate.InteriorBoundary);
		}

		if (m_perform_predicates[MatrixPredicate.InteriorExterior]) {
			interiorAreaExteriorArea_(half_edge, id_a, id_b,
					MatrixPredicate.InteriorExterior);
			bRelationKnown &= isPredicateKnown_(
					MatrixPredicate.InteriorExterior);
		}

		if (m_perform_predicates[MatrixPredicate.BoundaryInterior]) {
			interiorAreaBoundaryArea_(half_edge, id_b,
					MatrixPredicate.BoundaryInterior);
			bRelationKnown &= isPredicateKnown_(
					MatrixPredicate.BoundaryInterior);
		}

		if (m_perform_predicates[MatrixPredicate.BoundaryBoundary]) {
			boundaryAreaBoundaryArea_(half_edge, id_a, id_b);
			bRelationKnown &= isPredicateKnown_(
					MatrixPredicate.BoundaryBoundary);
		}

		if (m_perform_predicates[MatrixPredicate.BoundaryExterior]) {
			boundaryAreaExteriorArea_(half_edge, id_a, id_b,
					MatrixPredicate.BoundaryExterior);
			bRelationKnown &= isPredicateKnown_(
					MatrixPredicate.BoundaryExterior);
		}

		if (m_perform_predicates[MatrixPredicate.ExteriorInterior]) {
			interiorAreaExteriorArea_(half_edge, id_b, id_a,
					MatrixPredicate.ExteriorInterior);
			bRelationKnown &= isPredicateKnown_(
					MatrixPredicate.ExteriorInterior);
		}

		if (m_perform_predicates[MatrixPredicate.ExteriorBoundary]) {
			boundaryAreaExteriorArea_(half_edge, id_b, id_a,
					MatrixPredicate.ExteriorBoundary);
			bRelationKnown &= isPredicateKnown_(
					MatrixPredicate.ExteriorBoundary);
		}

		return bRelationKnown;
	}
687046
public static <S> PAreaSizeI<S> toPAreaSizeI(final AreaSizeI a)
  {
    Objects.requireNonNull(a, "area size");
    return PAreaSizeI.of(a.sizeX(), a.sizeY());
  }
920545
def areas(self):
        
        v1 = self.points[self.simplices[:,1]] - self.points[self.simplices[:,0]]
        v2 = self.points[self.simplices[:,2]] - self.points[self.simplices[:,1]]

        area = 0.5*(v1[:,0]*v2[:,1] - v1[:,1]*v2[:,0])
        return area
364837
public static <S> PAreaSizeL<S> toPAreaSizeL(final AreaSizeL a)
  {
    Objects.requireNonNull(a, "area size");
    return PAreaSizeL.of(a.sizeX(), a.sizeY());
  }
1054675
function(coords) {
        var i, j, area = 0;
        for (i = 0; i < coords.length; i++) {
            j = (i + 1) % coords.length;
            area += coords[i][0] * coords[j][1];
            area -= coords[j][0] * coords[i][1];
        }
        return (area < 0);
    }
1340591
private void interiorAreaBoundaryArea_(int half_edge, int id_a,
			int predicate) {
		if (m_matrix[predicate] == 1)
			return;

		int faceParentage = m_topo_graph.getHalfEdgeFaceParentage(half_edge);
		int twinFaceParentage = m_topo_graph
				.getHalfEdgeFaceParentage(m_topo_graph
						.getHalfEdgeTwin(half_edge));

		if ((faceParentage & id_a) != 0 && (twinFaceParentage & id_a) != 0)
			m_matrix[predicate] = 1;
	}
68130
public static <S> PAreaSizeBD<S> toPAreaSizeBD(final AreaSizeBD a)
  {
    Objects.requireNonNull(a, "area size");
    return PAreaSizeBD.of(a.sizeX(), a.sizeY());
  }
109728
def build_relation_predicate(relations: Strings) -> EdgePredicate:
    """"""
    if isinstance(relations, str):
        @edge_predicate
        def relation_predicate(edge_data: EdgeData) -> bool:
            """Pass for relations matching the enclosed value."""
            return edge_data[RELATION] == relations

    elif isinstance(relations, Iterable):
        relation_set = set(relations)

        @edge_predicate
        def relation_predicate(edge_data: EdgeData) -> bool:
            """Pass for relations matching the enclosed values."""
            return edge_data[RELATION] in relation_set

    else:
        raise TypeError

    return relation_predicate
599881
private static int getPredefinedRelation_(String scl, int dim_a, int dim_b) {
		if (equals_(scl))
			return RelationalOperations.Relation.equals;

		if (disjoint_(scl))
			return RelationalOperations.Relation.disjoint;

		if (touches_(scl, dim_a, dim_b))
			return RelationalOperations.Relation.touches;

		if (crosses_(scl, dim_a, dim_b))
			return RelationalOperations.Relation.crosses;

		if (contains_(scl))
			return RelationalOperations.Relation.contains;

		if (overlaps_(scl, dim_a, dim_b))
			return RelationalOperations.Relation.overlaps;

		return RelationalOperations.Relation.unknown;
	}
1361295
public final void addAreas(@NonNull final Map<ViewType, View> areas) {
        this.areas = new TreeMap<>(new AreaComparator());
        this.dividers = new HashMap<>();

        for (Map.Entry<ViewType, View> entry : areas.entrySet()) {
            ViewType viewType = entry.getKey();
            View view = entry.getValue();

            if (viewType instanceof AreaViewType) {
                this.areas.put(((AreaViewType) viewType).getArea(), view);
            } else if (viewType instanceof DividerViewType && view instanceof Divider) {
                this.dividers.put(((DividerViewType) viewType).getLocation(), (Divider) view);
            }
        }

        addAreas();
        addDividers();
        registerScrollLayoutListener();
    }
343681
private void boundaryAreaBoundaryLine_(int half_edge, int id_a, int id_b,
			int cluster_index_b) {
		if (m_matrix[MatrixPredicate.BoundaryBoundary] == 0)
			return;

		if (m_topo_graph.getHalfEdgeUserIndex(m_topo_graph
				.getHalfEdgePrev(m_topo_graph.getHalfEdgeTwin(half_edge)),
				m_visited_index) != 1) {
			int cluster = m_topo_graph.getHalfEdgeTo(half_edge);
			int clusterParentage = m_topo_graph.getClusterParentage(cluster);

			if ((clusterParentage & id_a) != 0) {
				int index = m_topo_graph.getClusterUserIndex(cluster,
						cluster_index_b);

				if ((clusterParentage & id_b) != 0 && (index % 2 != 0)) {
					assert (index != -1);
					m_matrix[MatrixPredicate.BoundaryBoundary] = 0;
				}
			}
		}
	}
117664
def iter_by_area(self):
        
        datasets_by_area = {}
        for ds in self:
            a = ds.attrs.get('area')
            datasets_by_area.setdefault(a, []).append(
                DatasetID.from_dict(ds.attrs))

        return datasets_by_area.items()
543951
function () {
		
		// Define or reset areaPath
		this.areaPath = [];
		
		// Call the base method
		Series.prototype.drawGraph.apply(this);
		
		// Define local variables
		var series = this,
			areaPath = this.areaPath,
			options = this.options,
			negativeColor = options.negativeColor,
			negativeFillColor = options.negativeFillColor,
			props = [['area', this.color, options.fillColor]]; // area name, main color, fill color
		
		if (negativeColor || negativeFillColor) {
			props.push(['areaNeg', negativeColor, negativeFillColor]);
		}
		
		each(props, function (prop) {
			var areaKey = prop[0],
				area = series[areaKey];
				
			// Create or update the area
			if (area) { // update
				area.animate({ d: areaPath });
	
			} else { // create
				series[areaKey] = series.chart.renderer.path(areaPath)
					.attr({
						fill: pick(
							prop[2],
							Color(prop[1]).setOpacity(pick(options.fillOpacity, 0.75)).get()
						),
						zIndex: 0 // #1069
					}).add(series.group);
			}
		});
	}
384610
private Collection<ConfigAttribute> wrap(final AccessPredicate predicate) {
        requireNonNull(predicate, "predicate");
        if (predicate == AccessPredicates.PERMIT_ALL) {
            return of(); // Empty collection => public invocation
        }
        return of(new AccessPredicateConfigAttribute(predicate));
    }
1275767
function venn(areas, parameters) {
        parameters = parameters || {};
        parameters.maxIterations = parameters.maxIterations || 500;
        var initialLayout = parameters.initialLayout || bestInitialLayout;
        var loss = parameters.lossFunction || lossFunction;

        // add in missing pairwise areas as having 0 size
        areas = addMissingAreas(areas);

        // initial layout is done greedily
        var circles = initialLayout(areas, parameters);

        // transform x/y coordinates to a vector to optimize
        var initial = [],
            setids = [],
            setid;
        for (setid in circles) {
            if (circles.hasOwnProperty(setid)) {
                initial.push(circles[setid].x);
                initial.push(circles[setid].y);
                setids.push(setid);
            }
        }

        // optimize initial layout from our loss function
        var solution = nelderMead(function (values) {
            var current = {};
            for (var i = 0; i < setids.length; ++i) {
                var setid = setids[i];
                current[setid] = { x: values[2 * i],
                    y: values[2 * i + 1],
                    radius: circles[setid].radius
                    // size : circles[setid].size
                };
            }
            return loss(current, areas);
        }, initial, parameters);

        // transform solution vector back to x/y points
        var positions = solution.x;
        for (var i = 0; i < setids.length; ++i) {
            setid = setids[i];
            circles[setid].x = positions[2 * i];
            circles[setid].y = positions[2 * i + 1];
        }

        return circles;
    }
1087627
private boolean areaLinePredicates_(int half_edge, int id_a, int id_b) {
        boolean bRelationKnown = true;

        if (m_perform_predicates[MatrixPredicate.InteriorInterior])
        {
            interiorAreaInteriorLine_(half_edge, id_a, id_b);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.InteriorInterior);
        }

        if (m_perform_predicates[MatrixPredicate.InteriorBoundary])
        {
            interiorAreaBoundaryLine_(half_edge, id_a, id_b, m_cluster_index_b);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.InteriorBoundary);
        }

        if (m_perform_predicates[MatrixPredicate.InteriorExterior])
        {
            interiorAreaExteriorLine_(half_edge, id_a, id_b);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.InteriorExterior);
        }

        if (m_perform_predicates[MatrixPredicate.BoundaryInterior])
        {
            boundaryAreaInteriorLine_(half_edge, id_a, id_b, m_cluster_index_b);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.BoundaryInterior);
        }

        if (m_perform_predicates[MatrixPredicate.BoundaryBoundary])
        {
            boundaryAreaBoundaryLine_(half_edge, id_a, id_b, m_cluster_index_b);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.BoundaryBoundary);
        }

        if (m_perform_predicates[MatrixPredicate.BoundaryExterior])
        {
            boundaryAreaExteriorLine_(half_edge, id_a, id_b);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.BoundaryExterior);
        }

        if (m_perform_predicates[MatrixPredicate.ExteriorInterior])
        {
            exteriorAreaInteriorLine_(half_edge, id_a);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.ExteriorInterior);
        }

        if (m_perform_predicates[MatrixPredicate.ExteriorBoundary])
        {
            exteriorAreaBoundaryLine_(half_edge, id_a, id_b, m_cluster_index_b);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.ExteriorBoundary);
        }

        return bRelationKnown;
	}
1327554
static boolean polygonRelatePolygon_(Polygon polygon_a, Polygon polygon_b,
			double tolerance, String scl, ProgressTracker progress_tracker) {
		RelationalOperationsMatrix relOps = new RelationalOperationsMatrix();
		relOps.resetMatrix_();
		relOps.setPredicates_(scl);
		relOps.setAreaAreaPredicates_();

		Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D();
		polygon_a.queryEnvelope2D(env_a);
		polygon_b.queryEnvelope2D(env_b);

		boolean bRelationKnown = false;
		boolean b_disjoint = RelationalOperations.envelopeDisjointEnvelope_(
				env_a, env_b, tolerance, progress_tracker);

		if (b_disjoint) {
			relOps.areaAreaDisjointPredicates_(polygon_a, polygon_b);
			bRelationKnown = true;
		}

		if (!bRelationKnown) {
			// Quick rasterize test to see whether the the geometries are
			// disjoint, or if one is contained in the other.
			int relation = RelationalOperations
					.tryRasterizedContainsOrDisjoint_(polygon_a, polygon_b,
							tolerance, false);

			if (relation == RelationalOperations.Relation.disjoint) {
				relOps.areaAreaDisjointPredicates_(polygon_a, polygon_b);
				bRelationKnown = true;
			} else if (relation == RelationalOperations.Relation.contains) {
				relOps.areaAreaContainsPredicates_(polygon_b);
				bRelationKnown = true;
			} else if (relation == RelationalOperations.Relation.within) {
				relOps.areaAreaWithinPredicates_(polygon_a);
				bRelationKnown = true;
			}
		}

		if (!bRelationKnown) {
			EditShape edit_shape = new EditShape();
			int geom_a = edit_shape.addGeometry(polygon_a);
			int geom_b = edit_shape.addGeometry(polygon_b);
			relOps.setEditShapeCrackAndCluster_(edit_shape, tolerance,
					progress_tracker);
			relOps.computeMatrixTopoGraphHalfEdges_(geom_a, geom_b);
			relOps.m_topo_graph.removeShape();
		}

		boolean bRelation = relationCompare_(relOps.m_matrix, relOps.m_scl);
		return bRelation;
	}