Skip to content

Class AdjList

ClassList > AdjList

Adjacency list representation of a network.

  • #include <adjlist-bones.hpp>

Public Functions

Type Name
AdjList ()
AdjList (const std::vector< int > & source, const std::vector< int > & target, int size, bool directed)
Construct a new Adj List object.
AdjList (AdjList && a)
AdjList (const AdjList & a)
size_t ecount () const
Number of edges/arcs/ties in the network.
std::vector< std::map< int, int > > & get_dat ()
bool is_directed () const
true if the network is directed.
std::map< int, int > operator() (epiworld_fast_uint i) const
AdjList & operator= (const AdjList & a)
void print (epiworld_fast_uint limit=20u) const
void read_edgelist (std::string fn, int size, int skip=0, bool directed=true)
Read an edgelist.
size_t vcount () const
Number of vertices/nodes in the network.

Public Functions Documentation

function AdjList [1/4]

inline AdjList::AdjList () 

function AdjList [2/4]

Construct a new Adj List object.

inline AdjList::AdjList (
    const std::vector< int > & source,
    const std::vector< int > & target,
    int size,
    bool directed
) 

Ids in the network are assume to range from 0 to size - 1.

Parameters:

  • source Unsigned int vector with the source
  • target Unsigned int vector with the target
  • size Number of vertices in the network.
  • directed Bool true if the network is directed

function AdjList [3/4]

inline AdjList::AdjList (
    AdjList && a
) 

function AdjList [4/4]

inline AdjList::AdjList (
    const AdjList & a
) 

function ecount

Number of edges/arcs/ties in the network.

inline size_t AdjList::ecount () const


function get_dat

inline std::vector< std::map< int, int > > & AdjList::get_dat () 

function is_directed

true if the network is directed.

inline bool AdjList::is_directed () const


function operator()

inline std::map< int, int > AdjList::operator() (
    epiworld_fast_uint i
) const

function operator=

inline AdjList & AdjList::operator= (
    const AdjList & a
) 

function print

inline void AdjList::print (
    epiworld_fast_uint limit=20u
) const

function read_edgelist

Read an edgelist.

inline void AdjList::read_edgelist (
    std::string fn,
    int size,
    int skip=0,
    bool directed=true
) 

Ids in the network are assume to range from 0 to size - 1.

Parameters:

  • fn Path to the file
  • skip Number of lines to skip (e.g., 1 if there's a header)
  • directed true if the network is directed
  • size Number of vertices in the network.

function vcount

Number of vertices/nodes in the network.

inline size_t AdjList::vcount () const



The documentation for this class was generated from the following file epiworld-src/include/epiworld/adjlist-bones.hpp