31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ool linear solver(const integer matrix& M, const integer vector& b,<br />

integer vector& x, integer& D, integer vector& c)<br />

determines whether the linear system M ·x = b is solvable. If yes,<br />

then (1/D)x is a solution, if not then c T · M = 0 and c T · b ≠ 0.<br />

Precondition: M.dim1() == b.dim().<br />

bool linear solver(const integer matrix& M, const integer vector& b,<br />

integer vector& x, integer& D)<br />

as above, but without the witness c<br />

Precondition: M.dim1() == b.dim().<br />

bool is solvable(const integer matrix& M, const integer vector& b)<br />

determines whether the system M · x = b is solvable<br />

Precondition: M.dim1() == b.dim().<br />

bool homogeneous linear solver(const integer matrix& M,<br />

integer vector& x)<br />

determines whether the homogeneous linear system M · x = 0<br />

has a non - trivial solution. If yes, then x is such a solution.<br />

int homogeneous linear solver(const integer matrix& M,<br />

integer matrix& spanning vecs)<br />

determines the solution space of the homogeneous linear system<br />

M · x = 0. It returns the dimension of the solution space. Moreover<br />

the columns of spanning vecs span the solution space.<br />

void<br />

independent columns(const integer matrix& M, array& columns)<br />

returns the indices of a maximal subset of independent columns<br />

of M. <strong>The</strong> index range of columns starts at 0.<br />

int rank(const integer matrix& M)<br />

returns the rank of matrix M<br />

ostream& ostream& O ≪ const integer matrix& M<br />

writes matrix M row by row to the output stream O.<br />

istream&<br />

istream& I ≫ integer matrix& M<br />

reads matrix M row by row from the input stream I.<br />

4. Implementation<br />

<strong>The</strong> datatype integer matrix is implemented by two-dimensional arrays of variables of<br />

type integer. Operations determinant, inverse, linear solver, and rank take time O(n 3 ),<br />

column takes time O(n), row, dim1 , dim2 , take constant time, and all other operations<br />

take time O(nm). <strong>The</strong> space requirement is O(nm).<br />

All functions on integer matrices compute the exact result, i.e., there is no rounding<br />

error. <strong>The</strong> implemenation follows a proposal of J. Edmonds (J. Edmonds, Systems of

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!