# Public API Reference

This is an exhaustive list of all exported modules, constants, types, functions and macros in `DomainSets.jl`

.

## Constants

`DomainSets.AnyDomain`

— Type`AnyDomain`

is the union of `Domain`

and `DomainRef`

.

In both cases `domain(d::AnyDomain)`

returns the domain itself.

`DomainSets.ℂ`

— ConstantThe set of complex numbers.

`DomainSets.ℕ`

— ConstantThe set of natural numbers.

`DomainSets.ℚ`

— ConstantThe set of rational numbers.

`DomainSets.ℝ`

— ConstantThe set of real numbers.

`DomainSets.ℝ1`

— ConstantThe Euclidean space $ℝ^1$.

`DomainSets.ℝ2`

— ConstantThe Euclidean space $ℝ^2$.

`DomainSets.ℝ3`

— ConstantThe Euclidean space $ℝ^3$.

`DomainSets.ℝ4`

— ConstantThe Euclidean space $ℝ^4$.

`DomainSets.ℤ`

— ConstantThe set of integers.

## Functions

`DomainSets.approx_in`

— Method`approx_in(x, domain::Domain [, tolerance])`

Verify whether a point lies in the given domain with a certain tolerance.

The tolerance has to be positive. The meaning of the tolerance, in relation to the possible distance of the point to the domain, is domain-dependent. Usually, if the outcome is true, it means that the distance of the point to the domain is smaller than a constant times the tolerance. That constant may depend on the domain.

Up to inexact computations due to floating point numbers, it should also be the case that `approx_in(x, d, 0) == in(x,d)`

. This implies that `approx_in`

reflects whether a domain is open or closed.

`DomainSets.boundary`

— FunctionReturn the boundary of the given domain as a domain.

`DomainSets.boundingbox`

— MethodReturn a bounding box of the given domain.

A bounding box is an interval, a hyperrectangle or the full space. It is such that each point in the domain also lies in the bounding box.

`DomainSets.canonicaldomain`

— Method`canonicaldomain([ctype::CanonicalType, ]d)`

Return an associated canonical domain, if any, of the given domain.

For example, the canonical domain of an Interval `[a,b]`

is the interval `[-1,1]`

.

Optionally, a canonical type argument may specify an alternative canonical domain. Canonical domains help with establishing equality between domains, with finding maps between domains and with finding parameterizations.

If a domain implements a canonical domain, it should also implement `mapfrom_canonical`

and `mapto_canonical`

.

See also: `mapfrom_canonical`

, `mapto_canonical`

.

`DomainSets.checkdomain`

— Methodcheckdomain(d)

Checks that `d`

is a domain or refers to a domain and if so returns that domain, throws an error otherwise.

`DomainSets.choice`

— MethodReturn a point from the given domain.

`DomainSets.corners`

— MethodReturn all corners of the domain in a vector.

`DomainSets.cylinder`

— MethodCreate a cylinder with given radius and length.

`DomainSets.dimension`

— MethodWhat is the Euclidean dimension of the domain?

`DomainSets.distance_to`

— Function`distance_to(d, x)`

Return the distance from the point `x`

to the domain `d`

.

`DomainSets.domain`

— Method`domain(d)`

Return a domain associated with the object `d`

.

`DomainSets.domaineltype`

— Method`domaineltype(d)`

The `domaineltype`

of a continuous set is a valid type for elements of that set. By default it is equal to the `eltype`

of `d`

, which in turn defaults to `Any`

.

`DomainSets.ellipse`

— MethodCreate an ellipse curve with semi-axes lengths `a`

and `b`

respectively.

`DomainSets.ellipse_shape`

— MethodCreate an ellipse-shaped domain with semi-axes lengths `a`

and `b`

respectively.

`DomainSets.emptyspace`

— MethodReturn the empty space with the same element type as the given domain.

`DomainSets.equaldomain`

— Method`equaldomain(domain)`

