Networks are following the AbstractArray interface rather closely, with some additional functionalities to get at interactions by using species names rather than networks positions.

Accessing elements

Base.getindexFunction
getindex(N::AbstractEcologicalNetwork, i::T, j::T)

Get the value of an interaction based on the position of the species.

source
getindex(N::AbstractEcologicalNetwork, i::T)

Get the value of an interaction based on the position of the species.

source
getindex(N::AbstractEcologicalNetwork, ::Colon, j::T)

Get the value of an interaction based on the position of the species.

source
getindex(N::AbstractEcologicalNetwork, i::T, ::Colon)

Get the value of an interaction based on the position of the species.

source
getindex{T}(N::AbstractEcologicalNetwork, s1::T, s2::T)

Get the value of an interaction based on the name of the species. This is the recommended way to look for things in a network.

source
getindex{T}(N::AbstractBipartiteNetwork, ::Colon, sp::T)

Gets the predecessors (i.e. species that interacts with / consume) of a focal species. This returns the list of species as a Set object, in which ordering is unimportant.

source
getindex{T}(N::AbstractEcologicalNetwork, sp::T, ::Colon)

Gets the successors (i.e. species that are interacted with / consumed) of a focal species. This returns the list of species as a Set object, in which ordering is unimportant.

source
getindex{T}(N::AbstractUnipartiteNetwork, sp::Array{T})

Induce a unipartite network based on a list of species, all of which must be in the original network. This function takes a single argument (as opposed to two arrays, or an array and a colon) to ensure that the returned network is unipartite.

The network which is returned by this function may not have the species in the order specified by the user for performance reasons.

source
getindex{T}(N::AbstractBipartiteNetwork, ::Colon, sp::Array{T})

TODO

source
getindex{T}(N::AbstractBipartiteNetwork, sp::Array{T}, ::Colon)

TODO

source
getindex{T}(N::AbstractBipartiteNetwork, sp1::Array{T}, sp2::Array{T})

TODO

source
getindex{T}(N::AbstractBipartiteNetwork, sp1::Array{T}, sp2::Array{T})

TODO

source

Changing elements

The ecological networks types are all mutable.

Base.setindex!Function
setindex!(N::T, A::Any, i::E, j::E) where {T <: AbstractEcologicalNetwork, E}

Changes the value of the interaction at the specificied position, where i and j are species names. Note that this operation changes the network.

source
setindex!(N::T, A::K, i::E, j::E) where {T <: AbstractEcologicalNetwork, K <: _interaction_type(N), E <: Int}

Changes the value of the interaction at the specificied position, where i and j are species positions. Note that this operation changes the network.

source

Network size

Base.sizeFunction
size(N::AbstractEcologicalNetwork)

Return the size of the adjacency matrix of an AbstractEcologicalNetwork object.

source
size(N::AbstractEcologicalNetwork, i::Int64)

Return the size of the adjacency matrix of an AbstractEcologicalNetwork object.

source