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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

integer matrix inverse(const integer matrix& M, integer& D)<br />

returns the inverse matrix of M. More precisely,<br />

1/D times the matrix returned is the inverse of<br />

M.<br />

Precondition: determinant(M) ≠ 0.<br />

bool<br />

inverse(const integer matrix& M, integer matrix& inverse,<br />

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

determines whether M has an inverse. It also computes either<br />

the inverse as (1/D) · inverse or a vector c such that c T · M = 0.<br />

integer determinant(const integer matrix& M, integer matrix& L,<br />

integer matrix& U, array& q, integer vector& c)<br />

returns the determinant D of M and sufficient information to<br />

verify that the value of the determinant is correct. If the determinant<br />

is zero then c is a vector such that c T · M = 0. If<br />

the determinant is non-zero then L and U are lower and upper<br />

diagonal matrices respectively and q encodes a permutation matrix<br />

Q with Q(i, j) = 1 iff i = q(j) such that L · M · Q = U,<br />

L(0, 0) = 1, L(i, i) = U(i − 1, i − 1) for all i, 1 ≤ i < n, and<br />

D = s · U(n − 1, n − 1) where s is the determinant of Q.<br />

Precondition: M is quadratic.<br />

bool verify determinant(const integer matrix& M, integer D,<br />

integer matrix& L, integer matrix& U,<br />

array q, integer vector& c)<br />

verifies the conditions stated above.<br />

integer determinant(const integer matrix& M)<br />

returns the determinant of M.<br />

Precondition: M is quadratic.<br />

int sign of determinant(const integer matrix& M)<br />

returns the sign of the determinant of M.<br />

Precondition: M is quadratic.<br />

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

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

integer matrix& spanning vectors, integer vector& c)<br />

determines the complete solution space of the linear system M ·<br />

x = b. If the system is unsolvable then c T ·M = 0 and c T ·b ≠ 0. If<br />

the system is solvable then (1/D)x is a solution, and the columns<br />

of spanning vectors are a maximal set of linearly independent<br />

solutions to the corresponding homogeneous system.<br />

Precondition: M.dim1() == b.dim().

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

Saved successfully!

Ooh no, something went wrong!