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.

at vector<br />

v(const array& A);<br />

introduces a variable v of type rat vector initialized to<br />

the d-dimensional vector with homogeneous coordinates<br />

(±c 0 , . . . , ±c d−1 , ±D), where d = A.size() and A[i] =<br />

c i /D, for i = 0, . . . , d − 1.<br />

rat vector<br />

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

introduces a variable v of type rat vector initialized to<br />

the two-dimensional vector with homogeneous representation<br />

(a, b, 1).<br />

rat vector<br />

v(const integer vector& c, integer D);<br />

introduces a variable v of type rat vector initialized<br />

to the vector with homogeneous coordinates<br />

(±c 0 , . . . , ±c d−1 , ±D), where d is the dimension of c and<br />

the sign chosen is the sign of D.<br />

Precondition: D is non-zero.<br />

rat vector<br />

v(const integer vector& c);<br />

introduces a variable v of type rat vector initialized to<br />

the direction with homogeneous coordinate vector ±c,<br />

where the sign chosen is the sign of the last component<br />

of c.<br />

Precondition: <strong>The</strong> last component of c is non-zero.<br />

rat vector<br />

v(const vector& w, int prec);<br />

introduces a variable v of type rat vector initialized to<br />

(⌊P ∗ w 0 ⌋, . . . , ⌊P ∗ w d−1 ⌋, P ), where d is the dimension<br />

of w and P = 2 prec .<br />

3. Operations<br />

3.1 Initialization, Access and Conversions<br />

rat vector rat vector :: d2(integer a, integer b, integer D)<br />

returns a rat vector of dimension 2 initialized<br />

to a vector with homogeneous representation<br />

(a, b, D) if D is positive and representation<br />

(−a, −b, −D) if D is negative.<br />

Precondition: D is non-zero.

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

Saved successfully!

Ooh no, something went wrong!