Return a canonical domain that is equal, but simpler. For example, a 1-dimensional ball is an interval. This function is equivalent to `canonicaldomain(Equal(), d)`

.

A domain and its `equaldomain`

are always equal domains according to `isequaldomain`

.

See also: `canonicaldomain`

.

`DomainSets.fullspace`

— MethodReturn the full space with the same element type as the given domain.

`DomainSets.hascanonicaldomain`

— Method`hascanonicaldomain([ctype::CanonicalType, ]d)`

Does the domain have a canonical domain?

See also: `canonicaldomain`

.

`DomainSets.hasequaldomain`

— Method`hasequaldomain(d)`

Does the domain have a known equal domain?

`DomainSets.hasparameterization`

— Method`hasparameterization(d)`

Does the domain have a parameterization?

`DomainSets.intersectdomain`

— Method`intersectdomain(domains...)`

Return a domain which agrees with the mathematical intersection of the given domains.

See also: `IntersectDomain`

.

`DomainSets.isequaldomain`

— Method`isequaldomain(d1, d2)`

Are the two given domains equal?

Domains are considered equal if their membership functions return the same output for the same input.

It is not always possible to verify this automatically. If the result is `true`

, then the domains are guaranteed to be equal. If the result is `false`

, then either the domains are not equal or they are equal but the implementation fails to recognize this.

`DomainSets.map_domain`

— Method`map_domain(map, domain)`

Map a domain with the inverse of the given map.

`DomainSets.mapfrom_canonical`

— Method`mapfrom_canonical(d[, x])`

Return a map to a domain `d`

from its canonical domain.

If a second argument `x`

is given, the map is evaluated at that point. The point `x`

should be a point in the canonical domain of `d`

, and the result is a point in `d`

.

See also: `mapto_canonical`

, `canonicaldomain`

.

`DomainSets.mapfrom_parameterdomain`

— Method`mapfrom_parameterdomain(d[, x])`

Convenience alias for `mapfrom_canonical(Paramaterization(), d[, x])`

.

`DomainSets.mapped_domain`

— Method`mapped_domain(invmap, domain)`

Make a mapped domain with the given inverse map.

`DomainSets.mapto`

— Method`mapto(d1, d2)`

Return a map from domain `d1`

to domain `d2`

.

`DomainSets.mapto_canonical`

— Method`mapto_canonical(d[, x])`

Return a map from a domain `d`

to its canonical domain.

If a second argument `x`

is given, the map is evaluated at that point. The point `x`

should be a point in the domain `d`

, and the result is a point in the canonical domain.

See also: `mapfrom_canonical`

, `canonicaldomain`

.

`DomainSets.mapto_parameterdomain`

— Method`mapto_parameterdomain(d[, x])`

Convenience alias for `mapto_canonical(Paramaterization(), d[, x])`

.

See also: `mapfrom_parameterdomain`

.

`DomainSets.normal`

— FunctionReturn the normal of the domain at the point `x`

.

It is assumed that `x`

is a point on the boundary of the domain.

`DomainSets.parameterdomain`

— Method`parameterdomain(d)`

A domain from which `d`

can be parameterized.

`DomainSets.parameterization`

— Method`parameterization(d)`

A map from the parameter domain of `d`

to `d`

.

`DomainSets.setdiffdomain`

— Method`setdiffdomain(d1, d2)`

Return a domain which agrees with the mathematical difference of the given domains.

See also: `SetdiffDomain`

.

`DomainSets.tangents`

— FunctionReturn the tangents of the domain at the point `x`

. The tangents form a basis for the tangent plane, perpendicular to the normal direction at `x`

.

`DomainSets.typedomain`

— MethodReturn the domain for the element type of the given domain.

`DomainSets.uniondomain`

— Method`uniondomain(domains...)`

Return a domain that agrees with the mathematical union of the arguments.

See also: `UnionDomain`

.

`DomainSets.volume`

— FunctionReturn the volume of the domain.

