FunctionMaps.jl

What is FunctionMaps.jl

FunctionMaps is a submodule of DomainSets as of version 0.7.10. The module collects all functionality in the package that relates to functions in the sense of a map between spaces. It defines properties such as the jacobian etcetera.

The module is expected to be moved into a separate package in the future and will be independently documented.

Public API Reference

Constants

Functions

FunctionMaps.canonicalmapMethod
canonicalmap([ctype::CanonicalType, ]map)

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

Optionally, a canonical type argument may specify an alternative canonical map. Canonical maps help with converting between equal maps of different types.

source
FunctionMaps.codomaintypeMethod
codomaintype(m[, T])

What is the type of a point in the codomain of the function map m?

The second argument optionally specifies a domain type T.

source
FunctionMaps.diffvolumeMethod
diffvolume(m[, x])

Compute the differential volume (at a point x). If J is the Jacobian matrix, possibly rectangular, then the differential volume is sqrt(det(J'*J)).

If the map is square, then the differential volume is the absolute value of the Jacobian determinant.

source
FunctionMaps.inverseMethod
inverse(m[, x])

Return the inverse of m. The two-argument function evaluates the inverse at the point x.

source
FunctionMaps.isrealmapMethod
isrealmap(m)

Is the map real-valued?

A map is real-valued if both its domain and codomain types are real.

source
FunctionMaps.jacdetMethod
jacdet(m[, x])

Return the determinant of the jacobian as a map. The two-argument version evaluates the jacobian determinant at a point x.

source
FunctionMaps.jacobianMethod
jacobian(m[, x])

Return the jacobian map. The two-argument version evaluates the jacobian at a point x.

source
FunctionMaps.leftinverseMethod
leftinverse(m[, x])

Return a left inverse of the given map. This left inverse mli is not unique, but in any case it is such that (mli ∘ m) * x = x for each x in the domain of m.

The two-argument function applies the left inverse to the point x.

source
FunctionMaps.mapsizeFunction
mapsize(m[, i])

The size of a vectorvalued map is the size of its jacobian matrix.

A map with size (3,5) maps vectors of length 5 to vectors of length 3. Its jacobian matrix is a 3-by-5 matrix.

Optionally, similar to the size function, a second argument i can be provided. Choose i to be 1 or 2 to return only the corresponding element of the size. The dimension of the domain type is mapsize(m, 2), while that of the codomain type is mapsize(m, 1).

If a map is scalar valued, its mapsize equals (). This reflects the convention in Julia that the size of a number is an empty tuple: size(5) == (). If a map is scalar-to-vector, its mapsize is the tuple (m,) of length one. In this case the jacobian is a vector with size (m,). If a map is vector-to-scalar, its mapsize is (1,n).

Thus, in all cases of scalarvalued and vectorvalued maps, the mapsize of a map agrees with the size of the Jacobian matrix.

source
FunctionMaps.rightinverseMethod
rightinverse(m[, x])

Return a right inverse of the given map. This right inverse mri is not unique, but in any case it is such that (m ∘ mri) * y = y for each y in the range of m.

The two-argument function applies the right inverse to the point x.

source

Types

FunctionMaps.AffineMapType
AffineMap{T} <: AbstractAffineMap{T}

The supertype of all affine maps that store `A` and `b`.

Concrete subtypes differ in how A and b are represented.

source
FunctionMaps.AffineMapMethod
AffineMap(A, b)

Return an affine map with an appropriate concrete type depending on the arguments A and b.

Examples

julia> AffineMap(2, 3)
x -> 2 * x + 3
source
FunctionMaps.LinearMapType
LinearMap{T} <: AbstractAffineMap{T}

The supertype of all linear maps y = A*x.

Concrete subtypes may differ in how A is represented.

source
FunctionMaps.MapRefType
MapRef(m)

A reference to a map.

In a function call, MapRef(x) can be used to indicate that x should be treated as a map, e.g., foo(x, MapRef(m)).

source
FunctionMaps.ProductMapType

A product map is diagonal and acts on each of the components of x separately: y = f(x) becomes y_i = f_i(x_i).

source

Internal API Reference

This is an exhaustive list of all non-exported constants, types and functions in FunctionMaps.jl.

Warning

Unexported functions and types are subject to change across different releases of the package, even if the release is said to be non-breaking.

Constants

Functions

FunctionMaps.checkmapMethod

checkmap(m)

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

source
FunctionMaps.convert_fromcartesianMethod

Convert a vector from a cartesian format to a nested tuple according to the given dimensions.

For example: convert_fromcartesian([1,2,3,4,5], Val{(2,2,1)}()) -> ([1,2],[3,4],5)

source
FunctionMaps.functionmapMethod
functionmap(m)

Return a map associated with the object m.

The result need not have type Map, but its MapStyle is IsMap.

source
FunctionMaps.interval_mapMethod

Map the interval [a,b] to the interval [c,d].

This function deals with infinite intervals, and the type of the map returned may depend on the value (finiteness) of the given endpoints.

source
FunctionMaps.to_vectorMethod
to_vector(::Type{T}, A[, b])

Convert the b in the affine map A*x or A*x+b with domaintype T to a vector.

source

Types

FunctionMaps.AbstractAffineMapType
AbstractAffineMap{T} <: Map{T}

An affine map has the general form y = A*x + b.

We use affinematrix(m) and affinevector(m) to denote A and b respectively. Concrete subtypes include linear maps of the form y = A*x and translations of the form y = x + b.

See also: affinematrix, affinevector.

source
FunctionMaps.AngleMapType

AngleMap is a left inverse of UnitCircleMap. A 2D vector x is projected onto the intersection point with the unit circle of the line connecting x to the origin. The angle of this point, scaled to the interval [0,1), is the result.

source
FunctionMaps.CartToPolarMapType

A Cartesion to Polar map. First dimension is interpreted as radial distance, second as an angle. The unit circle is mapped to the square [-1,1]x[-1,1].

source
FunctionMaps.ComposedMapType
ComposedMap{T,MAPS}

The composition of several maps.

The components of a ComposedMap are the maps in the order that they are applied to the input.

source
FunctionMaps.LazyMapType

A lazy map has an action that is defined in terms of other maps. Those maps are stored internally, and the action of the lazy map is computed on-the-fly and only when invoked.

source
FunctionMaps.PolarToCartMapType

A Polar to Cartesian map. The angle is mapped to the second dimension, radius to the first. The square [-1,1]x[-1,1] is mapped to the unit circle.

source
FunctionMaps.TupleProductMapType

A TupleProductMap is a product map with all components collected in a tuple. There is no vector-valued function associated with this map.

source
FunctionMaps.VcatMapType

A VcatMap is a product map with domain and codomain vectors concatenated (vcat) into a single vector.

source