API
Modules
Types and constants
AffineMaps.AbstractAffineMapAffineMaps.AddAffineMaps.AddMulAffineMaps.InvAddMulAffineMaps.InvMulAffineMaps.InvMulAddAffineMaps.MulAffineMaps.MulAddAffineMaps.Subtract
Functions and macros
Documentation
AffineMaps.AffineMaps — Module
AffineMapsImplements affine transformations in a modular way.
AffineMaps.AbstractAffineMap — Type
abstract type AbstractAffineMap <: FunctionAbstract type for affine maps.
An affine map f::AbstractAffineMap acts like f(x) == A * x .+ b or f(x) == A * (x .+ b) or their inverses, depending on the type of the map f.
A may be a Number, an AbstractMatrix{<:Number}, a LinearAlgebra.UniformScaling or any other multiplicative linear operator that supports A * x. The packages LinearMaps, LinearOperators and SciMLOperators provide such operators, for example. Inverse maps require support for A \ y, and logabsdet(Jacobian) computations are supported for Number, AbstractMatrix and UniformScaling operators.
b must broadcast over A * x (resp. x) without changing its shape: a scalar, an array of equal shape, or e.g. a vector to add column-wise to a matrix-valued A * x.
A matrix-valued x is treated as a batch of column-vector samples, so ChangesOfVariables.with_logabsdet_jacobian returns a 1 × size(x, 2) matrix of per-column values then.
Subtypes of AbstractAffineMap should implement/support the APIs of
AffineMaps.Add — Type
AffineMaps.AddMul — Type
struct AddMulf = AddMul(b, A) has the behavior f(x) == f.A * (x .+ f.b).
See AbstractAffineMap for more information.
AffineMaps.InvAddMul — Type
struct InvAddMulf = InvAddMul(b, A) has the behavior f(x) == (f.A \ x) .- f.b. It is the inverse of AddMul(b, A).
See AbstractAffineMap for more information.
AffineMaps.InvMul — Type
struct InvMulf = InvMul(A) has the behavior f(x) == f.A \ x. It is the inverse of Mul(A).
See AbstractAffineMap for more information.
AffineMaps.InvMulAdd — Type
struct InvMulAddf = InvMulAdd(A, b) has the behavior f(x) == f.A \ (x .- f.b). It is the inverse of MulAdd(A, b).
See AbstractAffineMap for more information.
AffineMaps.Mul — Type
AffineMaps.MulAdd — Type
struct MulAddf = MulAdd(A, b) has the behavior f(x) == f.A * x .+ f.b.
See AbstractAffineMap for more information.
AffineMaps.Subtract — Type
struct Subtractf = Subtract(b) has the behavior f(x) == x .- f.b. It is the inverse of Add(b).
See AbstractAffineMap for more information.