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.affinematrix — Method
Return the matrix A in the affine map Ax+b.
FunctionMaps.affinevector — Method
Return the vector b in the affine map Ax+b.
FunctionMaps.canonicalmap — Method
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.
FunctionMaps.codomaintype — Method
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.
FunctionMaps.diffvolume — Method
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.
FunctionMaps.domaintype — Method
domaintype(m)What is the expected type of a point in the domain of the function map m?
FunctionMaps.factor — Method
Factor I... of a product-like composite object.
FunctionMaps.factors — Function
Factors of a product-like composite object (equivalent to components(d)).
FunctionMaps.inverse — Method
inverse(m[, x])Return the inverse of m. The two-argument function evaluates the inverse at the point x.
FunctionMaps.isaffinemap — Method
isaffinemap(m)Is m an affine map?
If m is affine, then it has the form m(x) = A*x+b.
See also: affinematrix, affinevector.
FunctionMaps.isequalmap — Method
isequalmap(map1, map2)Are the two given maps equal?
FunctionMaps.islinearmap — Method
islinearmap(m)Is m a linear map?
FunctionMaps.isrealmap — Method
isrealmap(m)Is the map real-valued?
A map is real-valued if both its domain and codomain types are real.
FunctionMaps.jacdet — Method
jacdet(m[, x])Return the determinant of the jacobian as a map. The two-argument version evaluates the jacobian determinant at a point x.
FunctionMaps.jacobian — Method
jacobian(m[, x])Return the jacobian map. The two-argument version evaluates the jacobian at a point x.
FunctionMaps.leftinverse — Method
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.
FunctionMaps.mapsize — Function
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.
FunctionMaps.nfactors — Method
The number of factors of a product-like composite object.
FunctionMaps.numtype — Method
The numeric element type of x in a Euclidean space.
FunctionMaps.prectype — Method
prectype(x[, ...])The floating point precision type associated with the argument(s).
FunctionMaps.rightinverse — Method
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.
Types
FunctionMaps.AffineMap — Type
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.
FunctionMaps.AffineMap — Method
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 + 3FunctionMaps.ConstantMap — Type
The supertype of constant maps from T to U.
FunctionMaps.IdentityMap — Type
Supertype of identity maps.
FunctionMaps.LinearMap — Type
LinearMap{T} <: AbstractAffineMap{T}The supertype of all linear maps y = A*x.
Concrete subtypes may differ in how A is represented.
FunctionMaps.Map — Type
A Map{T} is a map of a single variable of type T.
FunctionMaps.MapRef — Type
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)).
FunctionMaps.ProductMap — Type
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).
FunctionMaps.Translation — Type
A Translation represents the map y = x + b.
FunctionMaps.UnityMap — Type
The unity map f(x) = 1.
FunctionMaps.ZeroMap — Type
The zero map f(x) = 0.
Internal API Reference
This is an exhaustive list of all non-exported constants, types and functions in FunctionMaps.jl.
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
FunctionMaps.AnyMap — Type
AnyMap is the union of Map and MapRef.
In both cases map(m::AnyMap) returns the map itself.
Functions
FunctionMaps.affine_composition — Method
Compute the affine map that represents map2 after map1, that is: y = a2*(a1*x+b1)+b2 = a2*a1*x + a2*b1 + b2.
FunctionMaps.bounded_interval_map — Method
Like interval_map, but guaranteed to return a scalar affine map.
FunctionMaps.canonicalextensiontype — Method
Return the extension type associated with the given object.
FunctionMaps.checkmap — Method
checkmap(m)
Checks that m is a map or refers to a map and if so returns that map, throws an error otherwise.
FunctionMaps.convert_domaintype — Method
convert_domaintype(T, m)Convert the given map to a map such that its domaintype is T.
See also: domaintype.
FunctionMaps.convert_eltype — Method
convert_eltype(T, x)Convert x such that its eltype equals T.
FunctionMaps.convert_fromcartesian — Method
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)
FunctionMaps.convert_numtype — Method
convert_numtype(T, x)Convert x such that its numtype equals T.
FunctionMaps.convert_prectype — Method
convert_prectype(T, x)Convert x such that its prectype equals T.
FunctionMaps.convert_tocartesian — Method
The inverse function of convert_fromcartesian.
FunctionMaps.euclideandimension — Method
What is the euclidean dimension of the given type (if applicable)?
FunctionMaps.functionmap — Method
functionmap(m)Return a map associated with the object m.
The result need not have type Map, but its MapStyle is IsMap.
FunctionMaps.glm_domaintype — Method
What is the suggested domaintype for a generic linear map A*x with the given argument 'A'?
FunctionMaps.hascanonicalmap — Method
Does the map have a canonical map?
FunctionMaps.hashrec — Method
Apply the hash function recursively to the given arguments.
FunctionMaps.identitymatrix — Method
Return an identity matrix with the same size as the map.
FunctionMaps.interval_map — Method
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.
FunctionMaps.issquaremap — Method
Is the given map a square map?
FunctionMaps.isvectorvalued — Method
Is the map a vector-valued function, i.e., a function from Rn to Rm?
FunctionMaps.promotable_eltypes — Method
Are the given element types promotable to a concrete supertype?
FunctionMaps.promotable_maps — Method
Can the maps be promoted to a common domain type without throwing an error?
FunctionMaps.promote_map_point_pair — Method
Promote map and point to compatible types.
FunctionMaps.promote_maps — Method
Promote the given maps to have a common domain type.
FunctionMaps.promote_numtype — Method
promote_numtype(a, b[, ...])Promote the numeric types of the arguments to a joined supertype.
FunctionMaps.promote_prectype — Method
promote_prectype(a, b[, ...])Promote the precision types of the arguments to a joined supertype.
FunctionMaps.simplifies — Method
simplifies(m)Does the map simplify?
FunctionMaps.simplify — Method
simplify(m)Simplify the given map to an equal map.
FunctionMaps.to_matrix — Method
to_matrix(T, A[, b])Convert the A in the affine map A*x or A*x+b with domaintype T to a matrix.
FunctionMaps.to_numtype — Method
to_numtype(U, T)Return the type to which T can be converted, such that the numtype becomes U.
FunctionMaps.to_prectype — Method
to_prectype(U, T)Return the type to which T can be converted, such that the prectype becomes U.
FunctionMaps.to_vector — Method
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.
FunctionMaps.tofunctionmap — Method
Convert the given map to a map defined in FunctionMaps.jl.
FunctionMaps.zeromatrix — Method
Return a zero matrix of the same size as the map.
FunctionMaps.zerovector — Method
Return a zero vector of the same size as the codomain of the map.
Types
FunctionMaps.AbsMap — Type
An AbsMap returns the absolute value of the result of a given map.
FunctionMaps.AbstractAffineMap — Type
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.
FunctionMaps.AngleMap — Type
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.
FunctionMaps.CanonicalExtensionType — Type
CanonicalExtensionType <: CanonicalTypeCanonical types used to translate between packages.
FunctionMaps.CanonicalType — Type
Supertype of different kinds of canonical objects.
FunctionMaps.CartToPolarMap — Type
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].
FunctionMaps.ComplexToVector — Method
ComplexToVector()
ComplexToVector{T}()Map a complex number $a+bi$ to the length 2 vector $[a; b]$.
See also: VectorToComplex.
FunctionMaps.ComposedMap — Type
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.
FunctionMaps.CompositeLazyMap — Type
A composite lazy map is defined in terms of several other maps.
FunctionMaps.DerivedMap — Type
A DerivedMap inherits all of its properties from another map, but has its own type.
FunctionMaps.DeterminantMap — Type
A DeterminantMap returns the determinant of the result of a given map.
FunctionMaps.DynamicIdentityMap — Type
Identity map with dynamic size determined by a dimension field.
FunctionMaps.Equal — Type
Equal <: CanonicalTypeA canonical object that is equal but simpler.
FunctionMaps.Equivalent — Type
Equivalent <: CanonicalTypeA canonical object that is equivalent but may have different type.
FunctionMaps.FixedConstantMap — Type
The constant map f(x) = c.
FunctionMaps.FlatToNested — Type
Map a flattened vector to a nested one.
FunctionMaps.GenericAffineMap — Type
An affine map for any combination of types of A and b.
FunctionMaps.GenericLinearMap — Type
A GenericLinearMap is a linear map y = A*x for any type of A.
FunctionMaps.GenericTranslation — Type
Translation by a generic vectorlike object.
FunctionMaps.IsMap — Type
IsMap()indicates an object implements the map interface.
FunctionMaps.Isomorphism — Type
Isomorphism{T,U} <: TypedMap{T,U}An isomorphism is a bijection between types that preserves norms.
FunctionMaps.LazyDiffVolume — Type
A lazy volume element evaluates to diffvolume(m, x) on the fly.
FunctionMaps.LazyInverse — Type
A lazy inverse stores a map m and returns inverse(m, x).
FunctionMaps.LazyJacobian — Type
A lazy Jacobian J stores a map m and returns J(x) = jacobian(m, x).
FunctionMaps.LazyMap — Type
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.
FunctionMaps.MapStyle — Type
MapStyle(m)Trait to indicate whether or not m implements the map interface.
FunctionMaps.MulMap — Type
The lazy multiplication of one or more maps.
FunctionMaps.NestedToFlat — Type
Map a nested vector or tuple to a flat vector.
FunctionMaps.NotMap — Type
NotMap()indicates an object does not implement the Map interface.
FunctionMaps.NumberToVector — Method
NumberToVector()
NumberToVector{T}()Map a number x to the length 1 vector [x].
See also: VectorToNumber.
FunctionMaps.PolarToCartMap — Type
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.
FunctionMaps.ScalarAffineMap — Type
An affine map with scalar representation.
FunctionMaps.ScalarLinearMap — Type
A ScalarLinearMap is a linear map y = A*x for scalars.
FunctionMaps.ScalarTranslation — Type
Translation by a scalar value.
FunctionMaps.SimpleLazyMap — Type
A simple lazy map derives from a single other map.
FunctionMaps.StaticAffineMap — Type
An affine map with representation using static arrays.
FunctionMaps.StaticIdentityMap — Type
The identity map for variables of type T.
FunctionMaps.StaticLinearMap — Type
A StaticLinearMap is a linear map y = A*x using static arrays.
FunctionMaps.StaticTranslation — Type
Translation by a static vector.
FunctionMaps.SumMap — Type
The lazy sum of one or more maps.
FunctionMaps.TupleProductMap — Type
A TupleProductMap is a product map with all components collected in a tuple. There is no vector-valued function associated with this map.
FunctionMaps.TupleToVector — Type
Map a tuple to a static vector.
FunctionMaps.TypedMap — Type
Any instance of TypedMap{T,U} maps a variable of type T to a variable of type U.
FunctionMaps.UnitCircleMap — Type
The map [cos(2πt), sin(2πt)] from [0,1] to the unit circle in ℝ^2.
FunctionMaps.UnitDiskMap — Type
The map r*[cos(2πt), sin(2πt)] from [0,1]^2 to the unit disk in ℝ^2.
FunctionMaps.VcatMap — Type
A VcatMap is a product map with domain and codomain vectors concatenated (vcat) into a single vector.
FunctionMaps.VectorAffineMap — Type
An affine map with array and vector representation.
FunctionMaps.VectorLinearMap — Type
A VectorLinearMap is a linear map y = A*x using vectors and matrices.
FunctionMaps.VectorProductMap — Type
A VectorProductMap is a product map where all components are univariate maps, with inputs and outputs collected into a Vector.
FunctionMaps.VectorToComplex — Method
VectorToComplex()
VectorToComplex{T}()Map a length 2 vector $[a;b]$ to the complex number $a+bi$.
See also: ComplexToVector.
FunctionMaps.VectorToNumber — Method
VectorToNumber()
VectorToNumber{T}()Map a length 1 vector x to the number x[1].
See also: NumberToVector.
FunctionMaps.VectorToTuple — Type
Map a static vector to a tuple.
FunctionMaps.VectorTranslation — Type
Translation by a vector.
FunctionMaps.WrappedMap — Type
A WrappedMap{T} takes any object and turns it into a Map{T}.