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.

at vector&<br />

rat vector<br />

rat vector&<br />

v += const rat vector& w addition plus assignment.<br />

const rat vector& v − const rat vector& w<br />

subtracts cartesian coordinates.<br />

v −= const rat vector& w subtraction plus assignment.<br />

rat vector −v returns -v.<br />

3.4 Input and Output<br />

ostream&<br />

istream&<br />

ostream& O ≪ const rat vector& v<br />

istream& I ≫ rat vector& v<br />

writes v’s homogeneous coordinates<br />

componentwise to the output stream<br />

O.<br />

reads v’s homogeneous coordinates componentwise<br />

from the input stream I. <strong>The</strong> operator<br />

uses the current dimension of v.<br />

3.5 Linear Hull, Dependence and Rank<br />

bool contained in linear hull(const array& A,<br />

const rat vector& x)<br />

determines whether x is contained in the linear<br />

hull of the vectors in A.<br />

int linear rank(const array& A)<br />

bool linearly independent(const array& A)<br />

array linear base(const array& A)<br />

4. Implementation<br />

computes the linear rank of the vectors in A.<br />

decides whether the vectors in A are linearly<br />

independent.<br />

computes a basis of the linear space spanned<br />

by the vectors in A.<br />

Vectors are implemented by arrays of integers as an item type. All operations like creation,<br />

initialization, tests, vector arithmetic, input and output on an vector v take time<br />

O(v.dim( )). dim( ), coordinate access and conversions take constant time. <strong>The</strong> operations<br />

for linear hull, rank and independence have the cubic costs of the used matrix<br />

operations. <strong>The</strong> space requirement is O(v.dim( )).

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

Saved successfully!

Ooh no, something went wrong!