Internals

LinearCombinations.unval — Function
LinearCombinations.unval(x)

Return c if the argument x is of type Val{c} and x itself otherwise.

This can be used to write type-stable code for the coefftype keyword argument to linear and multilinear functions.

See also @linear, @linear_kw, @multilinear.

Examples

julia> LinearCombinations.unval(Char)
Char

julia> LinearCombinations.unval(Val(Char))
Char
source
LinearCombinations.show_summand — Function
LinearCombinations.show_summand(io::IO, x, c)

This function is called for each term-coefficient pair x => c of a linear combination that is displayed. By defining additional methods for this function, the output that it printed for certain term or coefficient types can be customized.

source
LinearCombinations.AddToMul — Type
LinearCombinations.AddToMul{T, R, L <: AbstractLinear{T,R}, S} <: AbstractLinear{T,R}

AddToMul(a::AbstractLinear, c)

This subtype of AbstractLinear only implements methods for length, sizehint!, modifycoeff! and modifylinear!. Hence one can use it as the first argument to addmul!, add!, sub!, += and -=. Adding b to AddToMul(a, c) effectively adds c*b to a.

source