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.

5.12 Vectors with Integer Entries ( integer vector )<br />

1. Definition<br />

An instance of data type integer vector is a vector of variables of type integer, the so called<br />

ring type. Together with the type integer matrix it realizes the basic operations of linear<br />

algebra. Internal correctness tests are executed if compiled with the flag LA SELFTEST.<br />

#include < <strong>LEDA</strong>/numbers/integer vector.h ><br />

2. Creation<br />

integer vector v; creates an instance v of type integer vector. v is initialized to<br />

the zero-dimensional vector.<br />

integer vector v(int d); creates an instance v of type integer vector. v is initialized to<br />

a vector of dimension d.<br />

integer vector<br />

integer vector<br />

v(const integer& a, const integer& b);<br />

creates an instance v of type integer vector. v is initialized to<br />

the two-dimensional vector (a, b).<br />

v(const integer& a, const integer& b, const integer& c);<br />

creates an instance v of type integer vector. v is initialized to<br />

the three-dimensional vector (a, b, c).<br />

integer vector v(const integer& a, const integer& b, const integer& c,<br />

const integer& d);<br />

creates an instance v of type integer vector; v is initialized to<br />

the four-dimensional vector (a, b, c, d).<br />

3. Operations<br />

int v.dim( ) returns the dimension of v.<br />

integer& v[int i] returns i-th component of v.<br />

Precondition: 0 ≤ i ≤ v.dim( ) − 1.<br />

integer vector&<br />

integer vector&<br />

v += const integer vector& v1<br />

v −= const integer vector& v1<br />

Addition plus assignment.<br />

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

Subtraction plus assignment.<br />

Precondition: v.dim( ) == v1.dim( ).

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

Saved successfully!

Ooh no, something went wrong!