Domains

GraviPet.Domains.DomainType
abstract type Domain{T}

A computational domain of type T. The domain of a function is the type of its argument(s). For example, Domain{Float64} would describe a one-dimensional domain, and Domain{SVector{3,Float64}} would describe a three-dimensional domain.

This type can also describe a codomain, i.e. the result type of a function. A codomain of Domain{Float64} describes a scalar function, and a codomain of Domain{SVector{3,Float64}} describes a vector-valued function.

See also Interval and Box for concrete domain types.

source
GraviPet.Domains.expandedMethod
expanded(dom::Domain, delta)::Domain
expanded(dom::Domain, delta_lo, delta_hi)::Domain

Expand the domain dom. The lower and upper domain bounds are moved by either delta, or delta_lo and delta_hi, respectively. Positive deltas enlarge the domain, negative values shrink it. Domains must be non-empty.

expanded(dom, delta) is equivalent to expanded(dom, delta, delta).

See also shifted.

source
GraviPet.Domains.shiftedMethod
shifted(dom::Domain, shift)::Domain

Shift the domain dom by moving both domain bounds in the same direction. This does not change the size of the domain.

shfited(dom, shift) is equivalent to expanded(dom, -shift, +shift).

See also expanded.

source

Intervals

GraviPet.Intervals.IntervalMethod
Interval{T}(first::Real, last::Real)
Interval(first::Real, last::Real)

Create an interval with the specified bounds. The bounds can be infinity. The constraint first < last must hold.

source
GraviPet.Intervals.IntervalMethod
Interval{T}()

Create a zero-valued interval, i.e. an interval where both lower and upper bounds are zero. This is also a convenient way to provide a "skeleton" for a domain without having to specify any bounds.

source

Boxes

GraviPet.Boxes.BoxType
struct Box{D,T} <: Domain{SVector{D,T}}

A multi-dimensional Domains.Domain, i.e. a box or hyper-rectangle. The number of dimensions D must be a non-negative integer. T should be a real-valued scalar type such as Float64. The domain's element type is SVector{D,T}.

Zero-dimensional and one-dimensional domains are supported. Zero-dimensional domains contain only a single point (the origin). One-dimensional domains correspond to intervals (see Interval).

source
GraviPet.Boxes.BoxMethod
Box{D,T}(first::SVector{D}, last::SVector{D})
Box(first::SVector{D}, last::SVector{D})

Create a box domain with the specified lower and upper bounds. The bounds are given as vectors, and (some of) their elements can be infinity. The constraint first < last must hold in each dimension.

source
GraviPet.Boxes.BoxMethod
Box{D,T}()

Create a zero-valued box domain, i.e. a box where both lower and upper bounds are zero. This is also a convenient way to provide a "skeleton" for a domain without having to specify any bounds.

source