regina::NRay Class Reference
[Mathematical Support]

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

#include <nray.h>

Inheritance diagram for regina::NRay:
regina::NVectorDense< NLargeInteger > regina::NVector< NLargeInteger > regina::NAngleStructureVector regina::NNormalSurfaceVector regina::NNormalSurfaceVectorANStandard regina::NNormalSurfaceVectorMirrored regina::NNormalSurfaceVectorStandard 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.
virtual NVector< NLargeInteger > * clone () const
 Makes a newly allocated clone of this vector.
virtual void negate ()
 Negates every element of this vector.
void scaleDown ()
 Scales this vector down by the greatest common divisor of all its elements.

Detailed Description

A slow but flexible class 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.

Like its parent class NVector, this ray class is slow (in particular, many functions are virtual). For a fast ray class better suited to heavy computation, see NFastRay instead.

Warning:
Subclasses of NRay must override clone() to return a ray of the correct subclass! Otherwise the vectors returned by vertex enumeration routines might be NRay objects instead of objects of the appropriate derived class.
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:
length the 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:
cloneMe the ray to clone.

Member Function Documentation

NVector< NLargeInteger > * regina::NRay::clone (  )  const [inline, virtual]

Makes a newly allocated clone of this vector.

The clone will be of the same subclass of NVector as this vector.

Returns:
a clone of this vector.

Reimplemented from regina::NVectorDense< NLargeInteger >.

Reimplemented in regina::NAngleStructureVector, regina::NNormalSurfaceVectorANStandard, regina::NNormalSurfaceVectorQuad, regina::NNormalSurfaceVectorQuadOct, and regina::NNormalSurfaceVectorStandard.

void regina::NRay::negate (  )  [inline, virtual]

Negates every element of this vector.

Reimplemented from regina::NVectorDense< NLargeInteger >.

void regina::NRay::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).