Public Member Functions

regina::NFastRay Class Reference
[Mathematical Support]

A fast but inflexible class storing a ray rooted at the origin whose coordinates are rational. More...

#include <nfastray.h>

Inheritance diagram for regina::NFastRay:
regina::NFastVector< NLargeInteger >

List of all members.

Public Member Functions

 NFastRay (unsigned length)
 Creates a new ray all of whose coordinates are initialised to zero.
 NFastRay (const NFastVector< NLargeInteger > &cloneMe)
 Creates a new ray that is a clone of the given ray.
void scaleDown ()
 Scales this vector down by the greatest common divisor of all its elements.

Detailed Description

A fast but inflexible class storing a ray rooted at the origin whose coordinates are rational.

This class is similar to NRay but is better suited to heavy computation. Like its base class NFastVector, it has a streamlined implementation with no virtual methods, but it cannot talk easily to any vector class other than itself. For a slower but more flexible ray class, see the NRay hierarchy instead.

As with the NRay class, the ray described by this class is a half-line beginning at the origin, represented by an integer point that it passes through. Positive scalar multiples of a ray are considered to represent the same ray.

Python:
Not present.

Constructor & Destructor Documentation

regina::NFastRay::NFastRay ( unsigned  length ) [inline]

Creates a new ray all of whose coordinates are initialised to zero.

Parameters:
lengththe number of elements in the new vector.
regina::NFastRay::NFastRay ( const NFastVector< NLargeInteger > &  cloneMe ) [inline]

Creates a new ray that is a clone of the given ray.

Parameters:
cloneMethe ray to clone.

Member Function Documentation

void regina::NFastRay::scaleDown (  )

Scales this vector down by the greatest common divisor of all its elements.

The resulting vector will be the smallest multiple of the original that maintains integral entries, and these entries will have the same signs as the originals.

This routine thus reduces a ray to its smallest possible representation.

This routine poses no problem for vectors containing infinite elements; such elements are simply ignored and left at infinity.


The documentation for this class was generated from the following file:

Copyright © 1999-2009, Ben Burton
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).