Regina Calculation Engine
Public Member Functions
regina::NRay Class Reference

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

#include <maths/nray.h>

Inheritance diagram for regina::NRay:
regina::NVector< NLargeInteger > regina::NAngleStructureVector regina::NNormalSurfaceVector regina::NNormalSurfaceVectorANStandard regina::NNormalSurfaceVectorMirrored regina::NNormalSurfaceVectorOriented regina::NNormalSurfaceVectorStandard regina::NNormalSurfaceVectorOrientedQuad regina::NNormalSurfaceVectorQuad regina::NNormalSurfaceVectorQuadOct

List of all members.

Public Member Functions

 NRay (unsigned length)
 Creates a new ray all of whose coordinates are initialised to zero.
 NRay (const NVector< 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.
void negate ()
 Negates every element of this vector.

Detailed Description

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

Such a ray is a half-line beginning at the origin and is represented by an integer point that it passes through. Positive scalar multiples of a ray are considered to represent the same ray.

This class is intended for serious computation, and as a result it has a streamlined implementation with no virtual methods. It can be subclassed, but since there are no virtual methods, type information must generally be known at compile time. Nevertheless, in many respects, different subclasses of NRay can happily interact with one another.

Warning:
As of Regina 4.90, this class merges the old functionality of NFastRay and NRay from Regina 4.6. Since functions are no longer virtual, the old clone() method and intersect() function are gone completely. Instead you can just use the copy constructor and standard linear operators respectively.
Python:
Not present.

Constructor & Destructor Documentation

regina::NRay::NRay ( 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::NRay::NRay ( const NVector< 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::NRay::negate ( ) [inline]

Negates every element of this vector.

Reimplemented from regina::NVector< NLargeInteger >.

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-2012, The Regina development team
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).