Vertex Types
While it is not generally expected that implementations should need to define new vertex types, the existing ones are typically useful for dispatching.
Imported to namespace by
using NaiveNASlib.Extend
NaiveNASlib.base
— Methodbase(v::AbstractVertex)
Return the vertex wrapped in v
(if any).
NaiveNASlib.AbstractVertex
— TypeAbstractVertex
Vertex base type.
NaiveNASlib.InputVertex
— TypeInputVertex
Acts as a source of data to the graph and therefore does not need any input vertices to feed it.
Examples
julia> using NaiveNASlib, NaiveNASlib.Extend
julia> InputVertex(1)
InputVertex(1)
julia> InputVertex("input")
InputVertex(input)
NaiveNASlib.InputSizeVertex
— TypeInputSizeVertex
Vertex with an (immutable) size.
Intended use is for wrapping an InputVertex in conjuntion with mutation
NaiveNASlib.CompVertex
— TypeCompVertex
CompVertex(c, ins::AbstractVertex...)
CompVertex(c, ins::AbstractArray{<:AbstractVertex}) =
Maps input from input vertices to output through output = c(input...)
.
Must have at least one input vertex.
Examples
julia> using NaiveNASlib, NaiveNASlib.Extend
julia> CompVertex(+, InputVertex(1), InputVertex(2))
CompVertex(+, inputs=[InputVertex(1), InputVertex(2)])
julia> CompVertex(x -> 4x, InputVertex(1))(2)
8
julia> CompVertex(*, InputVertex(1), InputVertex(2))(2,3)
6
NaiveNASlib.MutationVertex
— TypeMutationVertex
Vertex which may be subject to mutation.
The member trait describes the nature of the vertex itself, for example if size changes are absorbed (e.g changing an nin x nout
matrix to an nin - Δ x nout
matrix) or if they propagate to neighbouring vertices (and if so, how).
NaiveNASlib.OutputsVertex
— TypeOutputsVertex
Decorates an AbstractVertex with output edges.