LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::lqn::SparseGraph< T > Struct Template Reference

A sparse square matrix over element indices, held as a dense vector of rows with an explicit nonzero list per row. More...

#include <line/lang/lqn/lqn_struct.h>

Collaboration diagram for line::lqn::SparseGraph< T >:

Public Member Functions

void resize (std::size_t nn)
void set (std::size_t i, std::size_t j, const T &v)
get (std::size_t i, std::size_t j) const
std::vector< std::size_t > succ (std::size_t i) const
 Successors of i in ascending index order, as MATLAB's find() returns them.
std::vector< std::size_t > pred (std::size_t j) const
 Predecessors of j in ascending index order.
void erase (std::size_t i, std::size_t j)

Public Attributes

std::size_t n = 0
std::vector< std::vector< std::pair< std::size_t, T > > > row
 1-based, row[0] unused

Detailed Description

template<class T>
struct line::lqn::SparseGraph< T >

A sparse square matrix over element indices, held as a dense vector of rows with an explicit nonzero list per row.

The LQN graph is very sparse (each activity has one or two successors) and the algorithms walk it by "successors of i", never by column, except for find(graph(:,j)) in the reply search and find(taskgraph(:,t)) in the multiplicity correction. Both column queries are rare, so they scan.

Definition at line 99 of file lqn_struct.h.

Member Function Documentation

◆ erase()

template<class T>
void line::lqn::SparseGraph< T >::erase ( std::size_t i,
std::size_t j )
inline

Definition at line 141 of file lqn_struct.h.

References row.

◆ get()

template<class T>
T line::lqn::SparseGraph< T >::get ( std::size_t i,
std::size_t j ) const
inline

Definition at line 115 of file lqn_struct.h.

References row.

◆ pred()

template<class T>
std::vector< std::size_t > line::lqn::SparseGraph< T >::pred ( std::size_t j) const
inline

Predecessors of j in ascending index order.

Definition at line 130 of file lqn_struct.h.

References n, and row.

◆ resize()

template<class T>
void line::lqn::SparseGraph< T >::resize ( std::size_t nn)
inline

Definition at line 103 of file lqn_struct.h.

References n, and row.

◆ set()

template<class T>
void line::lqn::SparseGraph< T >::set ( std::size_t i,
std::size_t j,
const T & v )
inline

Definition at line 107 of file lqn_struct.h.

References row.

◆ succ()

template<class T>
std::vector< std::size_t > line::lqn::SparseGraph< T >::succ ( std::size_t i) const
inline

Successors of i in ascending index order, as MATLAB's find() returns them.

Definition at line 121 of file lqn_struct.h.

References row.

Member Data Documentation

◆ n

template<class T>
std::size_t line::lqn::SparseGraph< T >::n = 0

Definition at line 100 of file lqn_struct.h.

Referenced by pred(), and resize().

◆ row

template<class T>
std::vector<std::vector<std::pair<std::size_t, T> > > line::lqn::SparseGraph< T >::row

1-based, row[0] unused

Definition at line 101 of file lqn_struct.h.

Referenced by erase(), get(), pred(), resize(), set(), and succ().


The documentation for this struct was generated from the following file: