A fast but inflexible class storing a ray rooted at the origin whose coordinates are rational. More...
#include <nfastray.h>
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. |
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.
regina::NFastRay::NFastRay | ( | unsigned | length | ) | [inline] |
Creates a new ray all of whose coordinates are initialised to zero.
length | the 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.
cloneMe | the ray to clone. |
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.