## Types

`DomainSets.Ball`

— Type`Ball{T,C} <: Domain{T}`

Abstract supertype for volumes of elements satisfying `norm(x-center(ball)) < radius(ball)`

(open ball) or `norm(x-center(ball)) <= radius(ball)`

(closed ball).

`DomainSets.Ball`

— Method```
Ball(radius = 1[, center])
Ball{T,C=:closed}(radius = 1[, center])
```

Return a concrete subtype of `Ball`

which represents a ball with the given radius and center, the given eltype `T`

, and which is open or closed.

The default center is the origin. In case both radius and center are omitted, a subtype of `UnitBall`

is returned, whose concrete type depends on `T`

.

A ball represents a volume. For the boundary of a ball, see `Sphere()`

.

`DomainSets.ChebyshevInterval`

— Type```
ChebyshevInterval()
ChebyshevInterval{T=Float64}()
```

The closed interval `[-1,1]`

.

`DomainSets.ComplexNumbers`

— TypeThe set of all complex numbers whose real and imaginary parts are real numbers.

`DomainSets.ComplexUnitCircle`

— Type```
ComplexUnitCircle()
ComplexUnitCircle{T}()
```

The unit circle in the complex plane.

See also: `ComplexUnitDisk`

.

`DomainSets.ComplexUnitDisk`

— Type```
ComplexUnitDisk()
ComplexUnitDisk{T}()
ComplexUnitDisk{T,C}()
```

The unit disk in the complex plane. The disk is open when `C=:open`

and closed when `C=:closed`

.

See also: `ComplexUnitCircle`

.

`DomainSets.DomainRef`

— Type`DomainRef(d)`

A reference to a domain.

In a function call, `DomainRef(x)`

can be used to indicate that `x`

should be treated as a domain, e.g., `foo(x, DomainRef(d))`

.

`DomainSets.DomainStyle`

— Type`DomainStyle(d)`

Trait to indicate whether or not `d`

implements the domain interface.

`DomainSets.DynamicUnitBall`

— Type```
DynamicUnitBall(dim::Int)
DynamicUnitBall{T}(dim::Int)
DynamicUnitBall{T,C=:closed}(dim::Int)
```

The open or closed unit ball with variable dimension. Typically the element type is a `Vector{T}`

and `dim`

specifies the length of the vectors.

`DomainSets.DynamicUnitCube`

— TypeA unit cube whose dimension is specified by a field.

`DomainSets.DynamicUnitSimplex`

— TypeA unit simplex with vector elements with variable dimension determined by a field.

`DomainSets.DynamicUnitSphere`

— TypeThe unit sphere with variable dimension.

`DomainSets.EmptySpace`

— TypeThe empty space.

`DomainSets.EuclideanDomain`

— TypeA `EuclideanDomain`

is any domain whose eltype is `<:StaticVector{N,T}`

.

`DomainSets.EuclideanUnitBall`

— TypeThe unit ball in a fixed N-dimensional space.

`DomainSets.EuclideanUnitCube`

— TypeThe unit cube in a fixed N-dimensional space.

`DomainSets.EuclideanUnitSphere`

— TypeThe unit sphere in a fixed N-dimensional Euclidean space.

`DomainSets.FullSpace`

— TypeA domain that represents the full space.

The element type `T`

in `FullSpace{T}`

should only be seen as an indication of the expected types of the elements in the context where the domain is intended to be used. Due to the default, loose interpretation of `T`

, any `FullSpace{T}`

actually contains any `x`

regardless of the type of `x`

. For a strict domain of all elements of type `T`

, or elements convertible exactly to `T`

, use `TypeDomain{T}`

.

`DomainSets.HalfLine`

— Type```
HalfLine()
HalfLine{T=Float64,C=:closed}()
```

The positive halfline `[0,∞)`

when `C`

is `:closed`

or `(0,∞)`

when `C`

is `:open`

. The interval is always open at infinity.

