LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::spn::ispn_detail Namespace Reference

Classes

struct  Net
struct  Arc
struct  Walk
struct  Elim

Typedefs

typedef std::vector< double > Vec
typedef std::vector< Vec > Mat

Functions

std::string fmt (const char *f, double a=0, double b=0, double c=0, double d=0)
void refuse (const std::string &m)
void unstable (const std::string &m)
void badarg (const std::string &m)
Mat zeros (std::size_t n, std::size_t m)
Mat eye (std::size_t n)
std::size_t ncols (const Mat &A)
Mat sub (const Mat &A, const std::vector< std::size_t > &r, const std::vector< std::size_t > &c)
bool all_zero (const Mat &A)
double max_abs (const Vec &a)
double max_abs (const Mat &A)
double max_abs_diff (const Mat &A, const Mat &B)
Mat plus (const Mat &A, const Mat &B)
Mat minus (const Mat &A, const Mat &B)
Mat scale (const Mat &A, double s)
Mat mult (const Mat &A, const Mat &B)
Vec vec_mult (const Vec &x, const Mat &A)
double sum (const Vec &a)
Vec row_sums (const Mat &A)
double dot (const Vec &a, const Vec &b)
std::vector< std::size_t > lu (Mat &A)
 LU with partial pivoting in place; returns the row permutation.
Mat solve (const Mat &A0, const Mat &B)
 Solves A X = B.
Mat inv (const Mat &A)
Vec solve_left (const Mat &A, const Vec &b)
 Solves x A = b for the row vector x.
double norm1 (const Mat &A)
double cond1 (const Mat &A)
Matrix< double > to_matrix (const Mat &A)
Mat from_matrix (const Matrix< double > &M)
Vec enabled_weights (const Net &net, const Vec &m, std::vector< bool > &en)
std::size_t lookup (Walk &W, std::map< std::vector< long long >, std::size_t > &keys, const Vec &m, const Net &net, int cap, const IspnOptions &opt)
Walk explore (const Net &net, const Vec &m0, int cap, const IspnOptions &opt)
Elim eliminate (const Walk &W, const Net &net, int Ktop)
int find_K (const Elim &E, int Ktop, const IspnOptions &opt, std::size_t p0)
double expect (const Vec &r, const std::string &what, const Mat &x, const std::vector< std::vector< std::size_t > > &lv, int K, int Ktop, const Vec &c1, const Vec &c2, double tol)
long long gcd_ll (long long a, long long b)
std::vector< Vec > minimal (const std::vector< Vec > &D, std::size_t T, std::size_t P)

Typedef Documentation

◆ Mat

typedef std::vector<Vec> line::spn::ispn_detail::Mat

Definition at line 102 of file spn_ispn.h.

◆ Vec

typedef std::vector<double> line::spn::ispn_detail::Vec

Definition at line 101 of file spn_ispn.h.

Function Documentation

◆ all_zero()

bool line::spn::ispn_detail::all_zero ( const Mat & A)
inline

Definition at line 133 of file spn_ispn.h.

References all_zero().

Referenced by all_zero().

◆ badarg()

void line::spn::ispn_detail::badarg ( const std::string & m)
inline

Definition at line 116 of file spn_ispn.h.

References badarg(), and line::InputError::InputError().

Referenced by badarg(), expect(), and explore().

◆ cond1()

double line::spn::ispn_detail::cond1 ( const Mat & A)
inline

Definition at line 277 of file spn_ispn.h.

References cond1(), inv(), and norm1().

Referenced by cond1(), and eliminate().

◆ dot()

double line::spn::ispn_detail::dot ( const Vec & a,
const Vec & b )
inline

Definition at line 201 of file spn_ispn.h.

References dot().

Referenced by dot(), and expect().

◆ eliminate()

◆ enabled_weights()

Vec line::spn::ispn_detail::enabled_weights ( const Net & net,
const Vec & m,
std::vector< bool > & en )
inline

◆ expect()

double line::spn::ispn_detail::expect ( const Vec & r,
const std::string & what,
const Mat & x,
const std::vector< std::vector< std::size_t > > & lv,
int K,
int Ktop,
const Vec & c1,
const Vec & c2,
double tol )
inline

Definition at line 512 of file spn_ispn.h.

References badarg(), dot(), expect(), and max_abs().

Referenced by expect().

◆ explore()

◆ eye()

Mat line::spn::ispn_detail::eye ( std::size_t n)
inline

Definition at line 121 of file spn_ispn.h.

References eye(), and zeros().

Referenced by eliminate(), eye(), and inv().

◆ find_K()

int line::spn::ispn_detail::find_K ( const Elim & E,
int Ktop,
const IspnOptions & opt,
std::size_t p0 )
inline

◆ fmt()

std::string line::spn::ispn_detail::fmt ( const char * f,
double a = 0,
double b = 0,
double c = 0,
double d = 0 )
inline

Definition at line 104 of file spn_ispn.h.

References fmt().

Referenced by eliminate(), fmt(), and lookup().

◆ from_matrix()

Mat line::spn::ispn_detail::from_matrix ( const Matrix< double > & M)
inline

Definition at line 290 of file spn_ispn.h.

References line::Matrix< T >::cols(), from_matrix(), line::Matrix< T >::rows(), and zeros().

Referenced by from_matrix().

◆ gcd_ll()

long long line::spn::ispn_detail::gcd_ll ( long long a,
long long b )
inline

Definition at line 533 of file spn_ispn.h.

References gcd_ll().

Referenced by gcd_ll().

◆ inv()

Mat line::spn::ispn_detail::inv ( const Mat & A)
inline

