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 vector<br />

integer vector<br />

integer<br />

integer vector<br />

integer vector<br />

ostream&<br />

istream&<br />

v + const integer vector& v1<br />

v − const integer vector& v1<br />

v ∗ const integer vector& v1<br />

const integer& r ∗ const integer vector& v<br />

const integer vector& v ∗ const integer& r<br />

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

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

Addition.<br />

Precondition: v.dim( ) == v1.dim( ).<br />

Subtraction.<br />

Precondition: v.dim( ) == v1.dim( ).<br />

Inner Product.<br />

Precondition: v.dim( ) == v1.dim( ).<br />

Componentwise multiplication with number<br />

r.<br />

Componentwise multiplication with number<br />

r.<br />

writes v componentwise to the output<br />

stream O.<br />

reads v componentwise from the input<br />

stream I.<br />

4. Implementation<br />

Vectors are implemented by arrays of type integer. All operations on a vector v take<br />

time O(v.dim( )), except for dimension and [ ] which take constant time. <strong>The</strong> space<br />

requirement is O(v.dim( )).

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

Saved successfully!

Ooh no, something went wrong!