# Partition

`Meshes.partition`

— Function`partition(object, method)`

Partition `object`

with partition `method`

.

`Meshes.PartitionMethod`

— Type`PartitionMethod`

A method for partitioning domain/data objects.

`Meshes.RandomPartition`

— Type`RandomPartition(k, [shuffle])`

A method for partitioning spatial objects uniformly into `k`

subsets of approximately equal size. Optionally `shuffle`

the data (default to `true`

).

`Meshes.FractionPartition`

— Type`FractionPartition(fraction, shuffle=true)`

A method for partitioning spatial objects according to a given `fraction`

. Optionally `shuffle`

elements before partitioning.

`Meshes.BlockPartition`

— Type```
BlockPartition(sides; neighbors=false)
BlockPartition(side₁, side₂, ...; neighbors=false)
```

A method for partitioning spatial objects into blocks of given `sides`

. Optionally, compute the `neighbors`

of a block as the metadata.

`Meshes.BisectPointPartition`

— Type`BisectPointPartition(normal, point)`

A method for partitioning spatial objects into two half spaces defined by a `normal`

direction and a reference `point`

.

`Meshes.BisectFractionPartition`

— Type`BisectFractionPartition(normal, fraction=0.5, maxiter=10)`

A method for partitioning spatial objects into two half spaces defined by a `normal`

direction and a `fraction`

of points. The partition is returned within `maxiter`

bisection iterations.

`Meshes.BallPartition`

— Type`BallPartition(radius; metric=Euclidean())`

A method for partitioning spatial objects into balls of a given `radius`

using a `metric`

.

`Meshes.PlanePartition`

— Type`PlanePartition(normal; tol=1e-6)`

A method for partitioning spatial objects into a family of hyperplanes defined by a `normal`

direction. Two points `x`

and `y`

belong to the same hyperplane when `(x - y) ⋅ normal < tol`

.

`Meshes.DirectionPartition`

— Type`DirectionPartition(direction; tol=1e-6)`

A method for partitioning spatial objects along a given `direction`

with bandwidth tolerance `tol`

.

`Meshes.PredicatePartition`

— Type`PredicatePartition(predicate)`

A method for partitioning spatial objects with a given `predicate`

function. Two locations `i`

and `j`

are part of the same subset whenever `predicate(i, j) == true`

`Meshes.SpatialPredicatePartition`

— Type`SpatialPredicatePartition(predicate)`

A method for partitioning spatial objects with a given spatial `predicate`

function. Two coordinates `x`

and `y`

are part of the same subset whenever `predicate(x, y) == true`

.

`Meshes.ProductPartition`

— Type`ProductPartition(p₁, p₂)`

A method for partitioning spatial objects using the product of two partitioning methods `p₁`

and `p₂`

.

`Meshes.HierarchicalPartition`

— Type`HierarchicalPartition(first, second)`

A partitioning method in which a `first`

partition is applied and then a `second`

partition is applied to each subset of the `first`

.