Definition at line 253 of file spn_ispn.h.

References eye(), inv(), and solve().

Referenced by cond1(), eliminate(), and inv().

◆ lookup()

std::size_t line::spn::ispn_detail::lookup ( Walk & W,
std::map< std::vector< long long >, std::size_t > & keys,
const Vec & m,
const Net & net,
int cap,
const IspnOptions & opt )
inline

Definition at line 346 of file spn_ispn.h.

References fmt(), lookup(), line::spn::ispn_detail::Net::p0, refuse(), and line::spn::ispn_detail::Walk::S.

Referenced by explore(), and lookup().

◆ lu()

std::vector< std::size_t > line::spn::ispn_detail::lu ( Mat & A)
inline

LU with partial pivoting in place; returns the row permutation.

Definition at line 208 of file spn_ispn.h.

References lu().

Referenced by lu(), and solve().

◆ max_abs() [1/2]

double line::spn::ispn_detail::max_abs ( const Mat & A)
inline

Definition at line 144 of file spn_ispn.h.

References max_abs().

◆ max_abs() [2/2]

double line::spn::ispn_detail::max_abs ( const Vec & a)
inline

Definition at line 139 of file spn_ispn.h.

References max_abs().

Referenced by expect(), find_K(), max_abs(), and max_abs().

◆ max_abs_diff()

double line::spn::ispn_detail::max_abs_diff ( const Mat & A,
const Mat & B )
inline

Definition at line 149 of file spn_ispn.h.

References max_abs_diff().

Referenced by find_K(), and max_abs_diff().

◆ minimal()

std::vector< Vec > line::spn::ispn_detail::minimal ( const std::vector< Vec > & D,
std::size_t T,
std::size_t P )
inline

Definition at line 542 of file spn_ispn.h.

References minimal().

Referenced by minimal().

◆ minus()

Mat line::spn::ispn_detail::minus ( const Mat & A,
const Mat & B )
inline

Definition at line 161 of file spn_ispn.h.

References minus().

Referenced by eliminate(), and minus().

◆ mult()

Mat line::spn::ispn_detail::mult ( const Mat & A,
const Mat & B )
inline

Definition at line 173 of file spn_ispn.h.

References mult(), ncols(), and zeros().

Referenced by eliminate(), and mult().

◆ ncols()

std::size_t line::spn::ispn_detail::ncols ( const Mat & A)
inline

Definition at line 126 of file spn_ispn.h.

References ncols().

Referenced by mult(), ncols(), norm1(), solve(), to_matrix(), and vec_mult().

◆ norm1()

double line::spn::ispn_detail::norm1 ( const Mat & A)
inline

Definition at line 268 of file spn_ispn.h.

References ncols(), and norm1().

Referenced by cond1(), and norm1().

◆ plus()

Mat line::spn::ispn_detail::plus ( const Mat & A,
const Mat & B )
inline

Definition at line 155 of file spn_ispn.h.

References plus().

Referenced by eliminate(), and plus().

◆ refuse()

void line::spn::ispn_detail::refuse ( const std::string & m)
inline

Definition at line 110 of file spn_ispn.h.

References refuse(), and line::UnsupportedError::UnsupportedError().

Referenced by eliminate(), lookup(), and refuse().

◆ row_sums()

Vec line::spn::ispn_detail::row_sums ( const Mat & A)
inline

Definition at line 196 of file spn_ispn.h.

References row_sums(), and sum().

Referenced by row_sums().

◆ scale()

Mat line::spn::ispn_detail::scale ( const Mat & A,
double s )
inline

Definition at line 167 of file spn_ispn.h.

References scale().

Referenced by scale().

◆ solve()

Mat line::spn::ispn_detail::solve ( const Mat & A0,
const Mat & B )
inline

Solves A X = B.

Definition at line 233 of file spn_ispn.h.

References lu(), ncols(), solve(), and zeros().

Referenced by inv(), solve(), and solve_left().

◆ solve_left()

Vec line::spn::ispn_detail::solve_left ( const Mat & A,
const Vec & b )
inline

Solves x A = b for the row vector x.

Definition at line 256 of file spn_ispn.h.

References solve(), solve_left(), and zeros().

Referenced by solve_left().

◆ sub()

Mat line::spn::ispn_detail::sub ( const Mat & A,
const std::vector< std::size_t > & r,
const std::vector< std::size_t > & c )
inline

Definition at line 127 of file spn_ispn.h.

References sub(), and zeros().

Referenced by find_K(), and sub().

◆ sum()

double line::spn::ispn_detail::sum ( const Vec & a)
inline

Definition at line 191 of file spn_ispn.h.

References sum().

Referenced by row_sums(), and sum().

◆ to_matrix()

Matrix< double > line::spn::ispn_detail::to_matrix ( const Mat & A)
inline

Definition at line 284 of file spn_ispn.h.

References ncols(), and to_matrix().

Referenced by to_matrix().

◆ unstable()

void line::spn::ispn_detail::unstable ( const std::string & m)
inline

Definition at line 113 of file spn_ispn.h.

References line::NumericError::NumericError(), and unstable().

Referenced by unstable().

◆ vec_mult()

Vec line::spn::ispn_detail::vec_mult ( const Vec & x,
const Mat & A )
inline

Definition at line 184 of file spn_ispn.h.

References ncols(), and vec_mult().

Referenced by vec_mult().

◆ zeros()

Mat line::spn::ispn_detail::zeros ( std::size_t n,
std::size_t m )
inline

Definition at line 120 of file spn_ispn.h.

References zeros().

Referenced by eliminate(), eye(), from_matrix(), mult(), solve(), solve_left(), sub(), and zeros().