See also: `NonnegativeRealLine`

, `PositiveRealLine`

.

`DomainSets.IndicatorFunction`

— TypeAn `IndicatorFunction`

is a domain that implements `f(x) = x ∈ D`

by storing `f`

.

`DomainSets.Integers`

— TypeThe set of all integers.

`DomainSets.IntersectDomain`

— Type```
IntersectDomain(domains...)
IntersectDomain{T}(domains...)
```

The lazy intersection of an iterable list of domains.

See also: `intersectdomain`

.

`DomainSets.IsDomain`

— Type`IsDomain()`

indicates an object implements the domain interface.

`DomainSets.LevelSet`

— TypeThe domain defined by `f(x)=C`

for a given function `f`

and constant `C`

.

`DomainSets.MappedDomain`

— TypeA `MappedDomain`

stores the inverse map of a mapped domain.

`DomainSets.NegativeHalfLine`

— Type```
NegativeHalfLine()
NegativeHalfLine{T=Float64,C=:closed}()
```

The negative halfline `(-∞,0]`

when `C`

is `:closed`

or `(-∞,0)`

when `C`

is `:open`

. The interval is always open at minus infinity.

See also: `NonpositiveRealLine`

, `NegativeRealLine`

.

`DomainSets.NotDomain`

— Type`NotDomain()`

indicates an object does not implement the domain interface.

`DomainSets.Point`

— Type`Point(x)`

represents a single point at `x`

.

`DomainSets.ProductDomain`

— Type`abstract type ProductDomain{T}`

Represents the cartesian product of other domains.

`DomainSets.ProductDomain`

— Method```
ProductDomain(domains...)
ProductDomain{T}(domains...)
```

Return a concrete subtype of `ProductDomain`

which agrees mathematically with the cartesian product of the given domains.

The concrete subtype being returned depends on `T`

. If `T`

is provided, it will be the eltype of the product domain. If `T`

is not provided, a suitable choice is deduced from the arguments.

See also: `VcatDomain`

, `VectorProductDomain`

, `TupleProductDomain`

, `Rectangle(a,b)`

.

`DomainSets.Rationals`

— TypeThe set of all rationals.

`DomainSets.RealLine`

— TypeThe real line `(-∞,∞)`

.

`DomainSets.RealNumbers`

— TypeThe set of all real numbers.

`DomainSets.Rectangle`

— Type```
Rectangle(a, b)
Rectangle(domains::ClosedInterval...)
Rectangle{T}(domains::ClosedInterval...)
```

A rectangular domain in `n`

dimensions with extrema determined by the vectors or points `a`

and `b`

or by the endpoints of the given intervals.

`DomainSets.SetdiffDomain`

— Type```
SetdiffDomain(d1, d2)
SetdiffDomain{T}(d1, d2)
```

The lazy set difference of the given domains.

See also: `setdiffdomain`

.

`DomainSets.Sphere`

— TypeSupertype of spherical domains for which elements satisfy `norm(x) == radius(sphere)`

.

`DomainSets.Sphere`

— Method```
Sphere(radius = 1[, center])
Sphere{T}(radius = 1[, center])
```

Return a concrete subtype of `Sphere`

which represents a sphere with the given radius and center, and the given eltype `T`

.

The default center is the origin. In case both radius and center are omitted, a subtype of `UnitSphere`

is returned, whose concrete type depends on `T`

.

A sphere represents the boundary of a ball. For the volume, see `Ball()`

.

`DomainSets.StaticUnitBall`

— Type```
StaticUnitBall()
StaticUnitBall{T}()
StaticUnitBall{T,C=:closed}()
```

The open or closed unit ball with static dimension determined by the element type.

`DomainSets.StaticUnitCube`

— TypeA unit cube that is specified by the element type `T`

.

`DomainSets.StaticUnitSimplex`

— TypeA unit simplex whose dimension is determined by its element type.

`DomainSets.StaticUnitSphere`

