API reference
VectorInterface.MinimalMVecVectorInterface.MinimalSVecVectorInterface.MinimalVecVectorInterface.OneVectorInterface.ZeroVectorInterface.addVectorInterface.add!VectorInterface.add!!VectorInterface.innerVectorInterface.scalartypeVectorInterface.scaleVectorInterface.scale!VectorInterface.scale!!VectorInterface.zerovectorVectorInterface.zerovector!VectorInterface.zerovector!!
VectorInterface.MinimalMVec — Type
const MinimalMVec = MinimalVec{true}
MinimalMVec(v::AbstractVector)Type alias for MinimalVec{true}, representing a vector wrapper that implements the minimal interface of VectorInterface.jl, including in-place operations (!-methods).
See also MinimalVec and MinimalSVec.
VectorInterface.MinimalSVec — Type
const MinimalSVec = MinimalVec{false}
MinimalSVec(v::AbstractVector)Type alias for MinimalVec{false}, representing a vector wrapper that implements the minimal interface of VectorInterface.jl, excluding in-place operations (!-methods).
See also MinimalVec and MinimalMVec.
VectorInterface.MinimalVec — Type
MinimalVec{M,V<:AbstractVector}
MinimalVec{M}(vec::V) where {M,V<:AbstractVector}Wraps a vector of type V<:AbstractVector in such a way that the wrapper only supports the minimal interface put forward by VectorInterface.jl. The type parameter M can take the values true or false and determines whether the vector behaves as a mutable vector that supports in-place operations (M == true) or whether it behaves as an immutable or static vector (M == false).
This wrapper can be used to test whether an algorithm is implemented using only the minimal interface of VectorInterface.jl, without relying on other methods that would for example be available for AbstractVector or AbstractArray.
To unwrap the contents of a v::MinimalVec instance, the field access v.vec can be used.
See also MinimalMVec and MinimalSVec for convenience constructors.
VectorInterface.One — Type
struct One endSingleton type for representing a hard-coded constant 1 in vector addition / linear combinations.
VectorInterface.Zero — Type
struct Zero endSingleton type for representing a hard-coded constant 0 in vector addition / linear combinations.
Now I am become Zero, the destroyer of NaN. - VishnuVectorInterface.add!! — Method
add!!(y, x, [α::Number = 1, β::Number = 1])Add y and x, or more generally construct the linear combination y * β + x * α, thereby trying to store the result in y. A new object will be created when this fails due to immutability, incompatible scalar types or incommensurate sizes.
VectorInterface.add! — Method
add!(y, x, [α::Number = One(), β::Number = One()])Add y and x, or more generally construct the linear combination y * β + x * α, storing the result in y. This will error in case of incompatible scalar types or incommensurate sizes.
VectorInterface.add — Method
add(y, x, [α::Number = 1, β::Number = 1])Add y and x, or more generally construct the linear combination y * β + x * α.
VectorInterface.inner — Function
inner(x, y)Compute the inner product between x and y.
VectorInterface.scalartype — Function
scalartype(x)Returns the type of scalar over which the vector-like object x behaves as a vector, e.g. the type of scalars with which x could be scaled in-place. This function should also work in the type domain, i.e. if x is a vector like object, then also scalartype(typeof(x)) should work.
VectorInterface.scale — Function
scale(x, α::Number)Computes the new vector-like object obtained from scaling x with the scalar α.
VectorInterface.scale! — Function
scale!(x, α::Number) -> x
scale!(y, x, α::Number) -> yRescale x with the scalar coefficient α, thereby overwrite and thus recylcing the contents of x (in the first form) or y (in the second form). This is only possible if x, respectively y is mutable, and if the scalar types involed are compatible and can be promoted and converted.
VectorInterface.scale!! — Function
scale!!(x, α::Number)
scale!!(y, x, α::Number)Rescale x with the scalar coefficient α, thereby trying to overwrite and thus recylce the contents of x (in the first form) or y (in the second form). A new object will be created when this fails due to immutability, incompatible scalar types or incommensurate sizes.
VectorInterface.zerovector — Function
zerovector(x, [S::Type{<:Number} = scalartype(x)])Returns a zero vector in the vector space of x. Optionally, a modified scalar type S for the resulting zero vector can be specified.
Also see: zerovector!, zerovector!!
VectorInterface.zerovector! — Function
VectorInterface.zerovector!! — Function
zerovector!!(x, [S::Type{<:Number} = scalartype(x)])Construct a zero vector in the vector space of x, thereby trying to overwrite and thus recycle x when possible. Optionally, a modified scalar type S for the resulting zero vector can be specified.
New types should only implement the one-argument version. The two-argument version amounts to S == scalartype(x) ? zerovector!!(x) : zerovector(x, S)
Also see: zerovector, zerovector!