VectorInterface.jl

A small Julia interface for vector-like objects.

VectorInterface.jl proposes a minimal set of methods that any type representing an element of a vector space should support. Code written against this interface can then operate uniformly on Numbers, AbstractArrays, nested arrays, tuples, named tuples, and arbitrary user-defined types — without conflating vector-space operations with the iteration, container, or LinearAlgebra interfaces.

Installation

julia> using Pkg; Pkg.add("VectorInterface")

What's provided

Each !-suffixed method modifies its first argument in place. Each !!-suffixed method tries to do so but falls back to allocating when in-place updates are not possible (e.g. for immutable types or incompatible scalar types). This convention follows BangBang.jl.

Contents