— TypeThe unit sphere with fixed dimension(s) specified by the element type.

`DomainSets.SublevelSet`

— TypeThe domain defined by `f(x) <= C`

(or `f(x) < C`

) for a given function `f`

and constant `C`

.

`DomainSets.SubzeroSet`

— TypeThe domain where `f(x) <= 0`

(or `f(x) < 0`

).

`DomainSets.SuperlevelSet`

— TypeThe domain defined by `f(x) >= C`

(or `f(x) > C`

) for a given function `f`

and constant `C`

.

`DomainSets.SuperzeroSet`

— TypeThe domain where `f(x) >= 0`

(or `f(x) > 0`

).

`DomainSets.TupleProductDomain`

— TypeA `TupleProductDomain`

is a product domain that concatenates the elements of its member domains in a tuple.

`DomainSets.TypeDomain`

— TypeThe domain of all objects of type `T`

and all objects convertible exactly to type `T`

.

`DomainSets.UnionDomain`

— Type```
UnionDomain(domains...)
UnionDomain{T}(domains...)
```

The lazy union of the given domains.

See also: `uniondomain`

.

`DomainSets.UnitBall`

— Method```
UnitBall([dim::Int])
UnitBall{T}([dim::Int])
UnitBall{T,C=:closed}([dim::Int])
```

The open or closed volume of all points of type `T`

with norm smaller than (or equal to) 1.

`DomainSets.UnitCircle`

— Type```
UnitCircle()
UnitCircle{T=Float64}()
```

The unit circle in 2D, with element type `SVector{2,T}`

.

`DomainSets.UnitCube`

— Type```
UnitCube()
UnitCube(::Val{N=3})
UnitCube(dim::Int)
```

The `d`

-dimensional domain $[0,1]^d$.

`DomainSets.UnitDisk`

— Type```
UnitDisk()
UnitDisk{T=Float64}()
```

The closed unit disk in 2D, with element type `SVector{2,T}`

.

`DomainSets.UnitInterval`

— Type```
UnitInterval()
UnitInterval{T=Float64}()
```

The closed unit interval `[0,1]`

.

`DomainSets.UnitSimplex`

— Type`UnitSimplex{T,C}`

A polytope with the origin and all unit vectors as vertices.

`DomainSets.UnitSimplex`

— Method```
UnitSimplex([dim::Int])
UnitSimplex{T}([dim::Int])
UnitSimplex{T,C=:closed}([dim::Int])
```

The open or closed volume of all points of type `x`

, for which the sum of components is smaller than (or equal to) 1.

The unit simplex has the origin and all Euclidean unit vector as vertices.

`DomainSets.UnitSphere`

— TypeThe unit sphere.

`DomainSets.UnitSphere`

— Method```
UnitSphere([dim::Int])
UnitSphere{T}([dim::Int])
UnitSphere{T,C=:closed}([dim::Int])
```

The set of all points of type `T`

with norm 1.

`DomainSets.UnitSquare`

— Type```
UnitSquare()
UnitSquare{T=Float64}()
```

The domain $[0,1]^2$.

`DomainSets.VcatDomain`

— TypeA `VcatDomain`

concatenates the element types of its member domains in a single static vector.

`DomainSets.VectorDomain`

— TypeA `VectorDomain`

is any domain whose eltype is `Vector{T}`

.

`DomainSets.VectorProductDomain`

— TypeA `VectorProductDomain`

is a product domain of arbitrary dimension where the element type is a vector, and all member domains have the same element type.

`DomainSets.VectorUnitBall`

— TypeThe unit ball with vector elements of a given dimension.

`DomainSets.VectorUnitCube`

— TypeThe unit cube with vector elements of a given dimension.

`DomainSets.VectorUnitSphere`

— TypeThe unit sphere with vector elements of a given dimension.

`DomainSets.ZeroSet`

— TypeThe domain defined by `f(x)=0`

for a given function `f`

.